fix(secrets): default delete --type to shared, matching set - #381
Open
solomonerous wants to merge 1 commit into
Open
fix(secrets): default delete --type to shared, matching set#381solomonerous wants to merge 1 commit into
solomonerous wants to merge 1 commit into
Conversation
infisical secrets set and infisical secrets get default to shared secrets, but secrets delete defaulted to personal. The common flow set then delete always failed with a misleading 404 'Secret not found' for ordinary shared secrets unless --type shared was passed explicitly. Flip the default to util.SECRET_TYPE_SHARED so delete matches the rest of the secrets command group, and drop the now-stale manual '(default: personal)' suffix in the flag help (cobra prints the actual default). Fixes Infisical/infisical#7805
Contributor
|
| Filename | Overview |
|---|---|
| packages/cmd/secrets.go | The delete command now sends type: "shared" when --type is omitted; explicit personal and shared selections remain available, and no actionable defect was found. |
Reviews (1): Last reviewed commit: "fix(secrets): default delete --type to s..." | 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
infisical secrets setandinfisical secrets getdefault to--type shared, butinfisical secrets deletedefaults to--type personal. So the obvious flow - set a secret, then delete it - always fails with a 404 "Secret not found" unless you remember to pass--type shared, and the error gives no hint that the type is the problem.This flips the delete default to
util.SECRET_TYPE_SHAREDso it matches the rest of the group, and drops the manual "(default: personal)" suffix in the flag help since cobra prints the actual default anyway.Builds clean (
go build ./packages/cmd/);go vetonly reports the four pre-existingrun.goformat-string warnings that are already onmain.If maintainers would rather not change the default, two alternatives I'm happy to implement instead: fall back to
sharedwhen the personal lookup 404s, or keep the defaults and just make the 404 message mention--type.