Documentation
¶
Index ¶
Constants ¶
View Source
const CONFIGURATION_SECRET_LENGTH = 32
How long should configuration secrets be in random characters before base64 encode?
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
gorm.Model
Username string
PublicKey string
// Specify if a user's public key can be configured. Also specify a secret that must be passed for
// the configuration to happen.
IsConfigurable bool
Secret string
}
func GetUserBySecret ¶
Given a secret, see if a configurable user can be found with that secret.
func GetUserByUsername ¶
Given a secret, see if a configurable user can be found with that secret.
func NewUser ¶
Given a username as a string, return a pointer to a new user. THe user has public key configuration open.
func (*User) EnableConfiguration ¶
Set a user to be configurable by setting the boolean and generating a new secret.
Click to show internal directories.
Click to hide internal directories.