ssl

package
v0.0.0-...-98dad3e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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{}

Jump to

Keyboard shortcuts

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