docs: regenerate swagger spec and fix comment syntax

pull/36113/head
SBALAVIGNESH123 2025-12-11 03:15:33 +07:00
parent a7b804626b
commit 1ef6e0696f
2 changed files with 331 additions and 51 deletions

@ -12,30 +12,30 @@ import (
"code.gitea.io/gitea/services/context"
)
// swagger:operation GET /repos/{owner}/{repo}/settings/actions/permissions repository repoGetActionsPermissions
// ---
// summary: Get repository Actions token permissions
// produces:
// - application/json
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// type: string
// required: true
// - name: repo
// in: path
// description: name of the repo
// type: string
// required: true
// responses:
// "200":
// "$ref": "#/responses/ActionsPermissionsResponse"
// "404":
// "$ref": "#/responses/notFound"
// GetActionsPermissions returns the Actions token permissions for a repository
func GetActionsPermissions(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/settings/actions/permissions repository repoGetActionsPermissions
// ---
// summary: Get repository Actions token permissions
// produces:
// - application/json
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// type: string
// required: true
// - name: repo
// in: path
// description: name of the repo
// type: string
// required: true
// responses:
// "200":
// "$ref": "#/responses/ActionsPermissionsResponse"
// "404":
// "$ref": "#/responses/notFound"
// Check if user has admin access to this repo
// NOTE: Only repo admins and owners should be able to view/modify permission settings
// This is important for security - we don't want regular contributors
@ -64,37 +64,38 @@ func GetActionsPermissions(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, convertToAPIPermissions(perms))
}
// swagger:operation PUT /repos/{owner}/{repo}/settings/actions/permissions repository repoUpdateActionsPermissions
// ---
// summary: Update repository Actions token permissions
// consumes:
// - application/json
// produces:
// - application/json
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// type: string
// required: true
// - name: repo
// in: path
// description: name of the repo
// type: string
// required: true
// - name: body
// in: body
// schema:
// "$ref": "#/definitions/ActionsPermissions"
// responses:
// "200":
// "$ref": "#/responses/ActionsPermissionsResponse"
// "403":
// "$ref": "#/responses/forbidden"
// "422":
// "$ref": "#/responses/validationError"
// UpdateActionsPermissions updates the Actions token permissions for a repository
func UpdateActionsPermissions(ctx *context.APIContext) {
// swagger:operation PUT /repos/{owner}/{repo}/settings/actions/permissions repository repoUpdateActionsPermissions
// ---
// summary: Update repository Actions token permissions
// consumes:
// - application/json
// produces:
// - application/json
// parameters:
// - name: owner
// in: path
// description: owner of the repo
// type: string
// required: true
// - name: repo
// in: path
// description: name of the repo
// type: string
// required: true
// - name: body
// in: body
// schema:
// "$ref": "#/definitions/ActionsPermissions"
// responses:
// "200":
// "$ref": "#/responses/ActionsPermissionsResponse"
// "403":
// "$ref": "#/responses/forbidden"
// "422":
// "$ref": "#/responses/validationError"
// Only repo admins and owners should be able to modify these settings.
// This is enforced by the reqAdmin middleware.

@ -3583,6 +3583,168 @@
}
}
},
"/orgs/{org}/settings/actions/cross-repo-access": {
"get": {
"produces": [
"application/json"
],
"tags": [
"organization"
],
"summary": "List cross-repository access rules",
"operationId": "orgListCrossRepoAccess",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/CrossRepoAccessList"
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"organization"
],
"summary": "Add cross-repository access rule",
"operationId": "orgAddCrossRepoAccess",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/CrossRepoAccessRule"
}
}
],
"responses": {
"201": {
"$ref": "#/responses/CrossRepoAccessRule"
},
"403": {
"$ref": "#/responses/forbidden"
}
}
}
},
"/orgs/{org}/settings/actions/cross-repo-access/{id}": {
"delete": {
"tags": [
"organization"
],
"summary": "Delete cross-repository access rule",
"operationId": "orgDeleteCrossRepoAccess",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "ID of the rule to delete",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"403": {
"$ref": "#/responses/forbidden"
}
}
}
},
"/orgs/{org}/settings/actions/permissions": {
"get": {
"produces": [
"application/json"
],
"tags": [
"organization"
],
"summary": "Get organization Actions token permissions",
"operationId": "orgGetActionsPermissions",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/OrgActionsPermissionsResponse"
},
"404": {
"$ref": "#/responses/notFound"
}
}
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"organization"
],
"summary": "Update organization Actions token permissions",
"operationId": "orgUpdateActionsPermissions",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/OrgActionsPermissions"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/OrgActionsPermissionsResponse"
},
"403": {
"$ref": "#/responses/forbidden"
}
}
}
},
"/orgs/{org}/teams": {
"get": {
"produces": [
@ -15727,6 +15889,123 @@
}
}
},
"/repos/{owner}/{repo}/settings/actions/permissions": {
"get": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Get repository Actions token permissions",
"operationId": "repoGetActionsPermissions",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/ActionsPermissionsResponse"
},
"404": {
"$ref": "#/responses/notFound"
}
}
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Update repository Actions token permissions",
"operationId": "repoUpdateActionsPermissions",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/ActionsPermissions"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/ActionsPermissionsResponse"
},
"403": {
"$ref": "#/responses/forbidden"
},
"422": {
"$ref": "#/responses/validationError"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Reset repository Actions permissions to default",
"operationId": "repoResetActionsPermissions",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"403": {
"$ref": "#/responses/forbidden"
}
}
}
},
"/repos/{owner}/{repo}/signing-key.gpg": {
"get": {
"produces": [