Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIncorrectPassword = fmt.Errorf("%w (incorrect password)", ErrInvalidLogin)
View Source
var ErrInvalidLDAPAttributeMapping = errors.New("invalid LDAP attribute mapping")
View Source
var ErrInvalidLogin = errors.New("invalid login")
View Source
var ErrUserNotFound = fmt.Errorf("%w (user not found)", ErrInvalidLogin)
View Source
var StaticUpdateTime time.Time = time.Now()
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { LookupUser(subject string) (*User, error) CheckPassword(email string, password string) error Ping(ctx context.Context) error }
func NewLDAPBackend ¶
func NewLDAPBackend(config *LDAPConfig, logger *slog.Logger) (Backend, error)
func NewStaticBackend ¶
func NewStaticBackend(users []StaticUser, logger *slog.Logger) (Backend, error)
type LDAPAttributeMapping ¶
type LDAPAttributeMapping struct { User struct { Subject string `toml:"subject"` Profile struct { Name string `toml:"name"` GivenName string `toml:"given_name"` FamilyName string `toml:"family_name"` MiddleName string `toml:"middle_name"` Nickname string `toml:"nickname"` Profile string `toml:"profile"` Picture string `toml:"picture"` Website string `toml:"website"` Birthdate string `toml:"birthdate"` Zoneinfo string `toml:"zoneinfo"` Locale string `toml:"locale"` PreferredUsername string `toml:"preferred_username"` UpdatedAt string `toml:"update_at"` } `toml:"profile"` Address struct { Formatted string `toml:"formatted"` Street string `toml:"street"` Locality string `toml:"locality"` Region string `toml:"region"` PostalCode string `toml:"postal_code"` Country string `toml:"country"` } `toml:"address"` Phone struct { Number string `toml:"number"` } `toml:"phone"` Email struct { Address string `toml:"address"` } `toml:"email"` Groups string `toml:"groups"` } `toml:"user"` Group struct { Name string `toml:"name"` Members string `toml:"members"` } `toml:"group"` }
func LDAPActiveDirectoryMapping ¶
func LDAPActiveDirectoryMapping() *LDAPAttributeMapping
func LDAPOpenLDAPMapping ¶
func LDAPOpenLDAPMapping() *LDAPAttributeMapping
func (*LDAPAttributeMapping) Validate ¶
func (mapping *LDAPAttributeMapping) Validate() error
type LDAPConfig ¶
type LDAPConfig struct { URLs []string BindDN string BindPassword string UserSearch LDAPSearchConfig GroupSearch LDAPSearchConfig Mapping *LDAPAttributeMapping }
type LDAPSearchConfig ¶
type StaticUser ¶
type StaticUser struct { Subject string Password string Profile StaticUserProfile Address StaticUserAddress Phone StaticUserPhone Email StaticUserEmail Groups []string }
type StaticUserAddress ¶
type StaticUserEmail ¶
type StaticUserEmail struct {
Address string
}
type StaticUserPhone ¶
type StaticUserPhone struct {
Number string
}
type StaticUserProfile ¶
type User ¶
type User struct { Subject string Profile UserProfile Address UserAddress Phone UserPhone Email UserEmail Groups []string }
type UserAddress ¶
Click to show internal directories.
Click to hide internal directories.