provider

package
v0.0.0-...-ce8de81 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProviders

func GetProviders() *sync.Map

GetProviders returns the list of registered providers

func Register

func Register(providerName string, providerConstructor Provider)

Register registers a new provider

Types

type Factory

type Factory struct{}

Factory represents a factory of providers

func (*Factory) Build

func (f *Factory) Build(providerName string, config config.Credentials) Provider

Build builds one provider based on the auth configuration

type Provider

type Provider interface {
	Verifier
	Build(config config.Credentials) Provider
	GetClaims(httpClient *http.Client) (jwt.MapClaims, error)
}

Provider represents an auth provider

type Verifier

type Verifier interface {
	Verify(r *http.Request, httpClient *http.Client) (bool, error)
}

Verifier contains the methods for verification of providers

type VerifierBasket

type VerifierBasket struct {
	// contains filtered or unexported fields
}

VerifierBasket acts as a collection of verifier

func NewVerifierBasket

func NewVerifierBasket(verifiers ...Verifier) *VerifierBasket

NewVerifierBasket creates a new instace of VerifierBasket

func (*VerifierBasket) Verify

func (vb *VerifierBasket) Verify(r *http.Request, httpClient *http.Client) (bool, error)

Verify checks is the provider is valid

Jump to

Keyboard shortcuts

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