-
Notifications
You must be signed in to change notification settings - Fork 45
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 an extensions API endpoint for downloading signatures #527
Conversation
fd7e098
to
a3a0622
Compare
pulp_container/app/registry_api.py
Outdated
class Signatures(ContainerRegistryApiMixin, ViewSet): | ||
"""A ViewSet for image signatures.""" | ||
|
||
lookup_value_regex = "sha256:[0-9a-f]+" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be specific:
lookup_value_regex = "sha256:[0-9a-f]+" | |
lookup_value_regex = "sha256:[0-9a-f]{64}" |
a3a0622
to
fe7ef04
Compare
fe7ef04
to
b0ccb77
Compare
pulp_container/app/registry_api.py
Outdated
headers.update( | ||
{ | ||
"Docker-Distribution-Api-Version": "registry/2.0", | ||
"X-Registry-Supports-Signatures": "1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header name is already defined in stages file https://github.com/pulp/pulp_container/blob/signing/pulp_container/app/tasks/sync_stages.py#L43, how about putting it into the constants and using it here and there?
b0ccb77
to
ce6155f
Compare
ce6155f
to
612e552
Compare
data = [] | ||
for signature in signatures: | ||
signature = { | ||
"schemaVersion": 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find, "schemaVersion" worked much better!
@ipanova , https://github.com/containers/image/blob/f2c99a9b1a0cd6673aab0d538b48d68562702b04/docker/docker_client.go#L76 shows in the comment how json is being serialized, and that it's this string and not the attribute name is used. But it is confusing, why not to make them the same 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok that's confusing as hell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version
stands for a parsed value. A raw JSON value is stored as "schemaVersion".
closes #504