Documentation
¶
Index ¶
- type AuthProvider
- type AuthProviderPool
- type AuthResponse
- type Backend
- func (b *Backend) Authenticate(reqID string, data map[string]string) (*jwt.UserClaims, int, error)
- func (b *Backend) Configure(p *AuthProvider) error
- func (b *Backend) GetRealm() string
- func (b Backend) MarshalJSON() ([]byte, error)
- func (b *Backend) UnmarshalJSON(data []byte) error
- func (b *Backend) Validate(p *AuthProvider) error
- type BackendDriver
- type UserInterfaceParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type AuthProvider struct { Name string `json:"-"` Provisioned bool `json:"-"` ProvisionFailed bool `json:"-"` PrimaryInstance bool `json:"primary,omitempty"` Context string `json:"context,omitempty"` AuthURLPath string `json:"auth_url_path,omitempty"` UserInterface *UserInterfaceParameters `json:"ui,omitempty"` Backends []Backend `json:"backends,omitempty"` TokenProvider *jwt.TokenProviderConfig `json:"jwt,omitempty"` TokenValidator *jwt.TokenValidator `json:"-"` // contains filtered or unexported fields }
AuthProvider authorizes access to endpoints based on the credentials provided in a request.
func (AuthProvider) Authenticate ¶
func (m AuthProvider) Authenticate(w http.ResponseWriter, r *http.Request) (caddyauth.User, bool, error)
Authenticate authorizes access based on the presense and content of JWT token.
func (AuthProvider) CaddyModule ¶
func (AuthProvider) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*AuthProvider) Provision ¶
func (m *AuthProvider) Provision(ctx caddy.Context) error
Provision provisions authentication portal provider
func (*AuthProvider) Validate ¶
func (m *AuthProvider) Validate() error
Validate implements caddy.Validator.
type AuthProviderPool ¶
type AuthProviderPool struct { Members []*AuthProvider RefMembers map[string]*AuthProvider PrimaryInstances map[string]*AuthProvider MemberCount int // contains filtered or unexported fields }
AuthProviderPool provides access to all instances of the plugin.
var ProviderPool *AuthProviderPool
ProviderPool is the global authentication provider pool. It provides access to all instances of authentication portal plugin.
func (*AuthProviderPool) Provision ¶
func (p *AuthProviderPool) Provision(name string) error
Provision provisions non-primary instances in an authentication context.
func (*AuthProviderPool) Register ¶
func (p *AuthProviderPool) Register(m *AuthProvider) error
Register registers authentication provider instance with the pool.
type AuthResponse ¶
type AuthResponse struct { Error bool `json:"error,omitempty"` Message string `json:"message,omitempty"` Token string `json:"token,omitempty"` }
AuthResponse represents authentication response object.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is an authentication backend.
func (*Backend) Authenticate ¶
Authenticate performs authentication with an authentication provider.
func (*Backend) Configure ¶
func (b *Backend) Configure(p *AuthProvider) error
Configure configures backend with the authentication provider settings.
func (Backend) MarshalJSON ¶
MarshalJSON packs configuration info JSON byte array
func (*Backend) UnmarshalJSON ¶
UnmarshalJSON unpacks configuration into appropriate structures.
func (*Backend) Validate ¶
func (b *Backend) Validate(p *AuthProvider) error
Validate checks whether an authentication provider is functional.
type BackendDriver ¶
type BackendDriver interface { GetRealm() string Authenticate(string, map[string]string) (*jwt.UserClaims, int, error) ConfigureLogger(*zap.Logger) error ConfigureTokenProvider(*jwt.TokenProviderConfig) error ConfigureAuthenticator() error Validate() error }
BackendDriver is an interface to an authentication provider.
type UserInterfaceParameters ¶
type UserInterfaceParameters struct { Templates map[string]string `json:"templates,omitempty"` AllowRoleSelection bool `json:"allow_role_selection,omitempty"` Title string `json:"title,omitempty"` LogoURL string `json:"logo_url,omitempty"` LogoDescription string `json:"logo_description,omitempty"` PrivateLinks []ui.UserInterfaceLink `json:"private_links,omitempty"` AutoRedirectURL string `json:"auto_redirect_url"` Realms []ui.UserRealm `json:"realms"` }
UserInterfaceParameters represent a common set of configuration settings for HTML UI.