Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #450 from ipanova/content-origin
Browse files Browse the repository at this point in the history
Remove content_origin and let pulp-operator auto set it.
  • Loading branch information
ipanova authored Nov 8, 2019
2 parents 0b0629d + f39bea4 commit c183c78
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ spec:
password: pulp
admin_password: pulp
pulp_settings:
content_host: $(hostname):24816
token_server: $(hostname):24816/token
private_key_path: /var/lib/pulp/tmp/private.pem
public_key_path: /var/lib/pulp/tmp/public.pem
Expand Down
2 changes: 1 addition & 1 deletion pulp_docker/app/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

TOKEN_EXPIRATION_TIME = 300

KNOWN_SERVICES = [settings.CONTENT_HOST]
KNOWN_SERVICES = [settings.CONTENT_ORIGIN]
ANONYMOUS_USER = ''
EMPTY_ACCESS_SCOPE = '::'

Expand Down
5 changes: 1 addition & 4 deletions pulp_docker/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ def to_representation(self, value):
"""
Converts a base_path into a registry path.
"""
if settings.CONTENT_HOST:
host = settings.CONTENT_HOST
else:
host = self.context['request'].get_host()
host = settings.CONTENT_ORIGIN
return ''.join([host, '/', value])


Expand Down
4 changes: 2 additions & 2 deletions pulp_docker/app/token_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _build_authenticate_string(self, source_path):
realm="https://token",service="docker.io",scope="repository:my-app:push".
"""
realm = f'{self.request.scheme}://{settings.TOKEN_SERVER}'
authenticate_string = f'Bearer realm="{realm}",service="{settings.CONTENT_HOST}"'
authenticate_string = f'Bearer realm="{realm}",service="{settings.CONTENT_ORIGIN}"'

if not self._is_verifying_root_endpoint():
scope = f'repository:{source_path}:pull'
Expand Down Expand Up @@ -132,7 +132,7 @@ def _init_jwt_decoder_config(self):
return {
'algorithms': [settings.TOKEN_SIGNATURE_ALGORITHM],
'issuer': settings.TOKEN_SERVER,
'audience': settings.CONTENT_HOST
'audience': settings.CONTENT_ORIGIN
}

def contains_accessible_actions(self, decoded_token):
Expand Down
1 change: 0 additions & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ plugin_name: pulp_docker
plugin_snake: pulp_docker
plugin_snake_short: docker
pulp_settings:
content_host: $(hostname):24816
token_server: $(hostname):24816/token
token_signature_algorithm: ES256
pydocstyle: true
Expand Down

0 comments on commit c183c78

Please sign in to comment.