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

define Enum on supported encryption types for postgresql_password #1611

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

figless
Copy link

@figless figless commented Aug 30, 2024

Summary

This PR fixes 1575

Additional Context

Related Issues (if any)

Checklist

I was hitting 1575 when using a Deferred password. With this fix, puppet creates the database as before (v9.2.0)

postgresql::server::db { $db_name:
      user     => $db_username,
      password => Deferred('unwrap', [$db_password]),
}

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

We already have defined this as an enum:

type Postgresql::Pg_password_encryption = Enum['md5', 'scram-sha-256']

And it's used in multiple places now, so this would risk them going out of sync. I'd at least expect a comment in both places to remind people to keep them in sync.

@figless
Copy link
Author

figless commented Oct 28, 2024

We already have defined this as an enum:

type Postgresql::Pg_password_encryption = Enum['md5', 'scram-sha-256']

And it's used in multiple places now, so this would risk them going out of sync. I'd at least expect a comment in both places to remind people to keep them in sync.

I've added a comment to both files.

@bastelfreak
Copy link
Collaborator

Is there a chance you can add a test with Deferred(), to ensure this doesn't break in the future?

@figless
Copy link
Author

figless commented Oct 29, 2024

Is there a chance you can add a test with Deferred(), to ensure this doesn't break in the future?

Sure - i've copied spec/acceptance/db_spec.rb to spec/acceptance/db_deferred_spec.rb and configured the test to use a Deferred password.

@figless
Copy link
Author

figless commented Oct 30, 2024

The previous code in db_deferred_spec.rb failed the CI, even though it was essentially a copy from db_spec.rb....
I have adapted the code, which now passes locally.

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.

postgresql::postgres_password throws errors when Deferred
4 participants