Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizeHeader ¶
AuthorizeHeader checks if the request has a Basic Auth header matching the specified username and password. Username is optional and will be ignored if nil.
func AuthorizeHeaderForAllowedTypes ¶
func AuthorizeHeaderForAllowedTypes(ctx context.Context, allowedTypes []AuthTokenType) bool
AuthorizeHeaderForAllowedTypes checks whether the request has a Basic Auth header matching one of the known token types. If the request has a valid token, it returns true. Otherwise, it returns false.
func MakeHeader ¶
MakeHeader takes a password and an optional username and base64 encodes them in the format required for a basic auth header. The output can be used as the value for the "Authorization" header.
Types ¶
type AuthTokenType ¶
type AuthTokenType string
const ( AuthTokenTypeRetool AuthTokenType = "Retool" AuthTokenTypeMonitoring AuthTokenType = "Monitoring" )
Click to show internal directories.
Click to hide internal directories.