Documentation ¶
Index ¶
Constants ¶
View Source
const ( CookieKeyJWTPayload = "jwtPayload" CookieKeyJWTSignature = "jwtSignature" CookieKeyRefreshToken = "jwtRefreshToken" )
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
func HashAndSalt ¶
Types ¶
type Crypto ¶
type Crypto interface { Encrypt(spec *modelV1.SecretSpec) error Decrypt(spec *modelV1.SecretSpec) error }
type JWT ¶
type JWT interface { SignedAccessToken(login string) (string, error) SignedRefreshToken(login string) (string, error) // CreateAccessTokenCookie will create two different cookies that contain a piece of the token. // As a reminder, a JWT token has the following structure: header.payload.signature // The first cookie will contain the struct header.payload that can then be manipulated by Javascript // The second cookie will contain the signature, and it won't be accessible by Javascript. CreateAccessTokenCookie(accessToken string) (*http.Cookie, *http.Cookie) DeleteAccessTokenCookie() (*http.Cookie, *http.Cookie) CreateRefreshTokenCookie(refreshToken string) *http.Cookie DeleteRefreshTokenCookie() *http.Cookie ValidateRefreshToken(token string) (*JWTCustomClaims, error) Middleware(skipper middleware.Skipper) echo.MiddlewareFunc }
type JWTCustomClaims ¶
type JWTCustomClaims struct {
jwt.RegisteredClaims
}
func ExtractJWTClaims ¶
func ExtractJWTClaims(ctx echo.Context) *JWTCustomClaims
Click to show internal directories.
Click to hide internal directories.