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: 7 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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