2021-10-05 12:35:09 +00:00
|
|
|
package sso
|
|
|
|
|
|
|
|
// User contains account information for an SSO user.
|
|
|
|
type User struct {
|
2021-10-05 15:25:48 +00:00
|
|
|
MailMapper
|
|
|
|
|
2021-10-05 12:35:09 +00:00
|
|
|
// UserID is a key that is likely cached in memory used to lookup GlobalUsers.
|
|
|
|
UserID string `json:"id"`
|
2021-10-05 15:25:48 +00:00
|
|
|
|
2021-10-05 12:35:09 +00:00
|
|
|
// PassHash should be a bcrypt hashed password used for authentication.
|
2021-10-05 15:25:48 +00:00
|
|
|
PassHash string `json:"password,"`
|
2021-10-05 12:35:09 +00:00
|
|
|
|
2021-10-05 15:25:48 +00:00
|
|
|
// LegacyHash is a legacy password imported from Dovecot, the type of hash will be identified in the string.
|
|
|
|
// {SSHA} = salted sha1
|
|
|
|
LegacyHash string `json:"legacy_hash,omitempty"`
|
2021-10-05 12:35:09 +00:00
|
|
|
|
2021-10-05 15:25:48 +00:00
|
|
|
// Nickname is a nickname that the user decides.
|
|
|
|
Nickname string `json:"friendly_name,omitempty"`
|
2021-10-05 12:35:09 +00:00
|
|
|
|
2021-10-05 15:25:48 +00:00
|
|
|
// ContactEmail is an email address to reach the user.
|
|
|
|
// Note that one can place the address of an internal email account here as well.
|
|
|
|
ContactEmail string `json:"email,omitempty"`
|
|
|
|
|
|
|
|
// EmailAccounts contains strings that will be used to match users up with their owned email accounts.
|
|
|
|
EmailAccounts []string `json:"email_accounts,omitempty"`
|
2021-10-05 12:35:09 +00:00
|
|
|
|
|
|
|
// IRCAccount represents a users IRC account (not impemented)
|
|
|
|
IRCAccount string `json:"irc_account,omitempty"`
|
|
|
|
|
|
|
|
// GlobalAdmin is a dangerous toggle which will pretty much bypass permissions checks everywhere.
|
|
|
|
GlobalAdmin bool `json:"global_admin"`
|
2021-10-05 15:25:48 +00:00
|
|
|
|
|
|
|
// Active determines if the account is enabled or not.
|
|
|
|
Active bool `json:"active"`
|
2021-10-05 12:35:09 +00:00
|
|
|
}
|