Auth: Implement the SSO Settings update endpoint (#79676)

* merge with system settings before storing them in the db

* add base for validating sso settings

* add unit tests for sso settings validation

* call Reload() from sso service upsert()

* remove actual validation because it was moved in a separate pr

* use constant to fix lint error

* check if provider is configurable in service Upsert() method

* add unit tests for update provider settings api method

* fix lint error
This commit is contained in:
Mihai Doarna
2024-01-03 13:04:35 +02:00
committed by GitHub
parent a255058ccf
commit ade91e5038
8 changed files with 492 additions and 36 deletions
+1 -4
View File
@@ -133,11 +133,8 @@ func (api *Api) updateProviderSettings(c *contextmodel.ReqContext) response.Resp
settings.Provider = key
err := api.SSOSettingsService.Upsert(c.Req.Context(), settings)
// TODO: first check whether the error is referring to validation errors
// other error
if err != nil {
return response.Error(http.StatusInternalServerError, "Failed to update provider settings", err)
return response.ErrOrFallback(http.StatusInternalServerError, "Failed to update provider settings", err)
}
return response.JSON(http.StatusNoContent, nil)