mobility-accounts/storage/accounts.go

29 lines
1.1 KiB
Go
Raw Permalink Normal View History

2022-08-11 15:14:21 +00:00
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"`
2022-08-11 15:14:21 +00:00
//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"`
2022-08-11 15:14:21 +00:00
}
type Validation struct {
2023-04-28 05:53:46 +00:00
Validated bool `json:"validated" bson:"validated"`
2022-08-11 15:14:21 +00:00
ValidationCode string `json:"validation_code" bson:"validation_code"`
}