configuration

package
v0.0.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViperKeyDSN = "dsn"

	ViperKeyCourierSMTPURL       = "courier.smtp.connection_uri"
	ViperKeyCourierTemplatesPath = "courier.template_override_path"
	ViperKeyCourierSMTPFrom      = "courier.stmp.from_address"

	ViperKeySecretsSession = "secrets.session"

	ViperKeyURLsDefaultReturnTo            = "urls.default_return_to"
	ViperKeyURLsSelfPublic                 = "urls.self.public"
	ViperKeyURLsSelfAdmin                  = "urls.self.admin"
	ViperKeyURLsLogin                      = "urls.login_ui"
	ViperKeyURLsError                      = "urls.error_ui"
	ViperKeyURLsProfile                    = "urls.profile_ui"
	ViperKeyURLsMFA                        = "urls.mfa_ui"
	ViperKeyURLsRegistration               = "urls.registration_ui"
	ViperKeyURLsWhitelistedReturnToDomains = "urls.whitelisted_return_to_domains"

	ViperKeyLifespanSession = "ttl.session"

	ViperKeySelfServiceStrategyConfig              = "selfservice.strategies"
	ViperKeySelfServiceRegistrationBeforeConfig    = "selfservice.registration.before"
	ViperKeySelfServiceRegistrationAfterConfig     = "selfservice.registration.after"
	ViperKeySelfServiceLifespanRegistrationRequest = "selfservice.registration.request_lifespan"
	ViperKeySelfServiceLoginBeforeConfig           = "selfservice.login.before"
	ViperKeySelfServiceLoginAfterConfig            = "selfservice.login.after"
	ViperKeySelfServiceLifespanLoginRequest        = "selfservice.login.request_lifespan"
	ViperKeySelfServiceLogoutRedirectURL           = "selfservice.logout.redirect_to"
	ViperKeySelfServiceLifespanProfileRequest      = "selfservice.profile.request_lifespan"

	ViperKeyDefaultIdentityTraitsSchemaURL = "identity.traits.default_schema_url"
	ViperKeyIdentityTraitsSchemas          = "identity.traits.schemas"

	ViperKeyHasherArgon2ConfigMemory      = "hashers.argon2.memory"
	ViperKeyHasherArgon2ConfigIterations  = "hashers.argon2.iterations"
	ViperKeyHasherArgon2ConfigParallelism = "hashers.argon2.parallelism"
	ViperKeyHasherArgon2ConfigSaltLength  = "hashers.argon2.salt_length"
	ViperKeyHasherArgon2ConfigKeyLength   = "hashers.argon2.key_length"
)
View Source
const DefaultIdentityTraitsSchemaID = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type HasherArgon2Config

type HasherArgon2Config struct {
	Memory      uint32
	Iterations  uint32
	Parallelism uint8
	SaltLength  uint32
	KeyLength   uint32
}

type Provider

type Provider interface {
	AdminListenOn() string
	PublicListenOn() string
	DSN() string

	SessionSecrets() [][]byte

	SelfPublicURL() *url.URL
	SelfAdminURL() *url.URL

	DefaultReturnToURL() *url.URL

	ProfileURL() *url.URL
	LoginURL() *url.URL
	ErrorURL() *url.URL
	MultiFactorURL() *url.URL

	SessionLifespan() time.Duration
	SelfServiceProfileRequestLifespan() time.Duration
	SelfServiceLoginRequestLifespan() time.Duration
	SelfServiceRegistrationRequestLifespan() time.Duration

	SelfServiceStrategy(strategy string) *SelfServiceStrategy
	SelfServiceLoginBeforeHooks() []SelfServiceHook
	SelfServiceRegistrationBeforeHooks() []SelfServiceHook
	SelfServiceLoginAfterHooks(strategy string) []SelfServiceHook
	SelfServiceRegistrationAfterHooks(strategy string) []SelfServiceHook
	SelfServiceLogoutRedirectURL() *url.URL

	CourierSMTPFrom() string
	CourierSMTPURL() *url.URL
	CourierTemplatesRoot() string

	DefaultIdentityTraitsSchemaURL() *url.URL
	IdentityTraitsSchemas() []SchemaConfig

	WhitelistedReturnToDomains() []url.URL

	RegisterURL() *url.URL

	HashersArgon2() *HasherArgon2Config

	TracingServiceName() string
	TracingProvider() string
	TracingJaegerConfig() *tracing.JaegerConfig

	IsInsecureDevMode() bool
}

type SchemaConfig

type SchemaConfig struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

type SelfServiceHook

type SelfServiceHook struct {
	Job    string          `json:"job"`
	Config json.RawMessage `json:"config"`
}

type SelfServiceStrategy

type SelfServiceStrategy struct {
	Enabled bool            `json:"enabled"`
	Config  json.RawMessage `json:"config"`
}

type ViperProvider

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

func NewViperProvider

func NewViperProvider(l logrus.FieldLogger, dev bool) *ViperProvider

func (*ViperProvider) AdminListenOn

func (p *ViperProvider) AdminListenOn() string

func (*ViperProvider) CourierSMTPFrom

func (p *ViperProvider) CourierSMTPFrom() string

func (*ViperProvider) CourierSMTPURL

func (p *ViperProvider) CourierSMTPURL() *url.URL

func (*ViperProvider) CourierTemplatesRoot

func (p *ViperProvider) CourierTemplatesRoot() string

func (*ViperProvider) DSN

func (p *ViperProvider) DSN() string

func (*ViperProvider) DefaultIdentityTraitsSchemaURL

func (p *ViperProvider) DefaultIdentityTraitsSchemaURL() *url.URL

func (*ViperProvider) DefaultReturnToURL

func (p *ViperProvider) DefaultReturnToURL() *url.URL

func (*ViperProvider) ErrorURL

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

func (*ViperProvider) HashersArgon2

func (p *ViperProvider) HashersArgon2() *HasherArgon2Config

func (*ViperProvider) IdentityTraitsSchemas

func (p *ViperProvider) IdentityTraitsSchemas() []SchemaConfig

func (*ViperProvider) IsInsecureDevMode

func (p *ViperProvider) IsInsecureDevMode() bool

func (*ViperProvider) LoginURL

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

func (*ViperProvider) MultiFactorURL

func (p *ViperProvider) MultiFactorURL() *url.URL

func (*ViperProvider) ProfileURL

func (p *ViperProvider) ProfileURL() *url.URL

func (*ViperProvider) PublicListenOn

func (p *ViperProvider) PublicListenOn() string

func (*ViperProvider) RegisterURL

func (p *ViperProvider) RegisterURL() *url.URL

func (*ViperProvider) SelfAdminURL

func (p *ViperProvider) SelfAdminURL() *url.URL

func (*ViperProvider) SelfPublicURL

func (p *ViperProvider) SelfPublicURL() *url.URL

func (*ViperProvider) SelfServiceLoginAfterHooks

func (p *ViperProvider) SelfServiceLoginAfterHooks(strategy string) []SelfServiceHook

func (*ViperProvider) SelfServiceLoginBeforeHooks

func (p *ViperProvider) SelfServiceLoginBeforeHooks() []SelfServiceHook

func (*ViperProvider) SelfServiceLoginRequestLifespan

func (p *ViperProvider) SelfServiceLoginRequestLifespan() time.Duration

func (*ViperProvider) SelfServiceLogoutRedirectURL

func (p *ViperProvider) SelfServiceLogoutRedirectURL() *url.URL

func (*ViperProvider) SelfServiceProfileRequestLifespan

func (p *ViperProvider) SelfServiceProfileRequestLifespan() time.Duration

func (*ViperProvider) SelfServiceRegistrationAfterHooks

func (p *ViperProvider) SelfServiceRegistrationAfterHooks(strategy string) []SelfServiceHook

func (*ViperProvider) SelfServiceRegistrationBeforeHooks

func (p *ViperProvider) SelfServiceRegistrationBeforeHooks() []SelfServiceHook

func (*ViperProvider) SelfServiceRegistrationRequestLifespan

func (p *ViperProvider) SelfServiceRegistrationRequestLifespan() time.Duration

func (*ViperProvider) SelfServiceStrategy

func (p *ViperProvider) SelfServiceStrategy(strategy string) *SelfServiceStrategy

func (*ViperProvider) SessionLifespan

func (p *ViperProvider) SessionLifespan() time.Duration

func (*ViperProvider) SessionSecrets

func (p *ViperProvider) SessionSecrets() [][]byte

func (*ViperProvider) TracingJaegerConfig

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

func (*ViperProvider) TracingProvider

func (p *ViperProvider) TracingProvider() string

func (*ViperProvider) TracingServiceName

func (p *ViperProvider) TracingServiceName() string

func (*ViperProvider) WhitelistedReturnToDomains

func (p *ViperProvider) WhitelistedReturnToDomains() (us []url.URL)

Jump to

Keyboard shortcuts

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