Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDeniedResponse ¶
type AccessDeniedResponse struct { Error bool `json:"error,omitempty" xml:"error,omitempty" yaml:"error,omitempty"` Message string `json:"message,omitempty" xml:"message,omitempty" yaml:"message,omitempty"` Timestamp string `json:"timestamp,omitempty" xml:"timestamp,omitempty" yaml:"timestamp,omitempty"` }
AccessDeniedResponse is the access denied response.
type AuthRequest ¶
type AuthRequest struct { Username string `json:"username,omitempty" xml:"username" yaml:"username,omitempty"` Password string `json:"password,omitempty" xml:"password" yaml:"password,omitempty"` Realm string `json:"realm,omitempty" xml:"realm" yaml:"realm,omitempty"` }
AuthRequest is authentication request.
type AuthResponse ¶
type AuthResponse struct { Token string `json:"token,omitempty" xml:"token,omitempty" yaml:"token,omitempty"` TokenName string `json:"token_name,omitempty" xml:"token_name,omitempty" yaml:"token_name,omitempty"` }
AuthResponse is the response to authentication request.
type Authenticator ¶
type Authenticator struct { Name string `json:"-"` // PrimaryInstance indicates, when it is set to true, the instance of the // portal is primary. PrimaryInstance bool `json:"primary,omitempty"` // Context is the context whether the portal operates. Context string `json:"context,omitempty"` // UI holds the configuration for the user interface. UI *ui.Parameters `json:"ui,omitempty"` // UserRegistrationConfig holds the configuration for the user registration. UserRegistrationConfig *registration.Config `json:"user_registration_config,omitempty" xml:"user_registration_config,omitempty" yaml:"user_registration_config,omitempty"` // UserTransformerConfig holds the configuration for the user transformer. UserTransformerConfigs []*transformer.Config `json:"user_transformer_config,omitempty" xml:"user_transformer_config,omitempty" yaml:"user_transformer_config,omitempty"` // CookieConfig holds the configuration for the cookies issues by Authenticator. CookieConfig *cookie.Config `json:"cookie_config,omitempty" xml:"cookie_config,omitempty" yaml:"cookie_config,omitempty"` // BackendConfigs hold the configurations for authentication backends. BackendConfigs []backends.Config `json:"backend_configs,omitempty"` // AccessListConfigs hold the configurations for the ACL of the token validator. AccessListConfigs []*acl.RuleConfiguration `json:"access_list_configs,omitempty"` // TokenValidatorOptions holds the configuration for the token validator. TokenValidatorOptions *options.TokenValidatorOptions `json:"token_validator_options,omitempty"` // CryptoKeyConfigs hold the configurations for the keys used to issue and validate user tokens. CryptoKeyConfigs []*kms.CryptoKeyConfig `json:"crypto_key_configs,omitempty"` // CryptoKeyStoreConfig hold the default configuration for the keys, e.g. token name and lifetime. CryptoKeyStoreConfig map[string]interface{} `json:"crypto_key_store_config,omitempty"` // TokenGrantorOptions holds the configuration for the tokens issues by Authenticator. TokenGrantorOptions *options.TokenGrantorOptions `json:"token_grantor_options,omitempty"` // contains filtered or unexported fields }
Authenticator implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0, SAML Authentication.
func (*Authenticator) Provision ¶
func (m *Authenticator) Provision() error
Provision configures the instance of authentication portal.
func (*Authenticator) ServeHTTP ¶
func (p *Authenticator) ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request, rr *requests.Request) error
ServeHTTP is a gateway for the authentication portal.
func (*Authenticator) SetLogger ¶
func (m *Authenticator) SetLogger(logger *zap.Logger)
SetLogger add logger to Authenticator.
func (*Authenticator) Validate ¶
func (m *Authenticator) Validate() error
Validate validates the provisioning.
type InstanceManager ¶
type InstanceManager struct { Members map[string]*Authenticator PrimaryInstances map[string]*Authenticator MemberCount map[string]int // contains filtered or unexported fields }
InstanceManager provides access to all Authenticator instances.
var AuthManager *InstanceManager
AuthManager is the global authentication provider pool.
func NewInstanceManager ¶
func NewInstanceManager() *InstanceManager
NewInstanceManager returns a new instance of InstanceManager.
func (*InstanceManager) Register ¶
func (mgr *InstanceManager) Register(m *Authenticator) error
Register registers authentication provider instance with the pool.
func (*InstanceManager) Validate ¶
func (mgr *InstanceManager) Validate(m *Authenticator) error
Validate validates the provisioning of an Authenticator instance.
type InstanceStatus ¶
type InstanceStatus int
InstanceStatus is the state of an Instance.
const ( // Unknown is indeterminate state. Unknown InstanceStatus = iota // BootstrapPrimary is primary instance is ready for bootstrapping. BootstrapPrimary // BootstrapSecondary is non-primary instance is ready for bootstrapping. BootstrapSecondary // DelaySecondary is non-primary instance is not ready for bootstrapping. DelaySecondary // DuplicatePrimary is a dumplicate primary instance. DuplicatePrimary )
Source Files ¶
- authenticator.go
- configure.go
- handle_basic_login.go
- handle_external_login.go
- handle_http_login.go
- handle_http_logout.go
- handle_http_portal.go
- handle_http_recover.go
- handle_http_sandbox.go
- handle_http_settings.go
- handle_http_settings_apikeys.go
- handle_http_settings_gpgkeys.go
- handle_http_settings_mfa.go
- handle_http_settings_password.go
- handle_http_settings_sshkeys.go
- handle_http_static.go
- handle_http_whoami.go
- handle_json_login.go
- handle_json_whoami.go
- handle_register.go
- manager.go
- mfa_form_validator.go
- password_form_validator.go
- pubkey_form_validator.go
- register.go
- respond_http.go
- respond_json.go
- server.go
- validate.go