Documentation ¶
Index ¶
- Constants
- func AuthorizationFilter(opts AuthorizationOptions) middleware.Func
- func Forbidden(writer http.ResponseWriter, err string)
- func InsufficientScope(writer http.ResponseWriter, err string, scopes []string)
- func UnauthorizedWithHeader(writer http.ResponseWriter, err string)
- type AuthorizationEndpointOptions
- type AuthorizationOptions
Constants ¶
View Source
const AuthorizationFilterCode = "auth"
AuthorizationFilterCode is the code used to register this middleware
Variables ¶
This section is empty.
Functions ¶
func AuthorizationFilter ¶
func AuthorizationFilter(opts AuthorizationOptions) middleware.Func
AuthorizationFilter is a middleware that handles authorization using an OpendID Connect server
func Forbidden ¶
func Forbidden(writer http.ResponseWriter, err string)
Forbidden returns a StatusForbidden error
func InsufficientScope ¶
func InsufficientScope(writer http.ResponseWriter, err string, scopes []string)
InsufficientScope adds to the response a WWW-Authenticate header and returns a StatusForbidden error
func UnauthorizedWithHeader ¶
func UnauthorizedWithHeader(writer http.ResponseWriter, err string)
UnauthorizedWithHeader adds to the response a WWW-Authenticate header and returns a StatusUnauthorized error
Types ¶
type AuthorizationEndpointOptions ¶
type AuthorizationEndpointOptions struct { Audience string `mapstructure:"audience"` Disabled bool `mapstructure:"disabled"` ClaimsRequirement map[string]string `mapstructure:"claims_requirement"` AllowedScopes []string `mapstructure:"allowed_scopes"` }
AuthorizationEndpointOptions are the options configured for each endpoint
type AuthorizationOptions ¶
type AuthorizationOptions struct { Authority string `mapstructure:"authority"` SecretProvider oidc.SecretProvider }
AuthorizationOptions are the options configured for all endpoints
Click to show internal directories.
Click to hide internal directories.