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 fixture for wrong digest algorithm #85

Merged
merged 2 commits into from
May 2, 2021

Conversation

pwinckles
Copy link
Contributor

Fixture for invalid content digest algorithm

Copy link
Collaborator

@zimeon zimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think E001 in the name is helpful -- whether a validator reports E001 will depend on what it does after understanding a disallowed md5 digest choice -- if it reports that as disallowed but then continues normally, I think all files are OK

@zimeon
Copy link
Collaborator

zimeon commented Apr 20, 2021

My validator reports all sorts of confusing errors because it rejects md5 and then carries on with sha512 as the default for other checks:

(py38) simeon@RottenApple fixtures> ../ocfl-validate.py 1.0/bad-objects/E025_E001_wrong_digest_algorithm/
[E025a] OCFL Object root inventory manifest block includes a digest (d2c79c8519af858fac2993c2373b5203) that doesn't have the correct form for the sha512 algorithm (see https://ocfl.io/1.0/spec/#E025)
[E025a] OCFL Object root inventory manifest block includes a digest (fccd3f96d461f495a3bef31dc1d28f01) that doesn't have the correct form for the sha512 algorithm (see https://ocfl.io/1.0/spec/#E025)
[E039] OCFL Object root inventory `digestAlgorithm` attribute not an allowed value (got 'md5') (see https://ocfl.io/1.0/spec/#E039)
[E050d] OCFL Object root inventory v1 version state block includes a bad digest (d2c79c8519af858fac2993c2373b5203) (see https://ocfl.io/1.0/spec/#E050)
[E050d] OCFL Object root inventory v1 version state block includes a bad digest (fccd3f96d461f495a3bef31dc1d28f01) (see https://ocfl.io/1.0/spec/#E050)
[E058a] OCFL Object root inventory is missing sidecar digest file at inventory.json.sha512 (see https://ocfl.io/1.0/spec/#E058)
INFO:ocfl.object:OCFL object at 1.0/bad-objects/E025_E001_wrong_digest_algorithm/ is INVALID

This isn't really helpful. Either the validator should short-circuit at finding a bad digestAlgorithm or else make other checks more about consistency given a disallowed algorithm.

@pwinckles
Copy link
Contributor Author

My validator reports E001 for the unexpected inventory.json.md5 file. I am happy to remove the code from the fixture name, if you'd like.

@zimeon
Copy link
Collaborator

zimeon commented Apr 26, 2021

I think it would be best to remove E001 because E025 is the key code it is trying to elicit. I am wondering whether we should express a philosophy of bad fixture naming -- that the name will include an error codes that we expect a validator to give, it may give others depending upon approach

@pwinckles
Copy link
Contributor Author

I removed the E001 code, and agree with your suggestion

@awoods awoods merged commit f2f5773 into OCFL:main May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants