tcpd-sso/user.go
2021-10-05 05:35:09 -07:00

29 lines
1.3 KiB
Go

package sso
// User contains account information for an SSO user.
type User struct {
// 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"`
// FriendlyName is a nickname that the user decides.
FriendlyName string `json:"friendly_name,omitempty"`
// ExternalEmail is an email address to reach the user.
// Note that one can place the address of an internal email account here as well.
ExternalEmail string `json:"email,omitempty"`
// EmailAccounts contains, if applicable, the details of a users internal email account.
EmailAccounts []EmailAccount `json:"email_accounts,omitempty"`
// LegacyEmailAccountData is a place to temporarily store JSON exported from our old Mysql email database.
// Data should be removed after the user signs on for the first time and we rehash their password in Bcrypt.
LegacyEmailAccountData string `json:"legacy_email,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"`
}