Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientCertInfoAsHeaders ¶
func ClientCertInfoAsHeaders(config ClientCertConfig, logger log.Logger) func(http.Handler) http.Handler
ClientCertInfoAsHeaders is middleware validates the pre-shared key and extracts client information from the request and adds it to the request context
Types ¶
type ClientCertConfig ¶
type ClientCertConfig struct { // Secret is used to validate the pre-shared key in clientCertInfo.SecretHeader Secret string `json:"secret,omitempty"` // Config holds the configuration that tells the server how to extract the client information from the request Config ClientCertInfo `json:"config,omitempty"` }
ClientCertConfig allows middleware to extract client information from the request
func (ClientCertConfig) Validate ¶
func (conf ClientCertConfig) Validate() error
Validate validates the configuration
type ClientCertInfo ¶
type ClientCertInfo struct { // SecretHeader is the header that holds the pre-shared key SecretHeader string `json:"secret_header,omitempty"` // CommonNameHeader is the header that holds the common name extracted from the client certificate CommonNameHeader string `json:"common_name_header,omitempty"` // IssuerHeader is the header that holds the issuer extracted from the client certificate IssuerHeader string `json:"issuer_header,omitempty"` }
ClientCertInfo holds the configuration that tells the server how to extract the client information from the request
type CommonNameContextKey ¶
type CommonNameContextKey struct{}
type OrganizationContextKey ¶
type OrganizationContextKey struct{}
Click to show internal directories.
Click to hide internal directories.