29 lines
1.1 KiB
Go
Executable File
29 lines
1.1 KiB
Go
Executable File
package storage
|
|
|
|
type Account struct {
|
|
ID string `json:"id" bson:"_id"`
|
|
Namespace string `json:"namespace"`
|
|
Authentication AccountAuth `json:"-" bson:"authentication"`
|
|
Data map[string]any `json:"data"`
|
|
Metadata map[string]any `json:"metadata"`
|
|
}
|
|
|
|
type AccountAuth struct {
|
|
Local *LocalAuth `bson:"local,omitempty"`
|
|
//TODO handle SSO
|
|
}
|
|
|
|
type LocalAuth struct {
|
|
Username *string `json:"username" bson:"username,omitempty"`
|
|
Password string `json:"password" bson:"password"`
|
|
Email *string `json:"email" bson:"email,omitempty"`
|
|
EmailValidation *Validation `json:"email_validation" bson:"email_validation,omitempty"`
|
|
PhoneNumber *string `json:"phone_number" bson:"phone_number,omitempty"`
|
|
PhoneNumberValidation *Validation `json:"phone_number_validation" bson:"phone_number_validation,omitempty"`
|
|
}
|
|
|
|
type Validation struct {
|
|
Validated bool `json:"validated" bson:"validated"`
|
|
ValidationCode string `json:"validation_code" bson:"validation_code"`
|
|
}
|