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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user