config

package
v0.0.0-...-0df2fcf Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevel                = "log-level"
	MetricsAddress          = "metrics-address"
	ClusterName             = "cluster-name"
	DevelopmentMode         = "development-mode"
	LeaderElectionEnabled   = "leader-election.enabled"
	LeaderElectionNamespace = "leader-election.namespace"

	DigDirAdminBaseURL    = "digdir.admin.base-url"
	DigDirAdminClientID   = "digdir.admin.client-id"
	DigDirAdminCertChain  = "digdir.admin.cert-chain"
	DigDirAdminKmsKeyPath = "digdir.admin.kms-key-path"
	DigDirAdminScopes     = "digdir.admin.scopes"

	DigDirCommonClientName               = "digdir.common.client-name"
	DigDirCommonClientURI                = "digdir.common.client-uri"
	DigDirCommonAccessTokenLifetime      = "digdir.common.access-token-lifetime"
	DigDirCommonSessionLifetime          = "digdir.common.session-lifetime"
	DigDirIDPortenWellKnownURL           = "digdir.idporten.well-known-url"
	DigDirMaskinportenDefaultClientScope = "digdir.maskinporten.default.client-scope"
	DigDirMaskinportenDefaultScopePrefix = "digdir.maskinporten.default.scope-prefix"
	DigDirMaskinportenWellKnownURL       = "digdir.maskinporten.well-known-url"

	FeaturesMaskinporten = "features.maskinporten"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	BaseURL    string `json:"base-url"`
	ClientID   string `json:"client-id"`
	CertChain  string `json:"cert-chain"`
	KMSKeyPath string `json:"kms-key-path"`
	Scopes     string `json:"scopes"`
}

type Config

type Config struct {
	MetricsAddr     string         `json:"metrics-address"`
	ClusterName     string         `json:"cluster-name"`
	DevelopmentMode bool           `json:"development-mode"`
	DigDir          DigDir         `json:"digdir"`
	Features        Features       `json:"features"`
	LeaderElection  LeaderElection `json:"leader-election"`
	LogLevel        string         `json:"log-level"`
}

func New

func New() (*Config, error)

func (Config) Print

func (c Config) Print(redacted []string)

Print out all configuration options except secret stuff.

func (Config) Validate

func (c Config) Validate(required []string) error

func (Config) WithProviderMetadata

func (c Config) WithProviderMetadata(ctx context.Context) (*Config, error)

type DigDir

type DigDir struct {
	Admin        Admin        `json:"admin"`
	IDPorten     IDPorten     `json:"idporten"`
	Maskinporten Maskinporten `json:"maskinporten"`
	Common       DigDirCommon `json:"common"`
}

type DigDirCommon

type DigDirCommon struct {
	AccessTokenLifetime int    `json:"access-token-lifetime"`
	ClientName          string `json:"client-name"`
	ClientURI           string `json:"client-uri"`
	SessionLifetime     int    `json:"session-lifetime"`
}

type Features

type Features struct {
	Maskinporten bool `json:"maskinporten"`
}

type IDPorten

type IDPorten struct {
	WellKnownURL string `json:"well-known-url"`
	Metadata     oauth.MetadataOpenID
}

type LeaderElection

type LeaderElection struct {
	Enabled   bool   `json:"enabled"`
	Namespace string `json:"namespace"`
}

type Maskinporten

type Maskinporten struct {
	Default           MaskinportenDefault `json:"default"`
	WellKnownURL      string              `json:"well-known-url"`
	Metadata          oauth.MetadataOAuth
	DelegationSources map[string]types.DelegationSource
}

type MaskinportenDefault

type MaskinportenDefault struct {
	ClientScope string `json:"client-scope"`
	ScopePrefix string `json:"scope-prefix"`
}

Jump to

Keyboard shortcuts

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