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

properly escape quotes in passwords by calling to_python #361

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DATABASES = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '<%= scope['pulpcore::postgresql_db_name'] %>',
'USER': '<%= scope['pulpcore::postgresql_db_user'] %>',
'PASSWORD': '<%= scope['pulpcore::postgresql_db_password'] %>',
'PASSWORD': <%= scope.call_function('to_python', [scope['pulpcore::postgresql_db_password']]) %>,
Copy link
Member

Choose a reason for hiding this comment

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

is that the function from stdlib? Then maybe use the new namespaced version?

Suggested change
'PASSWORD': <%= scope.call_function('to_python', [scope['pulpcore::postgresql_db_password']]) %>,
'PASSWORD': <%= scope.call_function('stdlib::to_python', [scope['pulpcore::postgresql_db_password']]) %>,

Copy link
Member Author

@evgeni evgeni Oct 16, 2024

Choose a reason for hiding this comment

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

it is, the rest of the file is not using the namespaced version, so I didn't want to diverge

'HOST': '<%= scope['pulpcore::postgresql_db_host'] %>',
'PORT': '<%= scope['pulpcore::postgresql_db_port'] %>',
<% if scope['pulpcore::postgresql_db_ssl'] && !scope['pulpcore::postgresql_manage_db'] -%>
Expand Down
Loading