# Functions
CheckOrigin - check whether the request generated from the allowed origin.
ConvertContext function converts the input map to a pongo2.Context type and preserves the key-value pairs.
CORS - Cross-Origin Resource Sharing.
Firewall - whitelist/blacklist IPs.
GetJWT - issue new tokens.
InitSentry - initialize sentry for middleware or separate goroutines
required parameter (1st parameter): sentryDsn
optional parameter (2nd parameter): environment (development or production)
optional parameter (3rd parameter): release version or git commit number
optional parameter (4th parameter): enableTracing (yes or no)
optional parameter (5th parameter): tracesSampleRate (0.0 - 1.0).
JWT - validate access token.
Pongo2 uses the Pongo2 template library https://github.com/flosch/pongo2 to render templates
Example: baseDirectory = "templates/".
RateLimit - rate limit middleware.
RefreshJWT - validate refresh token.
ResetFirewallState - helper function to reset firewall package-level variables.
SentryCapture - sentry middleware to capture errors and forward to sentry.io
required parameter (1st parameter): sentryDsn
optional parameter (2nd parameter): environment (development or production)
optional parameter (3rd parameter): release version or git commit number
optional parameter (4th parameter): enableTracing (yes or no)
optional parameter (5th parameter): tracesSampleRate (0.0 - 1.0).
StringFromContext function retrieves the value from the context and returns it as a string.
TwoFA validates 2-FA status from JWT before forwarding the request to the controller.
ValidateAccessJWT - verify the access JWT's signature, and validate its claims.
ValidateECDSA - validate elliptic curve digital signature algorithm based token.
ValidateHMACAccess - validate hash based access token.
ValidateHMACRefresh - validate hash based refresh token.
ValidateRefreshJWT - verify the refresh JWT's signature, and validate its claims.
ValidateRSA - validate Rivest–Shamir–Adleman cryptosystem based token.
# Variables
JWTParams - exported variables.
# Structs
CORSPolicy struct to handle all policies.
JWTClaims ...
JWTParameters - params to configure JWT.
JWTPayload ...
MyCustomClaims ...