auth

package
v0.0.0-...-34c5031 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientCertFromContext

func ClientCertFromContext(ctx context.Context) *models.ClientCert

ClientCertFromContext gets the reference to the ClientCert stored in the request.Context()

func ClientCertFromRequestContext

func ClientCertFromRequestContext(r *http.Request) *models.ClientCert

ClientCertFromRequestContext gets the reference to the ClientCert stored in the request.Context()

func ClientCertMiddleware

func ClientCertMiddleware(logger Logger, db *pop.Connection) func(next http.Handler) http.Handler

ClientCertMiddleware enforces that the incoming request includes a known client certificate, and stores the fetched permissions in the session

func HostnameDetectorMiddleware

func HostnameDetectorMiddleware(logger Logger, hostname string) func(next http.Handler) http.Handler

HostnameDetectorMiddleware only allows the given hostname through

func SetClientCertInRequestContext

func SetClientCertInRequestContext(r *http.Request, clientCert *models.ClientCert) context.Context

SetClientCertInRequestContext returns a copy of the request's Context() with the client certificate data

Types

type ApplicationServername

type ApplicationServername struct {
	OrdersServername string
}

ApplicationServername is a collection of all the servernames for the application

type Logger

type Logger interface {
	Info(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
}

Logger is an interface that describes the logging requirements of this package.

Jump to

Keyboard shortcuts

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