internal

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Authz    = "authz"
	Config   = "config"
	Default  = "default"
	Health   = "health"
	JWKS     = "jwks"
	Requests = "requests"
	Server   = "server"
	Session  = "session"
	K8s      = "k8s"
)
View Source
const ScopeOIDC = "openid"

Variables

View Source
var (
	ErrInvalidPath         = errors.New("invalid path")
	ErrInvalidOIDCOverride = errors.New("invalid OIDC override")
	ErrDuplicateOIDCConfig = errors.New("duplicate OIDC configuration")
	ErrMultipleOIDCConfig  = errors.New("multiple OIDC configurations")
	ErrInvalidURL          = errors.New("invalid URL")
	ErrRequiredURL         = errors.New("required URL")
	ErrHealthPortInUse     = errors.New("health port is already in use by listen port")
	ErrMustNotBeRootPath   = errors.New("must not be root path")
	ErrMustBeDifferentPath = errors.New("must be different path")
)
View Source
var ErrInvalidLogLevel = errors.New("invalid log level")

ErrInvalidLogLevel is returned when the configured log level is invalid.

Functions

func BoolStrValue

func BoolStrValue(v *structpb.Value) bool

BoolStrValue returns the bool value of a structpb.Value. It expects the input to be a structpb.Value of type string or bool that represents a boolean value. This method is a convenience method for backwards-compatibility with the previous versions of the authservice.

func ConfigToJSONString

func ConfigToJSONString(c *configv1.Config) string

func LogFIPS added in v1.0.2

func LogFIPS()

LogFIPS logs whether FIPS is enabled or not.

func Logger

func Logger(name string) telemetry.Logger

Logger gets the given logging scope, or return the Noop logger if no scope has been registered with the given name.

func NewLogSystem

func NewLogSystem(log telemetry.Logger, cfg *configv1.Config) run.Unit

NewLogSystem returns a new run.Unit that sets up the logging system.

func NewLogrAdapter

func NewLogrAdapter(s telemetry.Logger) logr.Logger

NewLogrAdapter creates a new logger to bridge the logr.Logger to our logging system

Types

type FileReader

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

FileReader is a Reader that reads the content of a file given its path.

func NewFileReader

func NewFileReader(filePath string) *FileReader

NewFileReader creates a new FileReader.

func (*FileReader) ID

func (f *FileReader) ID() string

ID returns the file path.

func (*FileReader) Read

func (f *FileReader) Read() ([]byte, error)

Read reads the content of the file.

type FileWatcher

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

FileWatcher watches multiple files for changes and calls a callback when the file changes. It is safe to call WatchFile concurrently. To stop watching the files, cancel the context passed to NewFileWatcher.

func NewFileWatcher

func NewFileWatcher(ctx context.Context) *FileWatcher

NewFileWatcher creates a new FileWatcher.

func (*FileWatcher) WatchFile

func (f *FileWatcher) WatchFile(reader Reader, interval time.Duration, callback func([]byte)) ([]byte, error)

WatchFile watches a file for changes and calls the callback when the file changes. It returns the content of the file and an error if the file cannot be read. The callback function is called with the new content of the file. If the file is already being watched, the previous watcher is stopped and the new one is started.

type LocalConfigFile

type LocalConfigFile struct {
	Config configv1.Config
	// contains filtered or unexported fields
}

LocalConfigFile is a run.Config that loads the configuration file.

func (*LocalConfigFile) FlagSet

func (l *LocalConfigFile) FlagSet() *run.FlagSet

FlagSet returns the flags used to customize the config file location.

func (*LocalConfigFile) Name

func (l *LocalConfigFile) Name() string

Name returns the name of the unit in the run.Group.

func (*LocalConfigFile) Validate

func (l *LocalConfigFile) Validate() error

Validate and load the configuration file.

type Reader

type Reader interface {
	// ID returns a unique identifier for the file.
	ID() string
	// Read reads the content of the file.
	Read() ([]byte, error)
}

Reader is an interface to read the content of a file.

type TLSConfig

type TLSConfig interface {
	// GetTrustedCertificateAuthority returns the trusted certificate authority PEM.
	GetTrustedCertificateAuthority() string
	// GetTrustedCertificateAuthorityFile returns the path to the trusted certificate authority file.
	GetTrustedCertificateAuthorityFile() string
	// GetSkipVerifyPeerCert returns whether to skip verification of the peer certificate.
	GetSkipVerifyPeerCert() *structpb.Value
	// GetTrustedCertificateAuthorityRefreshInterval returns interval at which the trusted certificate
	// authority should be refreshed.
	GetTrustedCertificateAuthorityRefreshInterval() *durationpb.Duration
}

TLSConfig is an interface for the TLS configuration of the AuthService.

type TLSConfigPool

type TLSConfigPool interface {
	// LoadTLSConfig loads a TLS configuration from the given TLSConfig.
	LoadTLSConfig(config TLSConfig) (*tls.Config, error)
}

TLSConfigPool is an interface for a pool of TLS configurations.

func NewTLSConfigPool

func NewTLSConfigPool(ctx context.Context) TLSConfigPool

NewTLSConfigPool creates a new TLSConfigPool.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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