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

Add support for ALLOWED_CONTENT_CHECKSUMS #183

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
# @param allowed_export_path
# Allowed paths that pulp can use for content exports
#
# @param allowed_content_checksums
# List of checksum types to allow for content operations
#
# @param worker_count
# Number of pulpcore workers. Defaults to 8 or the number of CPU cores, whichever is smaller. Enabling more than 8 workers, even with additional CPU cores
# available, likely results in performance degradation due to I/O blocking and is not recommended in most cases. Modifying this parameter should
Expand Down Expand Up @@ -188,6 +191,7 @@
Stdlib::Fqdn $servername = $facts['networking']['fqdn'],
Array[Stdlib::Absolutepath] $allowed_import_path = ['/var/lib/pulp/sync_imports'],
Array[Stdlib::Absolutepath] $allowed_export_path = [],
Pulpcore::ChecksumTypes $allowed_content_checksums = ['sha224', 'sha256', 'sha384', 'sha512'],
String[1] $remote_user_environ_name = 'HTTP_REMOTE_USER',
Integer[0] $worker_count = min(8, $facts['processors']['count']),
Boolean $service_enable = true,
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 @@ -22,6 +22,7 @@
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_EXPORT_PATHS = \[\]})
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/var/lib/pulp/sync_imports"\]})
.with_content(%r{ALLOWED_CONTENT_CHECKSUMS = \["sha224", "sha256", "sha384", "sha512"\]})
.without_content(/sslmode/)
is_expected.to contain_file('/etc/pulp')
is_expected.to contain_file('/var/lib/pulp')
Expand Down
8 changes: 8 additions & 0 deletions spec/type_aliases/checksumtypes_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'

describe 'Pulpcore::ChecksumTypes' do
it { is_expected.to allow_value(['sha1']) }
it { is_expected.to allow_value(['sha256']) }
it { is_expected.not_to allow_values(['sha0', 'md3']) }
it { is_expected.not_to allow_values([]) }
end
1 change: 1 addition & 0 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES = (

ALLOWED_IMPORT_PATHS = <%= scope['pulpcore::allowed_import_path'] %>
ALLOWED_EXPORT_PATHS = <%= scope['pulpcore::allowed_export_path'] %>
ALLOWED_CONTENT_CHECKSUMS = <%= scope['pulpcore::allowed_content_checksums'] %>

# Derive HTTP/HTTPS via the X-Forwarded-Proto header set by Apache
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
2 changes: 2 additions & 0 deletions types/checksumtypes.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The supported checksum types by pulpcore
type Pulpcore::ChecksumTypes = Array[Enum['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'], 1]