Add swagger code for the removeProviderSettings API method (#78270)

* add swagger code for the remove provider SSO settings API method

* replace fine grained with role based

* address feedback
This commit is contained in:
Mihai Doarna 2023-11-17 14:07:26 +02:00 committed by GitHub
parent 6edc86a7ed
commit 9da9bbf907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 93 additions and 0 deletions

View File

@ -99,6 +99,20 @@ func (api *Api) updateProviderSettings(c *contextmodel.ReqContext) response.Resp
return response.JSON(http.StatusNoContent, nil)
}
// swagger:route DELETE /v1/sso-settings/{key} sso_settings removeProviderSettings
//
// # Remove SSO Settings
//
// # Remove an SSO Settings entry by Key
//
// You need to have a permission with action `settings:write` with scope `settings:auth.<provider>:*`.
//
// Responses:
// 204: okResponse
// 400: badRequestError
// 401: unauthorisedError
// 403: forbiddenError
// 500: internalServerError
func (api *Api) removeProviderSettings(c *contextmodel.ReqContext) response.Response {
key, ok := web.Params(c.Req)[":key"]
if !ok {
@ -112,3 +126,10 @@ func (api *Api) removeProviderSettings(c *contextmodel.ReqContext) response.Resp
return response.JSON(http.StatusNoContent, nil)
}
// swagger:parameters removeProviderSettings
type RemoveProviderSettingsParams struct {
// in:path
// required:true
Key string `json:"key"`
}

View File

@ -10861,6 +10861,41 @@
}
}
}
},
"/v1/sso-settings/{key}": {
"delete": {
"description": "# Remove an SSO Settings entry by Key\n\nYou need to have a permission with action `settings:write` with scope `settings:auth.\u003cprovider\u003e:*`.",
"tags": [
"sso_settings"
],
"summary": "Remove SSO Settings",
"operationId": "removeProviderSettings",
"parameters": [
{
"type": "string",
"name": "key",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/okResponse"
},
"400": {
"$ref": "#/responses/badRequestError"
},
"401": {
"$ref": "#/responses/unauthorisedError"
},
"403": {
"$ref": "#/responses/forbiddenError"
},
"500": {
"$ref": "#/responses/internalServerError"
}
}
}
}
},
"definitions": {

View File

@ -23803,6 +23803,43 @@
"users"
]
}
},
"/v1/sso-settings/{key}": {
"delete": {
"description": "# Remove an SSO Settings entry by Key\n\nYou need to have a permission with action `settings:write` with scope `settings:auth.\u003cprovider\u003e:*`.",
"operationId": "removeProviderSettings",
"parameters": [
{
"in": "path",
"name": "key",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"$ref": "#/components/responses/okResponse"
},
"400": {
"$ref": "#/components/responses/badRequestError"
},
"401": {
"$ref": "#/components/responses/unauthorisedError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"500": {
"$ref": "#/components/responses/internalServerError"
}
},
"summary": "Remove SSO Settings",
"tags": [
"sso_settings"
]
}
}
},
"security": [