Documentation ¶
Index ¶
- Constants
- Variables
- func BoolStrValue(v *structpb.Value) bool
- func ConfigToJSONString(c *configv1.Config) string
- func LogFIPS()
- func Logger(name string) telemetry.Logger
- func NewLogSystem(log telemetry.Logger, cfg *configv1.Config) run.Unit
- func NewLogrAdapter(s telemetry.Logger) logr.Logger
- type FileReader
- type FileWatcher
- type LocalConfigFile
- type Reader
- type TLSConfig
- type TLSConfigPool
Constants ¶
const ( Authz = "authz" Config = "config" Default = "default" Health = "health" JWKS = "jwks" Requests = "requests" Server = "server" Session = "session" K8s = "k8s" )
const ScopeOIDC = "openid"
Variables ¶
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") )
var ErrInvalidLogLevel = errors.New("invalid log level")
ErrInvalidLogLevel is returned when the configured log level is invalid.
Functions ¶
func BoolStrValue ¶
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 Logger ¶
Logger gets the given logging scope, or return the Noop logger if no scope has been registered with the given name.
func NewLogSystem ¶
NewLogSystem returns a new run.Unit that sets up the 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) 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 ¶
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.