mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 20:55:42 +00:00
feat: add ldap support (#232)
* feat: add ldap support * feat: add insecure option for self-signed certificates * fix: recognize ldap as a username provider * test: fix tests * feat: add configurable search filter * fix: fix error message in ldap search result * refactor: bot suggestions
This commit is contained in:
@@ -36,6 +36,12 @@ type Config struct {
|
||||
LoginMaxRetries int `mapstructure:"login-max-retries"`
|
||||
FogotPasswordMessage string `mapstructure:"forgot-password-message" validate:"required"`
|
||||
BackgroundImage string `mapstructure:"background-image" validate:"required"`
|
||||
LdapAddress string `mapstructure:"ldap-address"`
|
||||
LdapBindDN string `mapstructure:"ldap-bind-dn"`
|
||||
LdapBindPassword string `mapstructure:"ldap-bind-password"`
|
||||
LdapBaseDN string `mapstructure:"ldap-base-dn"`
|
||||
LdapInsecure bool `mapstructure:"ldap-insecure"`
|
||||
LdapSearchFilter string `mapstructure:"ldap-search-filter"`
|
||||
}
|
||||
|
||||
// Server configuration
|
||||
@@ -122,3 +128,13 @@ type Labels struct {
|
||||
OAuth OAuthLabels
|
||||
IP IPLabels
|
||||
}
|
||||
|
||||
// Ldap config is a struct that contains the configuration for the LDAP service
|
||||
type LdapConfig struct {
|
||||
Address string
|
||||
BindDN string
|
||||
BindPassword string
|
||||
BaseDN string
|
||||
Insecure bool
|
||||
SearchFilter string
|
||||
}
|
||||
|
||||
@@ -12,6 +12,12 @@ type User struct {
|
||||
TotpSecret string
|
||||
}
|
||||
|
||||
// UserSearch is the response of the get user
|
||||
type UserSearch struct {
|
||||
Username string
|
||||
Type string // "local", "ldap" or empty
|
||||
}
|
||||
|
||||
// Users is a list of users
|
||||
type Users []User
|
||||
|
||||
|
||||
Reference in New Issue
Block a user