config

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(prefPath, prefName string)

Init initializes app's config. App should invoke this function from the main after it parsed flags. prefPath, prefName allows to overwrite default values for config dir and base file name.

Types

type Config

type Config struct {
	PrivateProviderID               string            `mapstructure:"-"`
	PrivateProviderIDTrustedContext string            `mapstructure:"-"`
	ListenAddr                      string            `mapstructure:"listen-addr"`
	TLSCertFile                     string            `mapstructure:"tls-cert-file"`
	TLSKeyFile                      string            `mapstructure:"tls-key-file"`
	TLSInsecureSkipVerify           bool              `mapstructure:"tls-insecure-skip-verify"`
	HydraAddr                       string            `mapstructure:"hydra-addr"`
	ExternalBaseURL                 string            `mapstructure:"external-base-url"`
	OAuth2RedirectURL               string            `mapstructure:"oauth2-redirect-url"`
	ChallengeLifespan               time.Duration     `mapstructure:"challenge-lifespan"`
	ConfirmationLinkLifespan        time.Duration     `mapstructure:"confirmation-link-lifespan"`
	AuthCookieName                  string            `mapstructure:"auth-cookie-name"`
	AuthHeaderName                  string            `mapstructure:"auth-header-name"`
	EmailConfig                     EmailConfig       `mapstructure:"email-config"`
	MongoDB                         DBConfig          `mapstructure:"mongodb"`
	OAuth2State                     OAuth2State       `mapstructure:"oauth2-state"`
	PrivateOAuth2Provider           *OAuth2Provider   `mapstructure:"private-oauth2-provider"`
	OAuth2Providers                 []*OAuth2Provider `mapstructure:"oauth2-providers"`
	OAuth2ClientCredentials         *clientcredentials.Config
	ModTime                         time.Time
}

func Get

func Get() Config

func (Config) ToAuthkitType

func (c Config) ToAuthkitType() handler.Config

type DBConfig

type DBConfig struct {
	URL  string `mapstructure:"url"`
	Name string `mapstructure:"name"`
}

type EmailConfig

type EmailConfig struct {
	Sender     string `mapstructure:"sender"`
	SenderPass string `mapstructure:"sender-pass"`
	MailServer string `mapstructure:"server"`
	MailPort   string `mapstructure:"port"`
}

type OAuth2Provider

type OAuth2Provider struct {
	ID                  string   `mapstructure:"id"`
	Name                string   `mapstructure:"name"`
	ClientID            string   `mapstructure:"client-id"`
	ClientSecret        string   `mapstructure:"client-secret"`
	PublicKey           string   `mapstructure:"public-key"`
	Scopes              []string `mapstructure:"scopes"`
	IconURL             string   `mapstructure:"icon"`
	TokenURL            string   `mapstructure:"token-url"`
	AuthURL             string   `mapstructure:"auth-url"`
	OAuth2Config        authkit.OAuth2Config
	PrivateOAuth2Config authkit.OAuth2Config
}

func (OAuth2Provider) ToAuthkitType

func (p OAuth2Provider) ToAuthkitType() authkit.OAuth2Provider

type OAuth2State

type OAuth2State struct {
	TokenIssuer     string        `mapstructure:"token-issuer"`
	TokenSignKeyHex string        `mapstructure:"token-sign-key"`
	Expiration      time.Duration `mapstructure:"expiration"`
	TokenSignKey    []byte
}

func (OAuth2State) ToAuthkitType

func (s OAuth2State) ToAuthkitType() authkit.OAuth2State

Jump to

Keyboard shortcuts

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