mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 11:16:11 +01:00
8cd46024fd
According to the GitHub API Spec: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret Merge the Create and Update secret into a single API. - Remove the `CreateSecretOption` struct and replace it with `CreateOrUpdateSecretOption` in `modules/structs/secret.go` - Update the `CreateOrUpdateOrgSecret` function in `routers/api/v1/org/action.go` to use `CreateOrUpdateSecretOption` instead of `UpdateSecretOption` - Remove the `CreateOrgSecret` function in `routers/api/v1/org/action.go` and replace it with `CreateOrUpdateOrgSecret` - Update the Swagger documentation in `routers/api/v1/swagger/options.go` and `templates/swagger/v1_json.tmpl` to reflect the changes in the struct names and function names Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
25 lines
544 B
Go
25 lines
544 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package structs
|
|
|
|
import "time"
|
|
|
|
// Secret represents a secret
|
|
// swagger:model
|
|
type Secret struct {
|
|
// the secret's name
|
|
Name string `json:"name"`
|
|
// swagger:strfmt date-time
|
|
Created time.Time `json:"created_at"`
|
|
}
|
|
|
|
// CreateOrUpdateSecretOption options when creating or updating secret
|
|
// swagger:model
|
|
type CreateOrUpdateSecretOption struct {
|
|
// Data of the secret to update
|
|
//
|
|
// required: true
|
|
Data string `json:"data" binding:"Required"`
|
|
}
|