Documentation
¶
Index ¶
- type AuthServer
- type Authenticator
- func (sa *Authenticator) AuthenticateUser(r *requests.Request) error
- func (sa *Authenticator) ConfigureBindCredentials(cfg *Config) error
- func (sa *Authenticator) ConfigureRealm(cfg *Config) error
- func (sa *Authenticator) ConfigureSearch(cfg *Config) error
- func (sa *Authenticator) ConfigureServers(cfg *Config) error
- func (sa *Authenticator) ConfigureTrustedAuthorities(cfg *Config) error
- func (sa *Authenticator) ConfigureUserGroups(cfg *Config) error
- type Backend
- func (b *Backend) Authenticate(r *requests.Request) error
- func (b *Backend) Configure() error
- func (b *Backend) GetConfig() string
- func (b *Backend) GetMethod() string
- func (b *Backend) GetName() string
- func (b *Backend) GetRealm() string
- func (b *Backend) Request(op operator.Type, r *requests.Request) error
- func (b *Backend) Validate() error
- type Config
- type UserAttributes
- type UserGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthServer ¶
type AuthServer struct {
Address string `json:"addr,omitempty"`
URL *url.URL `json:"-"`
Port string `json:"-"`
IgnoreCertErrors bool `json:"ignore_cert_errors,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
AuthServer represents an instance of LDAP server.
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator represents database connector.
func NewAuthenticator ¶
func NewAuthenticator() *Authenticator
NewAuthenticator returns an instance of Authenticator.
func (*Authenticator) AuthenticateUser ¶
func (sa *Authenticator) AuthenticateUser(r *requests.Request) error
AuthenticateUser checks the database for the presence of a username/email and password and returns user claims.
func (*Authenticator) ConfigureBindCredentials ¶
func (sa *Authenticator) ConfigureBindCredentials(cfg *Config) error
ConfigureBindCredentials configures user credentials for LDAP binding.
func (*Authenticator) ConfigureRealm ¶
func (sa *Authenticator) ConfigureRealm(cfg *Config) error
ConfigureRealm configures a domain name (realm) associated with the instance of authenticator.
func (*Authenticator) ConfigureSearch ¶
func (sa *Authenticator) ConfigureSearch(cfg *Config) error
ConfigureSearch configures base DN, search filter, attributes for LDAP queries.
func (*Authenticator) ConfigureServers ¶
func (sa *Authenticator) ConfigureServers(cfg *Config) error
ConfigureServers configures the addresses of LDAP servers.
func (*Authenticator) ConfigureTrustedAuthorities ¶
func (sa *Authenticator) ConfigureTrustedAuthorities(cfg *Config) error
ConfigureTrustedAuthorities configured trusted certificate authorities, if any.
func (*Authenticator) ConfigureUserGroups ¶
func (sa *Authenticator) ConfigureUserGroups(cfg *Config) error
ConfigureUserGroups configures user group bindings for LDAP searching.
type Backend ¶
type Backend struct {
Config *Config `json:"-"`
Authenticator *Authenticator `json:"-"`
// contains filtered or unexported fields
}
Backend represents authentication provider with LDAP backend.
func NewDatabaseBackend ¶
NewDatabaseBackend return an instance of authentication provider with LDAP backend.
func (*Backend) Authenticate ¶
Authenticate performs authentication.
func (*Backend) GetMethod ¶
GetMethod returns the authentication method associated with this backend.
type Config ¶
type Config struct {
Name string `json:"name,omitempty"`
Method string `json:"method,omitempty"`
Realm string `json:"realm,omitempty"`
Servers []AuthServer `json:"servers,omitempty"`
BindUsername string `json:"username,omitempty"`
BindPassword string `json:"password,omitempty"`
Attributes UserAttributes `json:"attributes,omitempty"`
SearchBaseDN string `json:"search_base_dn,omitempty"`
SearchFilter string `json:"search_filter,omitempty"`
Groups []UserGroup `json:"groups,omitempty"`
TrustedAuthorities []string `json:"trusted_authorities,omitempty"`
}
Config holds the configuration for the backend.
type UserAttributes ¶
type UserAttributes struct {
Name string `json:"name,omitempty"`
Surname string `json:"surname,omitempty"`
Username string `json:"username,omitempty"`
MemberOf string `json:"member_of,omitempty"`
Email string `json:"email,omitempty"`
}
UserAttributes represent the mapping of LDAP attributes to JWT fields.