config

package
v0.0.0-...-748e1aa Latest Latest
Warning

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

Go to latest
Published: Sep 23, 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"
	DigDirCommonClientName          = "digdir.common.client-name"
	DigDirCommonClientURI           = "digdir.common.client-uri"
	DigDirCommonAccessTokenLifetime = "digdir.common.access-token-lifetime"
	DigDirCommonSessionLifetime     = "digdir.common.session-lifetime"

	DigDirIDportenClientID     = "digdir.idporten.client-id"
	DigDirIDportenCertChain    = "digdir.idporten.cert-chain"
	DigDirIDportenKmsKeyPath   = "digdir.idporten.kms.key-path"
	DigDirIDportenScopes       = "digdir.idporten.scopes"
	DigDirIDPortenWellKnownURL = "digdir.idporten.well-known-url"

	DigDirMaskinportenClientID  = "digdir.maskinporten.client-id"
	DigDirMaskinportenCertChain = "digdir.maskinporten.cert-chain"

	DigDirMaskinportenDefaultClientScope = "digdir.maskinporten.default.client-scope"
	DigDirMaskinportenDefaultScopePrefix = "digdir.maskinporten.default.scope-prefix"
	DigDirMaskinportenKmsKeyPath         = "digdir.maskinporten.kms.key-path"
	DigDirMaskinportenScopes             = "digdir.maskinporten.scopes"
	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"`
}

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 {
	CertificateChain string `json:"cert-chain"`
	ClientID         string `json:"client-id"`
	KMS              KMS    `json:"kms"`
	Scopes           string `json:"scopes"`
	WellKnownURL     string `json:"well-known-url"`
	Metadata         oauth.MetadataOpenID
}

type KMS

type KMS struct {
	KeyPath string `json:"key-path"`
}

type LeaderElection

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

type Maskinporten

type Maskinporten struct {
	CertChain         string              `json:"cert-chain"`
	ClientID          string              `json:"client-id"`
	Default           MaskinportenDefault `json:"default"`
	KMS               KMS                 `json:"kms"`
	Scopes            string              `json:"scopes"`
	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