Documentation ¶
Index ¶
- Constants
- Variables
- func HashPassword(password string) (string, error)
- type DeleteFunc
- type DisableFunc
- type Factor
- type ReactivateFunc
- type User
- type UserHooks
- type UserStore
- func (u *UserStore) AddUser(user User) (User, error)
- func (u *UserStore) AddUsers(users []User) ([]User, error)
- func (u *UserStore) AuthUser(login, password string) (User, bool)
- func (u *UserStore) DeleteUserByID(id string) error
- func (u *UserStore) DeleteUserByLogin(login string) error
- func (u *UserStore) Empty() error
- func (u *UserStore) GetMaxUsers() int
- func (u *UserStore) GetUserByID(id string) (User, error)
- func (u *UserStore) GetUserByLogin(login string) (User, error)
- func (u *UserStore) GetUserByOIDCIDs(oidcIDs []string) (User, error)
- func (u *UserStore) ListUsers() []User
- func (u *UserStore) LoginExists(login string) bool
- func (u *UserStore) SaveUsers() error
- func (u *UserStore) UpdatePassword(userID string, password string) error
- func (u *UserStore) UpdateUser(user User) error
- func (u *UserStore) UserCount() int
Constants ¶
View Source
const USERSTORE_FILENAME = "users.json"
Variables ¶
View Source
var UserStoreMu sync.Mutex
Functions ¶
func HashPassword ¶
Types ¶
type User ¶
type User struct { ID string `json:"id"` Login string `json:"login"` Role string `json:"role"` OIDCID string `json:"oidcID,omitempty"` SAMLID string `json:"samlID,omitempty"` Provisioned bool `json:"provisioned,omitempty"` Password string `json:"password,omitempty"` Suspended bool `json:"suspended"` ConnectionsDisabledOnAuthFailure bool `json:"connectionsDisabledOnAuthFailure"` Factors []Factor `json:"factors"` ExternalID string `json:"externalID,omitempty"` LastLogin time.Time `json:"lastLogin"` }
type UserHooks ¶
type UserHooks struct { DisableFunc DisableFunc ReactivateFunc ReactivateFunc DeleteFunc DeleteFunc }
type UserStore ¶
type UserStore struct { Users []User `json:"users"` UserHooks UserHooks // contains filtered or unexported fields }
func NewUserStoreWithHooks ¶
func (*UserStore) DeleteUserByID ¶
func (*UserStore) DeleteUserByLogin ¶
func (*UserStore) GetMaxUsers ¶
func (*UserStore) GetUserByOIDCIDs ¶
func (*UserStore) LoginExists ¶
func (*UserStore) UpdatePassword ¶
func (*UserStore) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.