Documentation ¶
Index ¶
- Constants
- Variables
- type Jwt
- func (j *Jwt) BlacklistToken(verified *VerifiedToken, token string) error
- func (j *Jwt) EncodeToken(token string) string
- func (j *Jwt) GenerateToken(user *datastore.User) (Token, error)
- func (j *Jwt) ValidateAccessToken(accessToken string) (*VerifiedToken, error)
- func (j *Jwt) ValidateRefreshToken(refreshToken string) (*VerifiedToken, error)
- type JwtRealm
- type Token
- type VerifiedToken
Constants ¶
View Source
const ( JwtDefaultSecret string = "convoy-jwt" JwtDefaultRefreshSecret string = "convoy-refresh-jwt" JwtDefaultExpiry int = 1800 //seconds JwtDefaultRefreshExpiry int = 86400 //seconds )
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrTokenExpired = errors.New("expired token") )
Functions ¶
This section is empty.
Types ¶
type Jwt ¶
type Jwt struct { Secret string Expiry int RefreshSecret string RefreshExpiry int // contains filtered or unexported fields }
func (*Jwt) BlacklistToken ¶
func (j *Jwt) BlacklistToken(verified *VerifiedToken, token string) error
func (*Jwt) EncodeToken ¶
func (*Jwt) ValidateAccessToken ¶
func (j *Jwt) ValidateAccessToken(accessToken string) (*VerifiedToken, error)
func (*Jwt) ValidateRefreshToken ¶
func (j *Jwt) ValidateRefreshToken(refreshToken string) (*VerifiedToken, error)
type JwtRealm ¶
type JwtRealm struct {
// contains filtered or unexported fields
}
func NewJwtRealm ¶
func NewJwtRealm(userRepo datastore.UserRepository, opts *config.JwtRealmOptions, cache cache.Cache) *JwtRealm
func (*JwtRealm) Authenticate ¶
func (j *JwtRealm) Authenticate(ctx context.Context, cred *auth.Credential) (*auth.AuthenticatedUser, error)
type VerifiedToken ¶
Click to show internal directories.
Click to hide internal directories.