mirror of
https://github.com/h44z/wg-portal.git
synced 2025-12-15 19:16:17 +00:00
RESTful API for WireGuard Portal (#11)
This commit is contained in:
@@ -14,6 +14,16 @@ const (
|
||||
UserSourceOIDC UserSource = "oidc" // open id connect, TODO: implement
|
||||
)
|
||||
|
||||
type PrivateString string
|
||||
|
||||
func (PrivateString) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`""`), nil
|
||||
}
|
||||
|
||||
func (PrivateString) String() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// User is the user model that gets linked to peer entries, by default an empty usermodel with only the email address is created
|
||||
type User struct {
|
||||
// required fields
|
||||
@@ -27,10 +37,10 @@ type User struct {
|
||||
Phone string `form:"phone" binding:"omitempty"`
|
||||
|
||||
// optional, integrated password authentication
|
||||
Password string `form:"password" binding:"omitempty"`
|
||||
Password PrivateString `form:"password" binding:"omitempty"`
|
||||
|
||||
// database internal fields
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:",omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user