config

package
v0.0.0-...-1810703 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAccessTokenIssuerFactory

func RegisterAccessTokenIssuerFactory(name string, factory func() AccessTokenIssuerFactory)

RegisterAccessTokenIssuerFactory makes a AccessTokenIssuerFactory available by the provided name in configuration.

If RegisterAccessTokenIssuerFactory is called twice with the same name or if factory is nil, it panics.

func RegisterAuthorizerFactory

func RegisterAuthorizerFactory(name string, factory func() AuthorizerFactory)

RegisterAuthorizerFactory makes a AuthorizerFactory available by the provided name in configuration.

If RegisterAuthorizerFactory is called twice with the same name or if factory is nil, it panics.

func RegisterPasswordAuthenticatorFactory

func RegisterPasswordAuthenticatorFactory(name string, factory func() PasswordAuthenticatorFactory)

RegisterPasswordAuthenticatorFactory makes a PasswordAuthenticatorFactory available by the provided name in configuration.

If RegisterPasswordAuthenticatorFactory is called twice with the same name or if factory is nil, it panics.

func RegisterRefreshTokenIssuerFactory

func RegisterRefreshTokenIssuerFactory(name string, factory func() RefreshTokenIssuerFactory)

RegisterRefreshTokenIssuerFactory makes a RefreshTokenIssuerFactory available by the provided name in configuration.

If RegisterRefreshTokenIssuerFactory is called twice with the same name or if factory is nil, it panics.

Types

type AccessTokenIssuer

type AccessTokenIssuer struct {
	AccessTokenIssuerFactory
}

AccessTokenIssuer is the configuration for an auth.AccessTokenIssuer.

func (*AccessTokenIssuer) UnmarshalYAML

func (c *AccessTokenIssuer) UnmarshalYAML(value *yaml.Node) error

type AccessTokenIssuerFactory

type AccessTokenIssuerFactory = Factory[auth.AccessTokenIssuer]

AccessTokenIssuerFactory creates a new auth.AccessTokenIssuer.

type Authorizer

type Authorizer struct {
	AuthorizerFactory
}

Authorizer is the configuration for an auth.Authorizer.

func (*Authorizer) UnmarshalYAML

func (c *Authorizer) UnmarshalYAML(value *yaml.Node) error

type AuthorizerFactory

type AuthorizerFactory = Factory[auth.Authorizer]

AuthorizerFactory creates a new auth.Authorizer.

type Config

type Config struct {
	PasswordAuthenticator PasswordAuthenticator `yaml:"passwordAuthenticator"`
	AccessTokenIssuer     AccessTokenIssuer     `yaml:"accessTokenIssuer"`
	RefreshTokenIssuer    RefreshTokenIssuer    `yaml:"refreshTokenIssuer"`
	Authorizer            Authorizer            `yaml:"authorizer"`
}

Config collects all configuration options.

func (Config) Validate

func (c Config) Validate() error

Validate validates the configuration.

type Factory

type Factory[T any] interface {
	New() (T, error)
	Validate() error
}

Factory is a stateful factory holding the necessary information to validate and construct T.

type PasswordAuthenticator

type PasswordAuthenticator struct {
	PasswordAuthenticatorFactory
}

PasswordAuthenticator is the configuration for an auth.PasswordAuthenticator.

func (*PasswordAuthenticator) UnmarshalYAML

func (c *PasswordAuthenticator) UnmarshalYAML(value *yaml.Node) error

type PasswordAuthenticatorFactory

type PasswordAuthenticatorFactory = Factory[auth.PasswordAuthenticator]

PasswordAuthenticatorFactory creates a new auth.PasswordAuthenticator.

type RefreshTokenIssuer

type RefreshTokenIssuer struct {
	RefreshTokenIssuerFactory
}

RefreshTokenIssuer is the configuration for an auth.RefreshTokenIssuer.

func (*RefreshTokenIssuer) UnmarshalYAML

func (c *RefreshTokenIssuer) UnmarshalYAML(value *yaml.Node) error

type RefreshTokenIssuerFactory

type RefreshTokenIssuerFactory = Factory[auth.RefreshTokenIssuer]

RefreshTokenIssuerFactory creates a new auth.RefreshTokenIssuer.

Jump to

Keyboard shortcuts

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