Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
Authorizer implements the security.Authorizer interface for an api key based authorization.
func NewAuthorizer ¶
func NewAuthorizer(authConfig *Config, apiKey string) *Authorizer
NewAuthorizer returns a new Authorizer for api key authorization with a config and a valid api key.
func (*Authorizer) Authorize ¶
func (a *Authorizer) Authorize(r *http.Request, w http.ResponseWriter) (context.Context, bool)
Authorize authorizes a request based on the configured api key the config of the security schema Success: A context with a token containing the api key and true Error: the unchanged request context and false. the response already contains the error message
func (*Authorizer) CanAuthorizeRequest ¶ added in v0.1.27
func (a *Authorizer) CanAuthorizeRequest(r http.Request) bool
CanAuthorizeRequest returns true, if the request contains a token in the configured header, otherwise false
Click to show internal directories.
Click to hide internal directories.