Documentation ¶
Index ¶
- Constants
- Variables
- func BindFlags(vip *viper.Viper, flags *pflag.FlagSet)
- func GetDCByDN(dn string) (string, error)
- func MappingClaims(attrs map[string][]string, maps map[string]ClaimConfig) map[string]interface{}
- func TakeOptions(prefix string, typ reflect.Type, result map[string]string)
- type ClaimConfig
- type ClaimType
- type ClientConfig
- type ClientConfigSet
- type Config
- func (c *Config) AsJSON() (string, error)
- func (c *Config) EndpointPaths() ResolvedEndpointPaths
- func (c *Config) Load(file string, flags *pflag.FlagSet) error
- func (c *Config) OpenIDConfiguration() OpenIDConfiguration
- func (c *Config) ReadReader(config io.Reader) error
- func (c *Config) Validate() error
- type Duration
- func (d Duration) Duration() time.Duration
- func (d Duration) IntSeconds() int64
- func (d Duration) MarshalText() ([]byte, error)
- func (d *Duration) Set(str string) error
- func (d Duration) StrSeconds() string
- func (d Duration) String() string
- func (d Duration) Type() string
- func (d *Duration) UnmarshalText(text []byte) error
- type EndpointConfig
- type EnvReplacer
- type ExpireConfig
- type LDAPConfig
- type MetricsConfig
- type OpenIDConfiguration
- type ParseErrorSet
- type Pattern
- type PatternSet
- type ResolvedEndpointPaths
- type ScopeConfig
- type TCPAddr
- type TLSConfig
- type TemplateConfig
- type URL
Constants ¶
View Source
const ( CLAIM_TYPE_STRING ClaimType = "string" CLAIM_TYPE_STRING_LIST = "[]string" CLAIM_TYPE_NUMBER = "number" CLAIM_TYPE_NUMBER_LIST = "[]number" )
Variables ¶
View Source
var ( DefaultScopes = ScopeConfig{ "profile": []ClaimConfig{ {Claim: "name", Attribute: "displayName", Type: "string"}, {Claim: "given_name", Attribute: "givenName", Type: "string"}, {Claim: "family_name", Attribute: "sn", Type: "string"}, }, "email": []ClaimConfig{ {Claim: "email", Attribute: "mail", Type: "string"}, }, "phone": []ClaimConfig{ {Claim: "phone_number", Attribute: "telephoneNumber", Type: "string"}, }, "groups": []ClaimConfig{ {Claim: "groups", Attribute: "memberOf", Type: "[]string"}, }, } )
Functions ¶
func MappingClaims ¶
func MappingClaims(attrs map[string][]string, maps map[string]ClaimConfig) map[string]interface{}
Types ¶
type ClaimConfig ¶
type ClaimType ¶ added in v0.4.0
type ClaimType string
func (*ClaimType) UnmarshalText ¶ added in v0.4.0
type ClientConfig ¶
type ClientConfig struct { Name string `json:"name" yaml:"name" toml:"name"` IconURL string `json:"icon_url" yaml:"icon_url" toml:"icon_url"` Secret string `json:"secret" yaml:"secret" toml:"secret"` RedirectURI PatternSet `json:"redirect_uri" yaml:"redirect_uri" toml:"redirect_uri"` CORSOrigin PatternSet `json:"cors_origin" yaml:"cors_origin" toml:"cors_origin"` AllowImplicitFlow bool `json:"allow_implicit_flow" yaml:"allow_implicit_flow" toml:"allow_implicit_flow"` RequestKey string `json:"request_key" yaml:"request_key" toml:"request_key"` }
type ClientConfigSet ¶ added in v0.3.0
type ClientConfigSet map[string]ClientConfig
type Config ¶
type Config struct { Issuer *URL `json:"issuer" yaml:"issuer" toml:"issuer" flag:"issuer"` Listen *TCPAddr `json:"listen,omitempty" yaml:"listen,omitempty" toml:"listen,omitempty" flag:"listen"` SignKey string `json:"sign_key,omitempty" yaml:"sign_key,omitempty" toml:"sign_key,omitempty" flag:"sign-key"` TLS TLSConfig `json:"tls,omitempty" yaml:"tls,omitempty" toml:"tls,omitempty"` LDAP LDAPConfig `json:"ldap" yaml:"ldap" toml:"ldap"` Expire ExpireConfig `json:"expire" yaml:"expire" toml:"expire"` Endpoints EndpointConfig `json:"endpoint" yaml:"endpoint" toml:"endpoint"` Scopes ScopeConfig `json:"scope,omitempty" yaml:"scope,omitempty" toml:"scope,omitempty"` Clients ClientConfigSet `json:"client,omitempty" yaml:"client,omitempty" toml:"client,omitempty"` Metrics MetricsConfig `json:"metrics" yaml:"metrics" toml:"metrics"` Templates TemplateConfig `json:"template,omitempty" yaml:"template,omitempty" toml:"template,omitempty"` }
func (*Config) EndpointPaths ¶
func (c *Config) EndpointPaths() ResolvedEndpointPaths
func (*Config) OpenIDConfiguration ¶
func (c *Config) OpenIDConfiguration() OpenIDConfiguration
type Duration ¶
func ParseDuration ¶
func (Duration) IntSeconds ¶
func (Duration) MarshalText ¶
func (Duration) StrSeconds ¶
func (*Duration) UnmarshalText ¶
type EndpointConfig ¶
type EndpointConfig struct { Authz string `json:"authorization" yaml:"authorization" toml:"authorization" flag:"authz-endpoint"` Token string `json:"token" yaml:"token" toml:"token" flag:"token-endpoint"` Userinfo string `json:"userinfo" yaml:"userinfo" toml:"userinfo" flag:"userinfo-endpoint"` Jwks string `json:"jwks" yaml:"jwks" toml:"jwks" flag:"jwks-uri"` Logout string `json:"logout" yaml:"logout" toml:"logout" flag:"logout-endpoint"` }
type EnvReplacer ¶
type EnvReplacer struct{}
func (EnvReplacer) Replace ¶
func (r EnvReplacer) Replace(s string) string
type ExpireConfig ¶
type ExpireConfig struct { Login Duration `json:"login" yaml:"login" toml:"login" flag:"login-expire"` Code Duration `json:"code" yaml:"code" toml:"code" flag:"code-expire"` Token Duration `json:"token" yaml:"token" toml:"token" flag:"token-expire"` Refresh Duration `json:"refresh" yaml:"refresh" toml:"refresh" flag:"refresh-expire"` SSO Duration `json:"sso" yaml:"sso" toml:"sso" flag:"sso-expire"` }
type LDAPConfig ¶
type LDAPConfig struct { Server *URL `json:"server" yaml:"server" toml:"server" flag:"ldap"` User string `json:"user" yaml:"user" toml:"user" flag:"ldap-user"` Password string `json:"password" yaml:"password" toml:"password" flag:"ldap-password"` BaseDN string `json:"base_dn" yaml:"base_dn" toml:"base_dn" flag:"ldap-base-dn"` IDAttribute string `json:"id_attribute" yaml:"id_attribute" toml:"id_attribute" flag:"ldap-id-attribute"` DisableTLS bool `json:"disable_tls" yaml:"disable_tls" toml:"disable_tls" flag:"ldap-disable-tls"` }
type MetricsConfig ¶
type MetricsConfig struct { Path string `json:"path" yaml:"path" toml:"path" flag:"metrics-path"` Username string `json:"username,omitempty" yaml:"username,omitempty" toml:"username,omitempty" flag:"metrics-username"` Password string `json:"password,omitempty" yaml:"password,omitempty" toml:"password,omitempty" flag:"metrics-password"` }
type OpenIDConfiguration ¶
type OpenIDConfiguration struct { Issuer string `json:"issuer"` AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` UserinfoEndpoint string `json:"userinfo_endpoint"` JwksEndpoint string `json:"jwks_uri"` EndSessionEndpoint string `json:"end_session_endpoint"` ScopesSupported []string `json:"scopes_supported"` ResponseTypesSupported []string `json:"response_types_supported"` ResponseModesSupported []string `json:"response_modes_supported"` GrantTypesSupported []string `json:"grant_types_supported"` SubjectTypesSupported []string `json:"subject_types_supported"` IDTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"` TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` DisplayValuesSupported []string `json:"display_values_supported"` ClaimsSupported []string `json:"claims_supported"` RequestParameterSupported bool `json:"request_parameter_supported"` RequestURIParameterSupported bool `json:"request_uri_parameter_supported"` }
type ParseErrorSet ¶
type ParseErrorSet []error
func (ParseErrorSet) Error ¶
func (es ParseErrorSet) Error() string
type Pattern ¶
type Pattern struct {
// contains filtered or unexported fields
}
func (Pattern) MarshalText ¶
func (*Pattern) UnmarshalText ¶
type PatternSet ¶
type PatternSet []Pattern
func (PatternSet) Match ¶
func (ps PatternSet) Match(url string) bool
type ResolvedEndpointPaths ¶
type ScopeConfig ¶
type ScopeConfig map[string][]ClaimConfig
func (ScopeConfig) AllClaims ¶
func (sc ScopeConfig) AllClaims() []string
func (ScopeConfig) AttributesFor ¶
func (sc ScopeConfig) AttributesFor(scopes []string) []string
func (ScopeConfig) ClaimMapFor ¶
func (sc ScopeConfig) ClaimMapFor(scopes []string) map[string]ClaimConfig
func (ScopeConfig) ScopeNames ¶
func (sc ScopeConfig) ScopeNames() []string
type TCPAddr ¶
func DecideListenAddress ¶
func (*TCPAddr) MarshalText ¶
func (*TCPAddr) UnmarshalText ¶
type TLSConfig ¶
type TLSConfig struct { Auto bool `json:"auto,omitempty" yaml:"auto,omitempty" toml:"auto,omitempty" flag:"tls-auto"` Cert string `json:"cert,omitempty" yaml:"cert,omitempty" toml:"cert,omitempty" flag:"tls-cert"` Key string `json:"key,omitempty" yaml:"key,omitempty" toml:"key,omitempty" flag:"tls-key"` }
type TemplateConfig ¶
type TemplateConfig struct { LoginPage string `json:"login_page,omitempty" yaml:"login_page,omitempty" toml:"login_page,omitempty" flag:"login-page"` LogoutPage string `json:"logout_page,omitempty" yaml:"logout_page,omitempty" toml:"logout_page,omitempty" flag:"logout-page"` ErrorPage string `json:"error_page,omitempty" yaml:"error_page,omitempty" toml:"error_page,omitempty" flag:"error-page"` }
Click to show internal directories.
Click to hide internal directories.