package
0.12.8
Repository: https://github.com/rotationalio/ensign.git
Documentation: pkg.go.dev

# Functions

Authenticate middleware ensures that the request has a valid Bearer JWT in the Authenticate header of the request otherwise it stops processing of the request and returns a 401 unauthorized error.
Authorize is a middleware that requires specific permissions in an authenticated user's claims.
ClearAuthCookies is a helper function to clear authentication cookies on a gin request to effectively log out a user.
ContextFromRequest creates a context from the gin request context, copying fields that may be required for forwarded requests.
DoubleCookie is a Cross-Site Request Forgery (CSR/XSRF) protection middleware that checks the presence of an X-CSRF-TOKEN header containing a cryptographically random token that matches a token contained in the CSRF-TOKEN cookie in the request.
No description provided by the author
GetAccessToken retrieves the bearer token from the authorization header and parses it to return only the JWT access token component of the header.
GetClaims fetches and parses Quarterdeck claims from the gin context.
GetRefreshToken retrieves the refresh token from the cookies in the request.
NewAuthOptions creates an AuthOptions object with reasonable defaults and any user supplied input from the AuthOption variadic arguments.
No description provided by the author
No description provided by the author
Reauthenticate is a middleware helper that can use refresh tokens in the gin context to obtain a new access token.
SetAuthCookies is a helper function to set authentication cookies on a gin request.
SetDoubleCookieToken is a helper function to set cookies on a gin request.
TaskContext creates a cloned context specifically for tasks that services need to perform outside of the request context.
WithAudience allows the user to specify an alternative audience.
WithAuthOptions allows the user to update the default auth options with an auth options struct to set many options values at once.
WithContext allows the user to specify an external, cancelable context to control the background refresh behavior of the JWKS cache.
WithIssuer allows the user to specify an alternative issuer.
WithJWKSEndpoint allows the user to specify an alternative endpoint to fetch the JWKS public keys from.
WithMinRefreshInterval allows the user to specify an alternative minimum duration between cache refreshes to control refresh behavior for the JWKS public keys.
WithReauthenticator allows the user to specify a reauthenticator to the auth middleware.
WithValidator allows the user to specify an alternative validator to the auth middleware.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Parameters and headers for double-cookie submit CSRF protection.
Parameters and headers for double-cookie submit CSRF protection.
Parameters and headers for double-cookie submit CSRF protection.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

AuthOptions is constructed from variadic AuthOption arguments with reasonable defaults.
IPRateLimiter is an IP address based limiter that controls how frequently requests can be made from a single IP address.

# Type aliases

AuthOption allows users to optionally supply configuration to the Authorization middleware.