Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] GPG fixes #66316

Merged
merged 4 commits into from
Apr 30, 2024
Merged

[master] GPG fixes #66316

merged 4 commits into from
Apr 30, 2024

Conversation

lkubb
Copy link
Contributor

@lkubb lkubb commented Apr 4, 2024

What does this PR do?

  • Creates GNUPGHOME dir if it does not exist
  • Tries to respect process-specific (or user-specific if user was passed) GNUPGHOME environmental variable as fallback
  • Attempts to update keys in gpg.present if they are expired, otherwise fails the state

Also:

  • Some refactoring for code reuse, simplicity and output clarity
  • Adds some tests for test=true

What issues does this PR fix or reference?

Fixes: #66312
Fixes: #66313
Fixes: #66314

Previous Behavior

  • crashes if GNUPGHOME does not exist
  • falls back to ~/.gnupg, ignoring (user) env
  • accepts expired keys, offers no method of updating them with an extended validity period

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title GPG fixes [master] GPG fixes Apr 4, 2024
... otherwise fail since expired keys are meaningless.

Also:
* Untangle `gpg.present` logic
* Correctly order key changes in returned comment and prefix messages
  with key ID
* Reuse key rendering logic in execution module
* Add some tests for test mode because of logic reordering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants