Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrJWTNotFound describes error when kid is missing in repository ErrJWTNotFound = errors.New("jwt not found in repository") // ErrJWTExpired fires when jwt exist and expired ErrJWTExpired = errors.New("jwt exists in repository, marked as expired, must be deleted") // ErrJWTInvalid fires when jwt are not valid ErrJWTInvalid = errors.New("jwt exists in repository and is not valid") )
Functions ¶
This section is empty.
Types ¶
type RepoOptions ¶
type RepoOptions struct { Store *svalkey.Store Prefix string Opts *DefaultOptions }
RepoOptions holds options for NewJWTRepo func
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository holds all jwt
func New ¶
func New(repoOpts *RepoOptions) (*Repository, error)
New returns pointer to new KeysRepository
func (*Repository) JWTExists ¶
func (p *Repository) JWTExists(jti string) (bool, error)
JWTExists return true if jwt is in db
func (*Repository) List ¶
func (p *Repository) List() ([]StoreValue, error)
List returns all jwt in db it's dangerous operation because db may hold to much tokens
type StoreValue ¶
type StoreValue struct { JTI string RefreshToken string Expiry jwt.NumericDate // RefreshToken expiry time }
StoreValue holds internal storage structure
Click to show internal directories.
Click to hide internal directories.