config

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBackend

func RegisterBackend(b BackendConnector)

Types

type BackendConnector

type BackendConnector interface {
	Init(url string, l logrus.FieldLogger) error
	NewConsentManager(clientManager client.Manager, fs pkg.FositeStorer) consent.Manager
	NewOAuth2Manager(clientManager client.Manager, accessTokenLifespan time.Duration, tokenStrategy string) pkg.FositeStorer
	NewClientManager(hasher fosite.Hasher) client.Manager
	NewJWKManager(cipher *jwk.AEAD) jwk.Manager
	Ping() error
	Prefixes() []string
}

type Config

type Config struct {
	// These are used by client commands
	EndpointURL string `mapstructure:"HYDRA_URL" yaml:"-"`

	// These are used by the host command
	FrontendBindPort                 int    `mapstructure:"PUBLIC_PORT" yaml:"-"`
	FrontendBindHost                 string `mapstructure:"PUBLIC_HOST" yaml:"-"`
	BackendBindPort                  int    `mapstructure:"ADMIN_PORT" yaml:"-"`
	BackendBindHost                  string `mapstructure:"ADMIN_HOST" yaml:"-"`
	Issuer                           string `mapstructure:"OAUTH2_ISSUER_URL" yaml:"-"`
	SystemSecret                     string `mapstructure:"SYSTEM_SECRET" yaml:"-"`
	RotatedSystemSecret              string `mapstructure:"ROTATED_SYSTEM_SECRET" yaml:"-"`
	DatabaseURL                      string `mapstructure:"DATABASE_URL" yaml:"-"`
	DatabasePlugin                   string `mapstructure:"DATABASE_PLUGIN" yaml:"-"`
	ConsentURL                       string `mapstructure:"OAUTH2_CONSENT_URL" yaml:"-"`
	LoginURL                         string `mapstructure:"OAUTH2_LOGIN_URL" yaml:"-"`
	LogoutRedirectURL                string `mapstructure:"OAUTH2_LOGOUT_REDIRECT_URL" yaml:"-"`
	DefaultClientScope               string `mapstructure:"OIDC_DYNAMIC_CLIENT_REGISTRATION_DEFAULT_SCOPE" yaml:"-"`
	ErrorURL                         string `mapstructure:"OAUTH2_ERROR_URL" yaml:"-"`
	AllowTLSTermination              string `mapstructure:"HTTPS_ALLOW_TERMINATION_FROM" yaml:"-"`
	BCryptWorkFactor                 int    `mapstructure:"BCRYPT_COST" yaml:"-"`
	AccessTokenLifespan              string `mapstructure:"ACCESS_TOKEN_LIFESPAN" yaml:"-"`
	ScopeStrategy                    string `mapstructure:"SCOPE_STRATEGY" yaml:"-"`
	AuthCodeLifespan                 string `mapstructure:"AUTH_CODE_LIFESPAN" yaml:"-"`
	IDTokenLifespan                  string `mapstructure:"ID_TOKEN_LIFESPAN" yaml:"-"`
	ChallengeTokenLifespan           string `mapstructure:"CHALLENGE_TOKEN_LIFESPAN" yaml:"-"`
	CookieSecret                     string `mapstructure:"COOKIE_SECRET" yaml:"-"`
	LogLevel                         string `mapstructure:"LOG_LEVEL" yaml:"-"`
	LogFormat                        string `mapstructure:"LOG_FORMAT" yaml:"-"`
	AccessControlResourcePrefix      string `mapstructure:"RESOURCE_NAME_PREFIX" yaml:"-"`
	SubjectTypesSupported            string `mapstructure:"OIDC_SUBJECT_TYPES_SUPPORTED" yaml:"-"`
	SubjectIdentifierAlgorithmSalt   string `mapstructure:"OIDC_SUBJECT_TYPE_PAIRWISE_SALT" yaml:"-"`
	OpenIDDiscoveryClaimsSupported   string `mapstructure:"OIDC_DISCOVERY_CLAIMS_SUPPORTED" yaml:"-"`
	OpenIDDiscoveryScopesSupported   string `mapstructure:"OIDC_DISCOVERY_SCOPES_SUPPORTED" yaml:"-"`
	OpenIDDiscoveryUserinfoEndpoint  string `mapstructure:"OIDC_DISCOVERY_USERINFO_ENDPOINT" yaml:"-"`
	SendOAuth2DebugMessagesToClients bool   `mapstructure:"OAUTH2_SHARE_ERROR_DEBUG" yaml:"-"`
	OAuth2AccessTokenStrategy        string `mapstructure:"OAUTH2_ACCESS_TOKEN_STRATEGY" yaml:"-"`
	ForceHTTP                        bool   `yaml:"-"`

	BuildVersion string `yaml:"-"`
	BuildHash    string `yaml:"-"`
	BuildTime    string `yaml:"-"`
	// contains filtered or unexported fields
}

func (*Config) Context

func (c *Config) Context() *Context

func (*Config) DoesRequestSatisfyTermination

func (c *Config) DoesRequestSatisfyTermination(r *http.Request) error

func (*Config) GetAccessTokenLifespan

func (c *Config) GetAccessTokenLifespan() time.Duration

func (*Config) GetAuthCodeLifespan

func (c *Config) GetAuthCodeLifespan() time.Duration

func (*Config) GetBackendAddress

func (c *Config) GetBackendAddress() string

func (*Config) GetChallengeTokenLifespan

func (c *Config) GetChallengeTokenLifespan() time.Duration

func (*Config) GetClusterURLWithoutTailingSlash

func (c *Config) GetClusterURLWithoutTailingSlash(cmd *cobra.Command) string

func (*Config) GetClusterURLWithoutTailingSlashOrFail

func (c *Config) GetClusterURLWithoutTailingSlashOrFail(cmd *cobra.Command) string

func (*Config) GetCookieSecret

func (c *Config) GetCookieSecret() []byte

func (*Config) GetFrontendAddress

func (c *Config) GetFrontendAddress() string

func (*Config) GetIDTokenLifespan

func (c *Config) GetIDTokenLifespan() time.Duration

func (*Config) GetLogger

func (c *Config) GetLogger() *logrus.Logger

func (*Config) GetPrometheusMetrics

func (c *Config) GetPrometheusMetrics() *prometheus.MetricsManager

func (*Config) GetRotatedSystemSecrets

func (c *Config) GetRotatedSystemSecrets() [][]byte

func (*Config) GetScopeStrategy

func (c *Config) GetScopeStrategy() fosite.ScopeStrategy

func (*Config) GetSubjectTypesSupported

func (c *Config) GetSubjectTypesSupported() []string

func (*Config) GetSystemSecret

func (c *Config) GetSystemSecret() []byte

func (*Config) MustValidate

func (c *Config) MustValidate()

func (*Config) Persist

func (c *Config) Persist() error

func (*Config) Resolve

func (c *Config) Resolve(join ...string) *url.URL

type Context

type Context struct {
	Connection BackendConnector

	Hasher         fosite.Hasher
	FositeStrategy oauth2.CoreStrategy
	FositeStore    pkg.FositeStorer
	KeyManager     jwk.Manager
	ConsentManager consent.Manager
}

type MemoryBackend

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

func (*MemoryBackend) Init

func (m *MemoryBackend) Init(url string, l logrus.FieldLogger) error

func (*MemoryBackend) NewClientManager

func (m *MemoryBackend) NewClientManager(hasher fosite.Hasher) client.Manager

func (*MemoryBackend) NewConsentManager

func (m *MemoryBackend) NewConsentManager(_ client.Manager, fs pkg.FositeStorer) consent.Manager

func (*MemoryBackend) NewJWKManager

func (m *MemoryBackend) NewJWKManager(_ *jwk.AEAD) jwk.Manager

func (*MemoryBackend) NewOAuth2Manager

func (m *MemoryBackend) NewOAuth2Manager(clientManager client.Manager, accessTokenLifespan time.Duration, _ string) pkg.FositeStorer

func (*MemoryBackend) Ping

func (m *MemoryBackend) Ping() error

func (*MemoryBackend) Prefixes

func (m *MemoryBackend) Prefixes() []string

type PluginConnection

type PluginConnection struct {
	Config *Config

	Logger logrus.FieldLogger
	// contains filtered or unexported fields
}

func (*PluginConnection) Load

func (c *PluginConnection) Load() error

type SQLBackend

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

func (*SQLBackend) Init

func (s *SQLBackend) Init(url string, l logrus.FieldLogger) error

func (*SQLBackend) NewClientManager

func (s *SQLBackend) NewClientManager(hasher fosite.Hasher) client.Manager

func (*SQLBackend) NewConsentManager

func (s *SQLBackend) NewConsentManager(clientManager client.Manager, fs pkg.FositeStorer) consent.Manager

func (*SQLBackend) NewJWKManager

func (s *SQLBackend) NewJWKManager(cipher *jwk.AEAD) jwk.Manager

func (*SQLBackend) NewOAuth2Manager

func (s *SQLBackend) NewOAuth2Manager(clientManager client.Manager, accessTokenLifespan time.Duration, tokenStrategy string) pkg.FositeStorer

func (*SQLBackend) Ping

func (s *SQLBackend) Ping() error

func (*SQLBackend) Prefixes

func (s *SQLBackend) Prefixes() []string

Jump to

Keyboard shortcuts

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