Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractToken ¶
func VerifiedJwtToken ¶
Types ¶
type AuthenticatorT ¶
func AuthenticatorC ¶
func AuthenticatorC( secretKey []byte, ) AuthenticatorT
AuthenticatorC constructs an AuthenticatorT function from the secretKey argument. The constructed authenticator only uses the JWT token signature and expiration to authenticate. A more elaborate authenticator could use a cache to enable immediate token invalidation in case of logout.
type ErrorDetail ¶
type ErrorResult ¶
type ErrorResult struct { StatusCode int StatusPhrase string DeveloperMessage string ErrorString string TraceId string ParentSpanId string SpanId string Cause map[string]string Args []any Details []ErrorDetail }
func DefaultErrorHandler ¶
func DefaultErrorHandler(errorContents any, ctx RequestContext) ErrorResult
type RequestContext ¶
type RequestContext struct { Username string Token *jwt.Token }
func DefaultReqCtxExtractor ¶
DefaultReqCtxExtractor returns a RequestContext based on token if token is not nil, returns a zero RequestToken otherwise. It never returns an error.
type TokenDetails ¶
type TokenDetails struct { AccessToken *jwt.Token RefreshToken *jwt.Token AccessUuid string RefreshUuid string }
func CreateToken ¶
func (TokenDetails) AccessClaims ¶
func (s TokenDetails) AccessClaims() jwt.MapClaims
func (TokenDetails) AccessExp ¶
func (s TokenDetails) AccessExp() int64
func (TokenDetails) RefreshClaims ¶
func (s TokenDetails) RefreshClaims() jwt.MapClaims
func (TokenDetails) RefreshExp ¶
func (s TokenDetails) RefreshExp() int64
func (TokenDetails) Sub ¶
func (s TokenDetails) Sub() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.