auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TokenRoute = "/connect/token"

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Auth(ctx AuthenticatorContext) AuthenticatorResult
}

type AuthenticatorContext

type AuthenticatorContext struct {
	Type     string                 `json:"type"`
	Config   map[string]interface{} `json:"config"`
	Debug    bool                   `json:"debug"`
	Insecure bool                   `json:"insecure"`
	Request  AuthenticatorRequest   `json:"request"`
}

func NewAuthenticatorContext

func NewAuthenticatorContext(
	authType string,
	config map[string]interface{},
	debug bool,
	insecure bool,
	request AuthenticatorRequest) *AuthenticatorContext

type AuthenticatorRequest

type AuthenticatorRequest struct {
	URL    string            `json:"url"`
	Header map[string]string `json:"header"`
}

func NewAuthenticatorRequest

func NewAuthenticatorRequest(
	url string,
	header map[string]string) *AuthenticatorRequest

type AuthenticatorResult

type AuthenticatorResult struct {
	Error         string                 `json:"error"`
	RequestHeader map[string]string      `json:"requestHeader"`
	Config        map[string]interface{} `json:"config"`
}

func AuthenticatorError

func AuthenticatorError(err error) *AuthenticatorResult

func AuthenticatorSuccess

func AuthenticatorSuccess(requestHeader map[string]string, config map[string]interface{}) *AuthenticatorResult

type BearerAuthenticator

type BearerAuthenticator struct {
	Cache cache.Cache
}

func (BearerAuthenticator) Auth

type BearerAuthenticatorConfig

type BearerAuthenticatorConfig struct {
	ClientId     string
	ClientSecret string
}

func NewBearerAuthenticatorConfig

func NewBearerAuthenticatorConfig(
	clientId string,
	clientSecret string) *BearerAuthenticatorConfig

type ExternalAuthenticator

type ExternalAuthenticator struct {
	Config ExternalAuthenticatorConfig
}

func (ExternalAuthenticator) Auth

type ExternalAuthenticatorConfig

type ExternalAuthenticatorConfig struct {
	Name string
	Path string
}

func NewExternalAuthenticatorConfig

func NewExternalAuthenticatorConfig(
	name string,
	path string) *ExternalAuthenticatorConfig

Jump to

Keyboard shortcuts

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