aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2023-08-24 10:07:00 +0800
committerGitHub <noreply@github.com>2023-08-24 02:07:00 +0000
commitb62c8e7765a371600a300f62da96483a1ae0c731 (patch)
tree77e2f06e361039ba981bc7927ee9c4a1a6aa5af0 /templates/swagger
parent7e30986667cc0c460a9fb38e32862e492fd4ca8d (diff)
downloadgitea-b62c8e7765a371600a300f62da96483a1ae0c731.tar.gz
gitea-b62c8e7765a371600a300f62da96483a1ae0c731.zip
feat(API): update and delete secret for managing organization secrets (#26660)
- Add `UpdateSecret` function to modify org or user repo secret - Add `DeleteSecret` function to delete secret from an organization - Add `UpdateSecretOption` struct for updating secret options - Add `UpdateOrgSecret` function to update a secret in an organization - Add `DeleteOrgSecret` function to delete a secret in an organization GitHub API 1. Update Org Secret: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret 2. Delete Org Secret: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl100
1 files changed, 99 insertions, 1 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 5e75f6f8b4..aff4490899 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1631,6 +1631,89 @@
}
}
},
+ "/orgs/{org}/actions/secrets/{secretname}": {
+ "put": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Update a secret value in an organization",
+ "operationId": "updateOrgSecret",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the secret",
+ "name": "secretname",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/UpdateSecretOption"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "update one secret of the organization"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ },
+ "delete": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Delete a secret in an organization",
+ "operationId": "deleteOrgSecret",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the secret",
+ "name": "secretname",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "delete one secret of the organization"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ }
+ }
+ }
+ },
"/orgs/{org}/activities/feeds": {
"get": {
"produces": [
@@ -21891,6 +21974,21 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "UpdateSecretOption": {
+ "description": "UpdateSecretOption options when updating secret",
+ "type": "object",
+ "required": [
+ "data"
+ ],
+ "properties": {
+ "data": {
+ "description": "Data of the secret to update",
+ "type": "string",
+ "x-go-name": "Data"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"UpdateUserAvatarOption": {
"description": "UpdateUserAvatarUserOption options when updating the user avatar",
"type": "object",
@@ -23207,7 +23305,7 @@
"parameterBodies": {
"description": "parameterBodies",
"schema": {
- "$ref": "#/definitions/CreateSecretOption"
+ "$ref": "#/definitions/UpdateSecretOption"
}
},
"redirect": {