Skip to content

fix: validate PGPKeySource field on config load#676

Merged
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/620-pgp-key-source-validation
Apr 18, 2026
Merged

fix: validate PGPKeySource field on config load#676
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/620-pgp-key-source-validation

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

PGPKeySource accepted any string without validation. An invalid value like pgp_key_source: "invalid" would load successfully but cause silent failures when the code later assumes the value is "file" or "yubikey".

Added validation in LoadConfig() immediately after the account struct is constructed. Now rejects invalid values with a clear error message at startup rather than failing silently at runtime.

Closes #620

PGPKeySource accepted any string without validation, causing silent
failures when an invalid value was used. Now rejects values other
than "file" or "yubikey" with a clear error message at config load
time.

Closes floatpane#620
@mvanhorn mvanhorn requested a review from a team as a code owner April 18, 2026 09:19
@github-actions github-actions bot added the bug Something isn't working label Apr 18, 2026
Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff andrinoff merged commit 6fc1eae into floatpane:master Apr 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Missing PGPKeySource validation in config

2 participants