user: add a permission to disable changing api key authentication

also implement the missing APIs to enable/disable api key authentication
This commit is contained in:
Nicola Murino
2021-09-06 18:46:35 +02:00
parent 101c2962ab
commit 7bad65a43e
11 changed files with 479 additions and 8 deletions

View File

@@ -28,6 +28,10 @@ type pwdChange struct {
NewPassword string `json:"new_password"`
}
type apiKeyAuth struct {
AllowAPIKeyAuth bool `json:"allow_api_key_auth"`
}
func sendAPIResponse(w http.ResponseWriter, r *http.Request, err error, message string, code int) {
var errorString string
if _, ok := err.(*util.RecordNotFoundError); ok {