-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(API): update and delete secret for managing organization secrets #26660
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add `ChangeSecret` 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 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Aug 22, 2023
pull-request-size
bot
added
the
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
label
Aug 22, 2023
- Update the comment for the `UpdateOrgSecret` function - Update the comment for the `DeleteOrgSecret` function Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
…late file - Update the `UpdateSecretOption` struct in `modules/structs/secret.go` - Update the summary comment for the `UpdateOrgSecret` function in `routers/api/v1/org/action.go` - Update the summary comment for the `v1_json.tmpl` template file in `templates/swagger` - Update the description for a field in the `v1_json.tmpl` template file in `templates/swagger` - Update the description for another field in the `v1_json.tmpl` template file in `templates/swagger` - Update the description for a third field in the `v1_json.tmpl` template file in `templates/swagger` - Update the description for a fourth field in the `v1_json.tmpl` template file in `templates/swagger` - Update the description for a fifth field in the `v1_json.tmpl` template file in `templates/swagger` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
You use |
- Change the function name from `ChangeSecret` to `UpdateSecret` in `models/secret/secret.go` - Update the function call from `ChangeSecret` to `UpdateSecret` in `routers/api/v1/org/action.go` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@techknowlogick 14b25cd for |
lunny
approved these changes
Aug 23, 2023
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Aug 23, 2023
lunny
added
type/enhancement
An improvement of existing functionality
modifies/api
This PR adds API routes or modifies them
labels
Aug 23, 2023
wxiaoguang
reviewed
Aug 23, 2023
wxiaoguang
reviewed
Aug 23, 2023
wxiaoguang
reviewed
Aug 23, 2023
wxiaoguang
reviewed
Aug 23, 2023
…use the changes made in the code do not fix a bug or introduce a new feature, but rather improve the structure or organization of the code.: refactor error handling and update secret functions - Add `ErrSecretNotFound` type to represent a "secret not found" error - Add `IsErrSecretNotFound` function to check if an error is a `ErrSecretNotFound` - Implement `Error` method for `ErrSecretNotFound` type - Implement `Unwrap` method for `ErrSecretNotFound` type - Update `UpdateSecret` function to use `strings.ToUpper` for `name` - Update query in `UpdateSecret` function to use `name` instead of `strings.ToUpper(name)` - Return `ErrSecretNotFound` instead of `errors.New("secret not found")` in `UpdateSecret` function - Return `ErrSecretNotFound` instead of `errors.New("secret not found")` in `DeleteSecret` function - Update `UpdateOrgSecret` function to handle `ErrSecretNotFound` error and return 404 if secret is not found - Update error message in `UpdateOrgSecret` function to "UpdateSecret" instead of "ChangeSecret" - Update `DeleteOrgSecret` function to handle `ErrSecretNotFound` error and return 404 if secret is not found Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Add validation for the `Name` field in the `CreateOrgSecret` function Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@wxiaoguang Fixed all that you mention. |
wxiaoguang
approved these changes
Aug 23, 2023
GiteaBot
removed
the
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
label
Aug 23, 2023
GiteaBot
added
the
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
label
Aug 23, 2023
lunny
added
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Aug 23, 2023
GiteaBot
removed
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Aug 24, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Aug 24, 2023
* upstream/main: feat(API): update and delete secret for managing organization secrets (go-gitea#26660) Remove ref name in PR commits page (go-gitea#25876) Modify the content format of the Feishu webhook (go-gitea#25106) Handle "comment form combo editor init" more gracefully (go-gitea#26688) Prefer variables over subprocesses (go-gitea#26690) Fix archived unix time when archiving the label (go-gitea#26681) Make "link-action" backend code respond correct JSON content (go-gitea#26680) Fix doubled box-shadow in branch dropdown menu (go-gitea#26678) Refactor toast module (go-gitea#26677)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/api
This PR adds API routes or modifies them
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
type/enhancement
An improvement of existing functionality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UpdateSecret
function to modify org or user repo secretDeleteSecret
function to delete secret from an organizationUpdateSecretOption
struct for updating secret optionsUpdateOrgSecret
function to update a secret in an organizationDeleteOrgSecret
function to delete a secret in an organizationGitHub API