auth

package
v0.0.0-...-60b7e97 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(
	newAuthenticatorFactoryProvider,
)

Functions

This section is empty.

Types

type AuthenticationResult

type AuthenticationResult struct {
	Authenticated bool
	Subject       string
	Claims        map[string]interface{}
	Expiration    time.Time
}

type Authenticator

type Authenticator interface {
	Type() string
	Init(ctx context.Context, config map[string]interface{}) error
	Authenticate(ctx context.Context, credentials interface{}) (*AuthenticationResult, error)
	Close() error
}

type AuthenticatorConstructor

type AuthenticatorConstructor func(config map[string]interface{}) (Authenticator, error)

type AuthenticatorFactory

type AuthenticatorFactory interface {
	NewAuthenticator(authConfig config.AuthConfig) (Authenticator, error)
}

type JwtAuthenticator

type JwtAuthenticator struct {
	Audiences []string `yaml:"audiences"`
	JwksUrl   string   `yaml:"jwks-url"`
	// contains filtered or unexported fields
}

func (*JwtAuthenticator) Authenticate

func (j *JwtAuthenticator) Authenticate(ctx context.Context, credentials interface{}) (*AuthenticationResult, error)

func (*JwtAuthenticator) Close

func (j *JwtAuthenticator) Close() error

func (*JwtAuthenticator) Init

func (j *JwtAuthenticator) Init(ctx context.Context, config map[string]interface{}) error

func (*JwtAuthenticator) Type

func (j *JwtAuthenticator) Type() string

type SpiffeAuthenticator

type SpiffeAuthenticator struct {
	SpiffeIDs []string `yaml:"spiffe_ids"`
	Audiences []string `yaml:"audiences"`
	Endpoint  string   `yaml:"endpoint"`
	// contains filtered or unexported fields
}

func (*SpiffeAuthenticator) Authenticate

func (s *SpiffeAuthenticator) Authenticate(ctx context.Context, credentials interface{}) (*AuthenticationResult, error)

func (*SpiffeAuthenticator) Close

func (s *SpiffeAuthenticator) Close() error

func (*SpiffeAuthenticator) Init

func (s *SpiffeAuthenticator) Init(ctx context.Context, config map[string]interface{}) error

func (*SpiffeAuthenticator) Type

func (s *SpiffeAuthenticator) Type() string

Jump to

Keyboard shortcuts

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