mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -99,6 +99,20 @@ func (api *Api) updateProviderSettings(c *contextmodel.ReqContext) response.Resp
|
|||||||
return response.JSON(http.StatusNoContent, nil)
|
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 {
|
func (api *Api) removeProviderSettings(c *contextmodel.ReqContext) response.Response {
|
||||||
key, ok := web.Params(c.Req)[":key"]
|
key, ok := web.Params(c.Req)[":key"]
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -112,3 +126,10 @@ func (api *Api) removeProviderSettings(c *contextmodel.ReqContext) response.Resp
|
|||||||
|
|
||||||
return response.JSON(http.StatusNoContent, nil)
|
return response.JSON(http.StatusNoContent, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// swagger:parameters removeProviderSettings
|
||||||
|
type RemoveProviderSettingsParams struct {
|
||||||
|
// in:path
|
||||||
|
// required:true
|
||||||
|
Key string `json:"key"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -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": {
|
"definitions": {
|
||||||
|
|||||||
@@ -23803,6 +23803,43 @@
|
|||||||
"users"
|
"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": [
|
"security": [
|
||||||
|
|||||||
Reference in New Issue
Block a user