Documentation ¶
Index ¶
- type Claims
- type Client
- func (c *Client) GenerateAnonymousTokens(ctx context.Context) (*Tokens, error)
- func (c *Client) Middleware(next http.Handler) http.Handler
- func (c *Client) Refresh(ctx context.Context, payload RefreshPayload) (*Tokens, error)
- func (c *Client) ValidateAccessToken(ctx context.Context, payload ValidationPayload) (*Claims, error)
- type RefreshPayload
- type Tokens
- type ValidationPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { Name string `json:"name,omitempty"` Level string `json:"level"` jwt.RegisteredClaims }
Claims is a struct representing the claims returned by the authentication service.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct representing the authentication service client.
func (*Client) GenerateAnonymousTokens ¶
GenerateAnonymousTokens generates anonymous tokens from the authentication service.
func (*Client) Middleware ¶
Middleware handles authentication / authorization for a request.
func (*Client) ValidateAccessToken ¶
func (c *Client) ValidateAccessToken(ctx context.Context, payload ValidationPayload) (*Claims, error)
ValidateAccessToken validates the access token.
type RefreshPayload ¶
type RefreshPayload struct {
RefreshToken string `json:"refreshToken"`
}
RefreshPayload is a struct representing the payload for the refresh token request.
type Tokens ¶
type Tokens struct { RefreshToken string `json:"refreshToken,omitempty"` AccessToken string `json:"accessToken"` AccessTokenExpiration int64 `json:"accessTokenExpiration"` RefreshTokenExpiration int64 `json:"refreshTokenExpiration,omitempty"` }
Tokens is a struct representing the tokens returned by the authentication service.
type ValidationPayload ¶
type ValidationPayload struct {
AccessToken string `json:"accessToken"`
}
ValidationPayload is a struct representing the payload for the access token validation request.
Click to show internal directories.
Click to hide internal directories.