rework user and admin profiles

users and admins can now also update their email and description
This commit is contained in:
Nicola Murino
2021-09-29 18:46:15 +02:00
parent af8fa7ff81
commit ba1febba73
25 changed files with 1038 additions and 798 deletions

View File

@@ -28,8 +28,19 @@ type pwdChange struct {
NewPassword string `json:"new_password"`
}
type apiKeyAuth struct {
AllowAPIKeyAuth bool `json:"allow_api_key_auth"`
type baseProfile struct {
Email string `json:"email,omitempty"`
Description string `json:"description,omitempty"`
AllowAPIKeyAuth bool `json:"allow_api_key_auth"`
}
type adminProfile struct {
baseProfile
}
type userProfile struct {
baseProfile
PublicKeys []string `json:"public_keys,omitempty"`
}
func sendAPIResponse(w http.ResponseWriter, r *http.Request, err error, message string, code int) {