authentication

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthentication

func RegisterAuthentication(reg AuthenticationRegistration)

func RegisteredAuthenticationNames

func RegisteredAuthenticationNames() []string

Types

type AuthWrapper added in v0.6.0

type AuthWrapper struct {
	Name string
	Auth Authentication
}

A struct that wraps all other auths in order to add in instrumentation, specifically child spans for tracing flow. This is used even when telemetry is disabled but OTEL handles no-op'ing in that case so performance impact is minimal

func (AuthWrapper) CheckAuthentication added in v0.6.0

func (w AuthWrapper) CheckAuthentication(ctx context.Context, req *http.Request) bool

type Authentication

type Authentication interface {
	CheckAuthentication(ctx context.Context, req *http.Request) bool
}

func ConstructAuth

func ConstructAuth(rawConfig map[string]interface{}, errorMessages config.ErrorMessages) (Authentication, error)

type AuthenticationRegistration

type AuthenticationRegistration interface {
	Name() string
	Initialize(config any, errorMessages config.ErrorMessages) (Authentication, error)
	InitializeConfig() any
}

func RegisteredAuthentication

func RegisteredAuthentication(name string) (AuthenticationRegistration, bool)

Jump to

Keyboard shortcuts

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