ldap

package
v1.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LDAPConfig

type LDAPConfig struct {
	Enabled        bool   `config:"enabled"`
	Tls            bool   `config:"tls"`
	Host           string `config:"host"`
	Port           int    `config:"port"`
	BindDn         string `config:"bind_dn"`
	BindPassword   string `config:"bind_password"`
	BaseDn         string `config:"base_dn"`
	UserFilter     string `config:"user_filter"`
	UidAttribute   string `config:"uid_attribute"`
	GroupAttribute string `config:"group_attribute"`

	DefaultRoles []string `config:"default_roles"`
	RoleMapping  struct {
		Group map[string][]string `config:"group"`
		Uid   map[string][]string `config:"uid"`
	} `config:"role_mapping"`
}

type LDAPRealm

type LDAPRealm struct {
	// contains filtered or unexported fields
}

func New

func New(cfg2 LDAPConfig) *LDAPRealm

func (*LDAPRealm) Authenticate

func (r *LDAPRealm) Authenticate(username, password string) (bool, *rbac.User, error)

func (*LDAPRealm) Authorize

func (r *LDAPRealm) Authorize(user *rbac.User) (bool, error)

func (*LDAPRealm) GetType

func (r *LDAPRealm) GetType() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL