Documentation
¶
Overview ¶
Package club provides middleware for use in HTTP API servers and gateways.
Index ¶
Constants ¶
const (
RequestContextHeader = "x-amzn-request-context"
)
Variables ¶
This section is empty.
Functions ¶
func Bouncer ¶
Bouncer returns a HTTP Handler middleware function that adds the TLS client certificate from the request to the x-amzn-request-context header.
func ID ¶ added in v1.4.1
ID identifies a client from the request context. Interceptor must run before this function is called for a request.
func Interceptor ¶
Interceptor is a HTTP handler middleware function that parses the x-amzn-request-context request header. The header is expected to contain a JSON encoded RequestContext. The identity namespace, client's UUID, and certificate are added to the request context.
Types ¶
type ClientCert ¶
type ClientCert struct {
ClientCertPEM []byte `json:"clientCertPEM"`
IssuerDN string `json:"issuerDN"`
SerialNumber string `json:"serialNumber"`
SubjectDN string `json:"subjectDN"`
Validity validity `json:"validity"`
}
ClientCert contains fields related to TLS Client Certificates.
type RequestContext ¶
type RequestContext struct {
Authentication struct {
ClientCert ClientCert `json:"clientCert"`
} `json:"authentication"`
}
RequestContext is passed to the HTTP handler as a JSON encoded header value.
func NewRequestContext ¶ added in v1.4.0
func NewRequestContext(crt *x509.Certificate) *RequestContext