tcpd-sso/user.go

36 lines
1.3 KiB
Go

package sso
// User contains account information for an SSO user.
type User struct {
MailMapper
// UserID is a key that is likely cached in memory used to lookup GlobalUsers.
UserID string `json:"id"`
// PassHash should be a bcrypt hashed password used for authentication.
PassHash string `json:"password,"`
// 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"`
// Nickname is a nickname that the user decides.
Nickname string `json:"friendly_name,omitempty"`
// 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"`
// 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"`
// Active determines if the account is enabled or not.
Active bool `json:"active"`
}