Skip to content

fix(secrets): default delete --type to shared, matching set - #381

Open
solomonerous wants to merge 1 commit into
Infisical:mainfrom
solomonerous:fix/secrets-delete-default-type
Open

fix(secrets): default delete --type to shared, matching set#381
solomonerous wants to merge 1 commit into
Infisical:mainfrom
solomonerous:fix/secrets-delete-default-type

Conversation

@solomonerous

@solomonerous solomonerous commented Aug 30, 2026

Copy link
Copy Markdown

Fixes Infisical/infisical#7805

infisical secrets set and infisical secrets get default to --type shared, but infisical secrets delete defaults 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_SHARED so 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 vet only reports the four pre-existing run.go format-string warnings that are already on main.

If maintainers would rather not change the default, two alternatives I'm happy to implement instead: fall back to shared when the personal lookup 404s, or keep the defaults and just make the 404 message mention --type.

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
@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes infisical secrets delete to default --type to shared, aligning it with the default used by secrets set, and removes the stale manually written default from the flag description.

  • Uses the existing util.SECRET_TYPE_SHARED constant as the Cobra flag default.
  • Allows Cobra to render the effective default in command help.

Confidence Score: 5/5

The PR appears safe to merge because the changed default is transmitted correctly and remains overridable with an explicit --type.

The shared constant resolves to the API-supported "shared" value, and omitted and explicit --type shared invocations follow the same existing delete request path without introducing a blocking failure.

Important Files Changed

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

infisical secrets delete fails with 404 "Secret not found" for shared secrets because --type defaults to personal

1 participant