Documentation ¶
Index ¶
- Variables
- func EncryptedReader(key string, r io.Reader) (*cipher.StreamReader, error)
- func EncryptedWriter(key string, w io.Writer) (*cipher.StreamWriter, error)
- func IntialiseStore()
- type Access
- type PwEntry
- type User
- func (u *User) DisplayName() string
- func (u *User) Email() string
- func (u User) FailedLogins() int
- func (u User) IsValid() error
- func (u *User) LoginSuccessfull()
- func (u *User) Name() string
- func (u *User) NewPassword() (string, error)
- func (u *User) NextPassword() string
- func (u *User) NumPasswdChg(d time.Duration) int
- func (u *User) Password() string
- func (u *User) PasswordCreated() time.Time
- func (u User) PasswordHistoryCount() int
- func (u *User) PasswordLastUse() time.Time
- func (u *User) ResetPasswordIndex()
- func (u *User) Save() error
- func (u *User) SetPassword(pw string)
- func (u User) String() string
- func (u *User) Type() string
Constants ¶
This section is empty.
Variables ¶
var (
// Store is the userstore client
Store = createClient()
)
Functions ¶
func EncryptedReader ¶
EncryptedReader wraps r with an OFB cipher stream.
func EncryptedWriter ¶
EncryptedWriter wraps w with an OFB cipher stream.
func IntialiseStore ¶
func IntialiseStore()
IntialiseStore does the setup for the user store starts a goroutine and handles user request in the background
Types ¶
type PwEntry ¶ added in v0.10.11
type PwEntry struct { Passwd []byte `json:"payload"` Created time.Time `json:"created"` LastUse time.Time `json:"last_use"` }
PwEntry stores pw history
type User ¶
type User struct { Username string `json:"name"` Mail string `json:"email"` Longname string `json:"displayname"` DeprecatedPasswd []byte `json:"payload"` // Deprecated: use History instead. (since v0.11.0) History []*PwEntry `json:"history"` UserType string `json:"type"` // contains filtered or unexported fields }
User stores a user and its encrypted password
func (User) FailedLogins ¶ added in v0.12.0
FailedLogins the number of failed logins
func (*User) LoginSuccessfull ¶ added in v0.12.0
func (u *User) LoginSuccessfull()
LoginSuccessfull sets the last use of the password
func (*User) NewPassword ¶ added in v0.12.0
NewPassword generates a new password it does not store the password
func (*User) NextPassword ¶ added in v0.10.11
NextPassword increases the password index and returns the decrypted PW retruns empty string "" if no more passwords are present
func (*User) NumPasswdChg ¶ added in v0.12.2
NumPasswdChg number of times the password was changed
func (*User) PasswordCreated ¶ added in v0.10.11
PasswordCreated returns the time when the password was created
func (User) PasswordHistoryCount ¶ added in v0.11.0
PasswordHistoryCount returns the number of PW in the history
func (*User) PasswordLastUse ¶ added in v0.10.11
PasswordLastUse returns the time when the password was last accessed
func (*User) ResetPasswordIndex ¶ added in v0.12.0
func (u *User) ResetPasswordIndex()
ResetPasswordIndex start with the first password and reset the number of failed logins to 0