Documentation ¶
Overview ¶
Package asgard provides middleware for use in HTTP API servers. In Norse mythology, Heimdallr is the gatekeeper of Bifröst.
Heimdallr returna a HTTP Handler middleware function that parses a header for authentication information. On success, it stores an Identity in the request context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientCert ¶ added in v1.16.0
func ClientCert(ctx context.Context) (*bifrost.Certificate, bool)
ClientCert returns the client certificate from the request context. If the client certificate is not present, the second return value is false. Use this function to access the client certificate in a HTTP handler that has been wrapped with Heimdallr.
func Heimdallr ¶
Heimdallr returns a HTTP Handler middleware function that parses an AuthorizedRequestContext from the request context header. If namespace does not match the parsed one, the request is forbidden. The AuthorizedRequestContext is stored in the request context.
If Heimdallr is used in an AWS Lambda Web Adapter powered API server, Bouncer Lambda Authorizer must be configured as an authorizer for the API Gateway method.
Types ¶
type HeaderName ¶ added in v1.16.0
type HeaderName int
const ( HeaderNameClientCertLeaf HeaderName = iota // X-Amzn-Mtls-Clientcert-Leaf HeaderNameClientCert // X-Amzn-Mtls-Clientcert )
func (HeaderName) String ¶ added in v1.16.0
func (i HeaderName) String() string