Documentation ¶
Index ¶
- type AccessDetails
- type Module
- func (m Module) Close() error
- func (m *Module) CreateAuth(ctx context.Context, userid string, td *TokenDetails) error
- func (m *Module) CreateToken(ctx context.Context, user *models.User) (*TokenDetails, error)
- func (m *Module) DeleteRefreshToken(ctx context.Context, refreshToken string) error
- func (m *Module) DeleteTokens(ctx context.Context, authD *AccessDetails) error
- func (m *Module) ExtractTokenMetadata(r *http.Request) (*AccessDetails, error)
- func (m *Module) RefreshAccessToken(ctx context.Context, refreshToken string) (*TokenDetails, error)
- type TokenDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDetails ¶
AccessDetails contains data stored in the jwt token
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is a module for processing jwt tokens
func (*Module) CreateAuth ¶
CreateAuth inserts the token data into the KV
func (*Module) CreateToken ¶
CreateToken creates a token based on a user
func (*Module) DeleteRefreshToken ¶
DeleteRefreshToken deletes a refresh token from KV
func (*Module) DeleteTokens ¶
func (m *Module) DeleteTokens(ctx context.Context, authD *AccessDetails) error
DeleteTokens deletes tokens from the KV
func (*Module) ExtractTokenMetadata ¶
func (m *Module) ExtractTokenMetadata(r *http.Request) (*AccessDetails, error)
ExtractTokenMetadata gets the token from the bearer token
func (*Module) RefreshAccessToken ¶
func (m *Module) RefreshAccessToken(ctx context.Context, refreshToken string) (*TokenDetails, error)
RefreshAccessToken generates a new access token for a given refresh token
Click to show internal directories.
Click to hide internal directories.