Skip to content

fix(pass): reject empty secrets before authorizing --force - #695

Merged
joe0BAB merged 1 commit into
mainfrom
fix/pass-set-empty-secret
Oct 14, 2026
Merged

joe0BAB merged 1 commit into
mainfrom
fix/pass-set-empty-secret

Conversation

@joe0BAB

@joe0BAB joe0BAB commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

The store now returns store.ErrEmptySecret from Save and Upsert on every platform (#694). With --force, set asked the engine to authorize the overwrite before the store could reject the value, so the user approved an overwrite that then failed. Check the value right after reading it instead, before any engine round-trip.

Move the value switch into a readSecret helper to keep SetCommand under the gocyclo limit.

The store now returns store.ErrEmptySecret from Save and Upsert on every
platform (#694). With --force, set asked the engine to authorize the
overwrite before the store could reject the value, so the user approved
an overwrite that then failed. Check the value right after reading it
instead, before any engine round-trip.

Move the value switch into a readSecret helper to keep SetCommand under
the gocyclo limit.

Signed-off-by: Johannes Großmann <grossmann.johannes@t-online.de>
@joe0BAB
joe0BAB force-pushed the fix/pass-set-empty-secret branch from 51c6129 to 48a7256 Compare October 14, 2026 11:33
@joe0BAB
joe0BAB marked this pull request as ready for review October 14, 2026 11:35
@joe0BAB
joe0BAB merged commit d1a9706 into main Oct 14, 2026
20 checks passed
@joe0BAB
joe0BAB deleted the fix/pass-set-empty-secret branch October 14, 2026 11:36

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

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.

3 participants