-
Notifications
You must be signed in to change notification settings - Fork 5
Sanitize content hashes in archive methods #175
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
base: main
Are you sure you want to change the base?
Conversation
07bea7b
to
e37a8dd
Compare
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.
Content hash also needes to be sanitized for the generate_url
!
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.
- sanitize hashes in generate_url calls
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.
Content hash needs to be sanitized for the generate_url
method as well!
Probably need to also sanitize prefixes as well (e.g. in the |
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.
Seems good to me. We can merge this after the remaining comments are addressed :)
Our content hashes are always hex digests and we should reject anything that contains non-hex characters.
0f9e719
to
aeed179
Compare
Thanks for this PR, @tillprochaska and sorry it took so long to finish it. I just added two more calls from |
Our content hashes are always hex digests and we should reject anything that contains non-hex characters. This raises an exception when trying to call archive methods with invalid content hashes.
You can test this in Aleph by installing serivcelayer from this branch:
Don’t forget to restart the
api
container after doing this :)