aboutsummaryrefslogtreecommitdiffstats
path: root/services/convert
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2023-08-22 11:20:34 +0800
committerGitHub <noreply@github.com>2023-08-22 11:20:34 +0800
commit23addde28ebd69ef2c1cec6a63123c87ec8bffe9 (patch)
tree6b4327eeef013f38bc7cc332b653bbddb9b43d8d /services/convert
parenta4a567f29f69e39d57a9fa7008d708f7fd080e58 (diff)
downloadgitea-23addde28ebd69ef2c1cec6a63123c87ec8bffe9.tar.gz
gitea-23addde28ebd69ef2c1cec6a63123c87ec8bffe9.zip
feat: implement organization secret creation API (#26566)
- Add a new `CreateSecretOption` struct for creating secrets - Implement a `CreateOrgSecret` function to create a secret in an organization - Add a new route in `api.go` to handle the creation of organization secrets - Update the Swagger template to include the new `CreateOrgSecret` API endpoint --------- Signed-off-by: appleboy <appleboy.tw@gmail.com>
Diffstat (limited to 'services/convert')
-rw-r--r--services/convert/secret.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/convert/secret.go b/services/convert/secret.go
new file mode 100644
index 0000000000..dd7b9f0a6a
--- /dev/null
+++ b/services/convert/secret.go
@@ -0,0 +1,18 @@
+// Copyright 2023 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package convert
+
+import (
+ secret_model "code.gitea.io/gitea/models/secret"
+ api "code.gitea.io/gitea/modules/structs"
+)
+
+// ToSecret converts Secret to API format
+func ToSecret(secret *secret_model.Secret) *api.Secret {
+ result := &api.Secret{
+ Name: secret.Name,
+ }
+
+ return result
+}