Documentation ¶
Index ¶
- Constants
- Variables
- type LdapGroup
- func (g *LdapGroup) AddUser(user iuser.User) error
- func (g *LdapGroup) GetId() int
- func (g *LdapGroup) GetName() string
- func (g *LdapGroup) GetRules() interface{}
- func (g *LdapGroup) GetUser(u iuser.User) (bool, error)
- func (g *LdapGroup) ListUsers() ([]iuser.User, error)
- func (g *LdapGroup) RemoveUser(user iuser.User) error
- type User
- func (u *User) GetEmail() string
- func (u *User) GetFullName() string
- func (u *User) GetId() int
- func (u *User) GetMobile() string
- func (u *User) GetName() string
- func (u *User) GetProfile() iuser.UserProfile
- func (u *User) GetPublicProfile() iuser.UserProfile
- func (u *User) GetSub() string
- func (u *User) SetBackend(b iuser.UserBackend)
- func (u *User) VerifyPassword(password []byte) bool
- type UserBack
- func (ub *UserBack) AddUser(info UserInfo) error
- func (ub *UserBack) AuthPassword(sub, passwd string) (bool, error)
- func (ub *UserBack) AuthPasswordByFeature(feature, passwd string) (bool, iuser.User, error)
- func (ub *UserBack) CreateBackendGroup(name string, rules interface{}) (bool, iuser.BackendGroup, error)
- func (ub *UserBack) CreateUser(user iuser.User, passwordHashed bool) error
- func (ub *UserBack) DeleteBackendGroup(g iuser.BackendGroup) error
- func (ub *UserBack) DeleteUser(user iuser.User) error
- func (ub *UserBack) GetBackendGroup(id int) (iuser.BackendGroup, error)
- func (ub *UserBack) GetBackendGroupByName(name string) (iuser.BackendGroup, error)
- func (ub *UserBack) GetBackendGroupsOfUser(user iuser.User) ([]iuser.BackendGroup, error)
- func (ub *UserBack) GetGroupByFullname(fullname string) (iuser.BackendGroup, error)
- func (ub *UserBack) GetMobileByEmail(email string) string
- func (ub *UserBack) GetUser(id int) (iuser.User, error)
- func (ub *UserBack) GetUserByEmail(email string) (iuser.User, error)
- func (ub *UserBack) GetUserByFeature(f string) (iuser.User, error)
- func (ub *UserBack) GetUserByName(name string) (iuser.User, error)
- func (ub *UserBack) InitDatabase()
- func (ub *UserBack) InitModel(ctx interface{})
- func (ub *UserBack) ListUsers(ctx context.Context) ([]iuser.User, error)
- func (ub *UserBack) Name() string
- func (ub *UserBack) Search(filter string) (*User, error)
- func (ub *UserBack) SetBackendGroupId(name string, Id int) error
- func (ub *UserBack) SupportedVerificationMethods() []string
- func (ub *UserBack) UserIdToSub(id int) string
- func (ub *UserBack) UserSubToId(sub string) (int, error)
- type UserInfo
- type UserProfile
Constants ¶
View Source
const (
// Use ./cmd/bcryptcost tool to find approriate cost
BCRYPT_COST = 11
)
View Source
const (
LDAPREALMNAME = "sso-ldap"
)
Variables ¶
View Source
var ( ErrOUNotFound = errors.New("Ldap ou (Organizational Unit) is not found ") ErrLDAPGroupNotFound = errors.New("Ldap group is not found") )
View Source
var EMAIL_SUFFIX string
View Source
var (
ErrForbidden = errors.New("functions not developed")
)
View Source
var InitAdmin string
Functions ¶
This section is empty.
Types ¶
type LdapGroup ¶
type User ¶
type User struct { Id int Name string FullName string Email string PasswordHash []byte `db:"password"` Mobile string Created string Updated string // contains filtered or unexported fields }
func (*User) GetFullName ¶
func (*User) GetProfile ¶
func (u *User) GetProfile() iuser.UserProfile
func (*User) GetPublicProfile ¶
func (u *User) GetPublicProfile() iuser.UserProfile
func (*User) SetBackend ¶
func (u *User) SetBackend(b iuser.UserBackend)
func (*User) VerifyPassword ¶
type UserBack ¶
func (*UserBack) AuthPassword ¶
deprecated
func (*UserBack) AuthPasswordByFeature ¶
func (*UserBack) CreateBackendGroup ¶
func (*UserBack) CreateUser ¶
func (*UserBack) DeleteBackendGroup ¶
func (ub *UserBack) DeleteBackendGroup(g iuser.BackendGroup) error
func (*UserBack) GetBackendGroup ¶
func (ub *UserBack) GetBackendGroup(id int) (iuser.BackendGroup, error)
func (*UserBack) GetBackendGroupByName ¶
func (ub *UserBack) GetBackendGroupByName(name string) (iuser.BackendGroup, error)
func (*UserBack) GetBackendGroupsOfUser ¶
func (*UserBack) GetGroupByFullname ¶
func (ub *UserBack) GetGroupByFullname(fullname string) (iuser.BackendGroup, error)
func (*UserBack) GetMobileByEmail ¶
func (*UserBack) GetUserByEmail ¶
func (*UserBack) GetUserByFeature ¶
func (*UserBack) InitDatabase ¶
func (ub *UserBack) InitDatabase()
func (*UserBack) SetBackendGroupId ¶
func (*UserBack) SupportedVerificationMethods ¶
func (*UserBack) UserIdToSub ¶
type UserInfo ¶
type UserProfile ¶
type UserProfile struct { Name string `json:"name"` FullName string `json:"fullname"` Email string `json:"email"` Mobile string `json:"mobile"` }
func (*UserProfile) GetEmail ¶
func (up *UserProfile) GetEmail() string
func (*UserProfile) GetMobile ¶
func (up *UserProfile) GetMobile() string
func (*UserProfile) GetName ¶
func (up *UserProfile) GetName() string
Click to show internal directories.
Click to hide internal directories.