-
Notifications
You must be signed in to change notification settings - Fork 0
/
clientSchema.go
22 lines (17 loc) · 898 Bytes
/
clientSchema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
import "go.mongodb.org/mongo-driver/bson/primitive"
// At a bare minimum any authenticated client (including people/users, services,
// and bots) must have an email address and a hashed password.
type Client struct {
// Required fields for all clients
Id primitive.ObjectID `bson:"_id," json:"-"`
Email string `bson:"email" json:"email"`
Suspended bool `bson:"suspended" json:"-"`
Groups []string `bson:"groups" json:"groups"`
// If the client is a person, then the following fields are required
FirstName string `bson:"firstName, omitempty" json:"firstName"`
LastName string `bson:"lastName, omitempty" json:"lastName"`
HashedPassword string `bson:"hashedPassword, omitempty" json:"-"`
// If the client is a service, then the following fields are required
Name string `bson:"name, omitempty" json:"name"`
}