Skip to content

Commit

Permalink
Reuse headers from pulpcore::apache class
Browse files Browse the repository at this point in the history
We have the exact same code in both pulpcore::plugin::container as in
pulpcore::apache. This reuses the variables rather than duplicating the
logic.

Fixes: 21aa39e ("Fixes #37308 - set REMOTE_USER properly for pulpcore registry")
  • Loading branch information
ekohl committed Aug 27, 2024
1 parent c63cb65 commit 5b6d088
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions manifests/plugin/container.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
String $location_prefix = '/pulpcore_registry',
String $registry_version_path = '/v2/',
) {
$api_default_request_headers = [
"unset ${pulpcore::apache::remote_user_environ_header}",
]

$api_additional_request_headers = $pulpcore::api_client_auth_cn_map.map |String $cn, String $pulp_user| {
"set ${pulpcore::apache::remote_user_environ_header} \"${pulp_user}\" \"expr=%{SSL_CLIENT_S_DN_CN} == '${cn}'\""
}

$context = {
'directories' => [
{
Expand All @@ -27,7 +19,7 @@
'url' => "${pulpcore::apache::api_base_url}${registry_version_path}",
},
],
'request_headers' => $api_default_request_headers + $api_additional_request_headers,
'request_headers' => $pulpcore::apache::api_default_request_headers + $pulpcore::apache::api_additional_request_headers,
},
],
'proxy_pass' => [
Expand Down

0 comments on commit 5b6d088

Please sign in to comment.