Skip to content

Commit

Permalink
Fixes #28904 - make REMOTE_USER_ENVIRON_NAME configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
synkd committed Jan 30, 2020
1 parent 5bf0f38 commit 1f35968
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
# @param servername
# Server name of the VirtualHost in the webserver
#
# @param django_remote_user
# Remote user environment variable
#
# @example
# include pulpcore
class pulpcore (
Expand All @@ -66,7 +69,8 @@
String $postgresql_db_password = extlib::cache_data('pulpcore_cache_data', 'db_password', extlib::random_password(32)),
String $django_secret_key = extlib::cache_data('pulpcore_cache_data', 'secret_key', extlib::random_password(32)),
Integer[0] $redis_db = 8,
Stdlib::Fqdn $servername = $facts['fqdn']
Stdlib::Fqdn $servername = $facts['fqdn'],
Optional[String] $django_remote_user = undef,
) {

$settings_file = "${config_dir}/settings.py"
Expand Down
1 change: 1 addition & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python3-pulpcore') }
it { is_expected.to contain_concat__fragment('base').without_content(/REMOTE_USER_ENVIRON_NAME/) }

context 'with a plugin' do
let(:pre_condition) { "pulpcore::plugin { 'myplugin': }" }
Expand Down
4 changes: 3 additions & 1 deletion templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ REDIS_HOST = "localhost"
REDIS_PORT = "<%= scope['redis::port'] %>"
REDIS_DB = <%= scope['pulpcore::redis_db'] %>
WORKING_DIRECTORY = "<%= scope['pulpcore::cache_dir'] %>"
REMOTE_USER_ENVIRON_NAME = 'HTTP_REMOTE_USER'
<% if $pulpcore::django_remote_user %>
REMOTE_USER_ENVIRON_NAME = '<%= scope['pulpcore::django_remote_user'] %>'
<% end %>

0 comments on commit 1f35968

Please sign in to comment.