config

package
v0.0.0-...-6c3212e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// LogFile is the file to write log entries to
	LogFile string `json:"logfile"`

	// LogLevel is the log level to use, matches Choria log levels
	LogLevel string `json:"loglevel"`

	// ChoriaConfigFile is a configuration file for the choria framework
	ChoriaConfigFile string `json:"choria_config"`

	// AuthenticatorType is the authenticator to use
	//
	// * okta - performs authentication against Okta
	// * userlist - basic user/password/acl list
	AuthenticatorType string `json:"authenticator"`

	// AuditorType is the types of auditor to use, multiple will be called concurrently
	//
	// * logfile - logs audit messages to a file, requires LogfileAuditor config
	// * jetstream - publish audit messages to a NATS JetStream topic
	AuditorType []string `json:"auditors"`

	// AuthorizerType is the type of authorizer to use
	//
	// * actionlist - allows actions from the JWT claims, requires no additional config
	// * opa - allows requests based on open policy agent configuration
	AuthorizerType string `json:"authorizer"`

	// SignerType is the type of signer to use
	//
	// * basicjwt - basic JWT based checker, requires BasicJWTSigner config
	SignerType string `json:"signer"`

	// Port to listen on for requests
	Port int `json:"port"`

	// MonitorPort is the port to listen on for requests
	MonitorPort int `json:"monitor_port"`

	// Site is the site to expose in prometheus stats
	Site string `json:"site"`

	// BasicJWTSigner is configuration for the `basicjwt` SignerType
	BasicJWTSigner *basicjwt.SignerConfig `json:"basicjwt_signer"`

	// LogfileAuditor is configuration for the `logfile` AuditorType
	LogfileAuditor *logfile.AuditorConfig `json:"logfile_auditor"`

	// JetStreamAuditor is configuration for the `jetstream` AuditorType
	JetStreamAuditor *jetstream.AuditorConfig `json:"jetstream_auditor"`

	// UserlistsAuthenticator is a configuration for the `userlist` AuthorizerType
	UserlistsAuthenticator *userlist.AuthenticatorConfig `json:"userlist_authenticator"`

	// TLSCertificate is the certificate to use for listening on login/sign requests
	TLSCertificate string `json:"tls_certificate"`

	// TLSKey is the private key to use for listening on login/sign requests
	TLSKey string `json:"tls_key"`

	// TLSCA is the CA used to create the listening certificate and key
	TLSCA string `json:"tls_ca"`
	// contains filtered or unexported fields
}

Config configures the signing service

func New

func New(file string) (conf *Config, err error)

New creates a new config

func (*Config) Choria

func (c *Config) Choria() inter.Framework

Choria provides access to the configured choria framework

func (*Config) Logger

func (c *Config) Logger(component string) *logrus.Entry

Logger creates a logger with a specific component set

func (*Config) Signer

func (c *Config) Signer() signers.Signer

Signer access the configured signers.Signer instance

Jump to

Keyboard shortcuts

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