configuration

package
v1.9.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViperKeyWellKnownKeys                 = "webfinger.jwks.broadcast_keys"
	ViperKeyOAuth2ClientRegistrationURL   = "webfinger.oidc_discovery.client_registration_url"
	ViperKeyOIDCDiscoverySupportedClaims  = "webfinger.oidc_discovery.supported_claims"
	ViperKeyOIDCDiscoverySupportedScope   = "webfinger.oidc_discovery.supported_scope"
	ViperKeyOIDCDiscoveryUserinfoEndpoint = "webfinger.oidc_discovery.userinfo_url"

	ViperKeySubjectTypesSupported          = "oidc.subject_identifiers.supported_types"
	ViperKeyDefaultClientScope             = "oidc.dynamic_client_registration.default_scope"
	ViperKeyDSN                            = "dsn"
	ViperKeyBCryptCost                     = "oauth2.hashers.bcrypt.cost"
	ViperKeyEncryptSessionData             = "oauth2.session.encrypt_at_rest"
	ViperKeyAdminListenOnHost              = "serve.admin.host"
	ViperKeyAdminListenOnPort              = "serve.admin.port"
	ViperKeyAdminSocketOwner               = "serve.admin.socket.owner"
	ViperKeyAdminSocketGroup               = "serve.admin.socket.group"
	ViperKeyAdminSocketMode                = "serve.admin.socket.mode"
	ViperKeyAdminDisableHealthAccessLog    = "serve.admin.access_log.disable_for_health"
	ViperKeyPublicListenOnHost             = "serve.public.host"
	ViperKeyPublicListenOnPort             = "serve.public.port"
	ViperKeyPublicSocketOwner              = "serve.public.socket.owner"
	ViperKeyPublicSocketGroup              = "serve.public.socket.group"
	ViperKeyPublicSocketMode               = "serve.public.socket.mode"
	ViperKeyPublicDisableHealthAccessLog   = "serve.public.access_log.disable_for_health"
	ViperKeyCookieSameSiteMode             = "serve.cookies.same_site_mode"
	ViperKeyCookieSameSiteLegacyWorkaround = "serve.cookies.same_site_legacy_workaround"
	ViperKeyConsentRequestMaxAge           = "ttl.login_consent_request"
	ViperKeyAccessTokenLifespan            = "ttl.access_token"  // #nosec G101
	ViperKeyRefreshTokenLifespan           = "ttl.refresh_token" // #nosec G101
	ViperKeyIDTokenLifespan                = "ttl.id_token"      // #nosec G101
	ViperKeyAuthCodeLifespan               = "ttl.auth_code"
	ViperKeyScopeStrategy                  = "strategies.scope"
	ViperKeyGetCookieSecrets               = "secrets.cookie"
	ViperKeyGetSystemSecret                = "secrets.system"
	ViperKeyLogoutRedirectURL              = "urls.post_logout_redirect"
	ViperKeyLoginURL                       = "urls.login"
	ViperKeyLogoutURL                      = "urls.logout"
	ViperKeyConsentURL                     = "urls.consent"
	ViperKeyErrorURL                       = "urls.error"
	ViperKeyPublicURL                      = "urls.self.public"
	ViperKeyIssuerURL                      = "urls.self.issuer"
	ViperKeyAllowTLSTerminationFrom        = "serve.tls.allow_termination_from"
	ViperKeyAccessTokenStrategy            = "strategies.access_token"
	ViperKeySubjectIdentifierAlgorithmSalt = "oidc.subject_identifiers.pairwise.salt"
	ViperKeyPKCEEnforced                   = "oauth2.pkce.enforced"
	ViperKeyPKCEEnforcedForPublicClients   = "oauth2.pkce.enforced_for_public_clients"
	ViperKeyLogLevel                       = "log.level"
	ViperKeyCGroupsV1AutoMaxProcsEnabled   = "cgroups.v1.auto_max_procs_enabled"
)
View Source
const DSNMemory = "memory"
View Source
const DefaultSQLiteMemoryDSN = "sqlite://:memory:?_fk=true"

Variables

This section is empty.

Functions

func MustValidate

func MustValidate(l *logrusx.Logger, p Provider)

Types

type Provider

type Provider interface {
	ServesHTTPS() bool

	//HashSignature() bool
	IsUsingJWTAsAccessTokens() bool
	WellKnownKeys(include ...string) []string
	InsecureRedirects() []string

	CORSEnabled(iface string) bool
	CORSOptions(iface string) cors.Options

	SubjectTypesSupported() []string
	ConsentURL() *url.URL
	ErrorURL() *url.URL
	PublicURL() *url.URL
	IssuerURL() *url.URL
	OAuth2AuthURL() string
	OAuth2ClientRegistrationURL() *url.URL
	AllowTLSTerminationFrom() []string
	AccessTokenStrategy() string
	SubjectIdentifierAlgorithmSalt() string
	OIDCDiscoverySupportedScope() []string
	OIDCDiscoverySupportedClaims() []string
	OIDCDiscoveryUserinfoEndpoint() string
	ShareOAuth2Debug() bool
	DSN() string
	EncryptSessionData() bool
	BCryptCost() int
	DataSourcePlugin() string
	DefaultClientScope() []string
	AdminListenOn() string
	AdminSocketPermission() *UnixPermission
	AdminDisableHealthAccessLog() bool
	PublicListenOn() string
	PublicSocketPermission() *UnixPermission
	PublicDisableHealthAccessLog() bool
	CookieSameSiteMode() http.SameSite
	CookieSameSiteLegacyWorkaround() bool
	ConsentRequestMaxAge() time.Duration
	AccessTokenLifespan() time.Duration
	RefreshTokenLifespan() time.Duration
	IDTokenLifespan() time.Duration
	AuthCodeLifespan() time.Duration
	ScopeStrategy() string
	TracingServiceName() string
	TracingProvider() string
	TracingJaegerConfig() *tracing.JaegerConfig
	TracingZipkinConfig() *tracing.ZipkinConfig
	GetCookieSecrets() [][]byte
	GetRotatedSystemSecrets() [][]byte
	GetSystemSecret() []byte
	LogoutRedirectURL() *url.URL
	LoginURL() *url.URL
	LogoutURL() *url.URL
	PKCEEnforced() bool
	EnforcePKCEForPublicClients() bool

	CGroupsV1AutoMaxProcsEnabled() bool
}

func NewViperProvider

func NewViperProvider(l *logrusx.Logger, forcedHTTP bool, insecureRedirects []string) Provider

type UnixPermission added in v1.5.2

type UnixPermission struct {
	Owner string
	Group string
	Mode  os.FileMode
}

func (*UnixPermission) SetPermission added in v1.5.2

func (p *UnixPermission) SetPermission(file string) error

type ViperProvider

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

func (*ViperProvider) AccessTokenLifespan

func (v *ViperProvider) AccessTokenLifespan() time.Duration

func (*ViperProvider) AccessTokenStrategy

func (v *ViperProvider) AccessTokenStrategy() string

func (*ViperProvider) AdminDisableHealthAccessLog added in v1.0.0

func (v *ViperProvider) AdminDisableHealthAccessLog() bool

func (*ViperProvider) AdminListenOn

func (v *ViperProvider) AdminListenOn() string

func (*ViperProvider) AdminSocketPermission added in v1.5.2

func (v *ViperProvider) AdminSocketPermission() *UnixPermission

func (*ViperProvider) AllowTLSTerminationFrom

func (v *ViperProvider) AllowTLSTerminationFrom() []string

func (*ViperProvider) AuthCodeLifespan

func (v *ViperProvider) AuthCodeLifespan() time.Duration

func (*ViperProvider) BCryptCost

func (v *ViperProvider) BCryptCost() int

func (*ViperProvider) CGroupsV1AutoMaxProcsEnabled added in v1.8.0

func (v *ViperProvider) CGroupsV1AutoMaxProcsEnabled() bool

func (*ViperProvider) CORSEnabled

func (v *ViperProvider) CORSEnabled(iface string) bool

func (*ViperProvider) CORSOptions

func (v *ViperProvider) CORSOptions(iface string) cors.Options

func (*ViperProvider) ConsentRequestMaxAge

func (v *ViperProvider) ConsentRequestMaxAge() time.Duration

func (*ViperProvider) ConsentURL

func (v *ViperProvider) ConsentURL() *url.URL

func (*ViperProvider) CookieSameSiteLegacyWorkaround added in v1.4.9

func (v *ViperProvider) CookieSameSiteLegacyWorkaround() bool

func (*ViperProvider) CookieSameSiteMode added in v1.3.0

func (v *ViperProvider) CookieSameSiteMode() http.SameSite

func (*ViperProvider) DSN

func (v *ViperProvider) DSN() string

func (*ViperProvider) DataSourcePlugin

func (v *ViperProvider) DataSourcePlugin() string

func (*ViperProvider) DefaultClientScope

func (v *ViperProvider) DefaultClientScope() []string

func (*ViperProvider) EncryptSessionData added in v1.4.0

func (v *ViperProvider) EncryptSessionData() bool

func (*ViperProvider) EnforcePKCEForPublicClients added in v1.5.0

func (v *ViperProvider) EnforcePKCEForPublicClients() bool

func (*ViperProvider) ErrorURL

func (v *ViperProvider) ErrorURL() *url.URL

func (*ViperProvider) GetCookieSecrets

func (v *ViperProvider) GetCookieSecrets() [][]byte

func (*ViperProvider) GetRotatedSystemSecrets

func (v *ViperProvider) GetRotatedSystemSecrets() [][]byte

func (*ViperProvider) GetSystemSecret

func (v *ViperProvider) GetSystemSecret() []byte

func (*ViperProvider) IDTokenLifespan

func (v *ViperProvider) IDTokenLifespan() time.Duration

func (*ViperProvider) InsecureRedirects

func (v *ViperProvider) InsecureRedirects() []string

func (*ViperProvider) IsUsingJWTAsAccessTokens

func (v *ViperProvider) IsUsingJWTAsAccessTokens() bool

func (*ViperProvider) IssuerURL

func (v *ViperProvider) IssuerURL() *url.URL

func (*ViperProvider) LoginURL

func (v *ViperProvider) LoginURL() *url.URL

func (*ViperProvider) LogoutRedirectURL

func (v *ViperProvider) LogoutRedirectURL() *url.URL

func (*ViperProvider) LogoutURL

func (v *ViperProvider) LogoutURL() *url.URL

func (*ViperProvider) OAuth2AuthURL

func (v *ViperProvider) OAuth2AuthURL() string

func (*ViperProvider) OAuth2ClientRegistrationURL

func (v *ViperProvider) OAuth2ClientRegistrationURL() *url.URL

func (*ViperProvider) OIDCDiscoverySupportedClaims

func (v *ViperProvider) OIDCDiscoverySupportedClaims() []string

func (*ViperProvider) OIDCDiscoverySupportedScope

func (v *ViperProvider) OIDCDiscoverySupportedScope() []string

func (*ViperProvider) OIDCDiscoveryUserinfoEndpoint

func (v *ViperProvider) OIDCDiscoveryUserinfoEndpoint() string

func (*ViperProvider) PKCEEnforced added in v1.0.4

func (v *ViperProvider) PKCEEnforced() bool

func (*ViperProvider) PublicDisableHealthAccessLog added in v1.0.0

func (v *ViperProvider) PublicDisableHealthAccessLog() bool

func (*ViperProvider) PublicListenOn

func (v *ViperProvider) PublicListenOn() string

func (*ViperProvider) PublicSocketPermission added in v1.5.2

func (v *ViperProvider) PublicSocketPermission() *UnixPermission

func (*ViperProvider) PublicURL

func (v *ViperProvider) PublicURL() *url.URL

func (*ViperProvider) RefreshTokenLifespan

func (v *ViperProvider) RefreshTokenLifespan() time.Duration

func (*ViperProvider) ScopeStrategy

func (v *ViperProvider) ScopeStrategy() string

func (*ViperProvider) ServesHTTPS

func (v *ViperProvider) ServesHTTPS() bool

func (*ViperProvider) ShareOAuth2Debug

func (v *ViperProvider) ShareOAuth2Debug() bool

func (*ViperProvider) SubjectIdentifierAlgorithmSalt

func (v *ViperProvider) SubjectIdentifierAlgorithmSalt() string

func (*ViperProvider) SubjectTypesSupported

func (v *ViperProvider) SubjectTypesSupported() []string

func (*ViperProvider) TracingJaegerConfig

func (v *ViperProvider) TracingJaegerConfig() *tracing.JaegerConfig

func (*ViperProvider) TracingProvider

func (v *ViperProvider) TracingProvider() string

func (*ViperProvider) TracingServiceName

func (v *ViperProvider) TracingServiceName() string

func (*ViperProvider) TracingZipkinConfig added in v1.5.0

func (v *ViperProvider) TracingZipkinConfig() *tracing.ZipkinConfig

func (*ViperProvider) WellKnownKeys

func (v *ViperProvider) WellKnownKeys(include ...string) []string

Jump to

Keyboard shortcuts

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