club

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package club provides middleware for use in HTTP API servers and gateways.

Index

Constants

View Source
const RequestContextHeader = "x-amzn-request-context"

Variables

This section is empty.

Functions

func Bouncer

func Bouncer(next http.Handler) http.Handler

Bouncer returns a HTTP Handler middleware function that adds the TLS client certificate from the request to the x-amzn-request-context header.

func CtxClientID

func CtxClientID(ctx context.Context) (uuid.UUID, *x509.Certificate)

CtxClientID returns the client's UUID and Certificate from the request context. The context must be from a request that has passed through Interceptor.

func Interceptor

func Interceptor(next http.Handler) http.Handler

Interceptor returns a HTTP Handler middleware function that reads The x-amzn-request-context header and adds the client's UUID and certificate 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 Key

type Key string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL