fix(secrets): default secrets delete --type to shared to match secrets set - #375
Open
rmdly wants to merge 1 commit into
Open
fix(secrets): default secrets delete --type to shared to match secrets set#375rmdly wants to merge 1 commit into
rmdly wants to merge 1 commit into
Conversation
|
✅ CLA satisfied. All contributors have signed the current CLA. The |
Contributor
|
| Filename | Overview |
|---|---|
| packages/cmd/secrets.go | Changes the delete type default to the existing shared-secret constant; explicit personal deletion remains available. |
| packages/cmd/secrets_test.go | Adds a focused test verifying that both secret mutation commands register the shared type default. |
Reviews (1): Last reviewed commit: "fix(secrets): default secrets delete --t..." | Re-trigger Greptile
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes Infisical/infisical#7805
secrets setcreates a shared secret by default, butsecrets deletelooked for a personal one by default, so deleting a secret you had just created failed with a 404:The delete flag also hardcoded the string
"personal"rather than usingutil.SECRET_TYPE_PERSONAL, and repeated the default in its usage text, which cobra already prints.This aligns the two defaults on
util.SECRET_TYPE_SHARED. Deleting a personal secret still works with an explicit--type personal.Worth flagging: this is a behaviour change for anyone scripting
secrets deleteagainst personal secrets without passing--type. It seemed like the right call becausesecrets setalready defaults to shared and thepersonaldefault on delete is not documented, but happy to switch to one of the other options in the issue if you would rather not change the default.TestSecretsTypeFlagDefaultsasserts both commands agree on the default so they cannot drift apart again.One thing I noticed while adding it: nothing in CI runs
./packages/cmd, and the package will not build undergo testbecause of four pre-existingnon-constant format stringvet errors inrun.go, so the existing unit tests there are not running either. I have left that alone here, but I am happy to open a separate PR fixing those if it would be useful.