Skip to content

Conversation

@mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Mar 20, 2017

This schema is a supplement to docs/atomic-signature.md, added by #251 ; this PR therefore depends on and includes #251.

Also adds some tests for the schema. See individual commit messages for details.

Quoting description inside the schema:

Consumers of the JSON MUST use the processing rules documented in atomic-signature.md, especially the requirements for the critical subjobject.

Whenever this schema and atomic-signature.md, or the github.com/containers/image/signature implementation, differ, it is the atomic-signature.md document, or the github.com/containers/image/signature implementation, which governs.

Users are STRONGLY RECOMMENDED to use the github.com/containeres/image/signature implementation instead of writing their own, ESPECIALLY when consuming signatures, so that the policy.json format can be shared by all image consumers.

@mtrmac mtrmac force-pushed the signature-json-schema branch 2 times, most recently from 71d45db to 2f0d6ad Compare March 20, 2017 21:46
@mtrmac mtrmac force-pushed the signature-json-schema branch 5 times, most recently from 9598926 to 093c0a6 Compare April 3, 2017 21:30
@mtrmac mtrmac force-pushed the signature-json-schema branch 2 times, most recently from 9e5a473 to d319585 Compare April 10, 2017 17:23
@mtrmac mtrmac force-pushed the signature-json-schema branch from d319585 to 37e17f3 Compare April 12, 2017 16:19
@mtrmac mtrmac force-pushed the signature-json-schema branch 4 times, most recently from 28a88b9 to 1a11ea1 Compare April 27, 2017 21:08
@mtrmac mtrmac force-pushed the signature-json-schema branch from 1a11ea1 to aace4f3 Compare April 28, 2017 20:50
@mtrmac mtrmac force-pushed the signature-json-schema branch 2 times, most recently from 04a5e46 to ca67152 Compare May 10, 2017 10:26
mtrmac added 3 commits May 10, 2017 15:25
Note that this is NOT a replacement for the atomic-signature.md documentation.

Signed-off-by: Miloslav Trmač <[email protected]>
Instead of an one-shot tryUnmarshalModifiedSignature and testing the
resulting error value, use a separate modifiedUntrustedSignatureJSON
helper, and a pair of successfullyUnmarshalUntrustedSignature /
assertUnmarshalUntrustedSignatureFails helpers for the expected success
/ failure cases.

This does not change behavior right now, but it will make it easier to
add testing the JSON schema in the future.

Signed-off-by: Miloslav Trmač <[email protected]>
Reuse the existing untrustedSignature.UnmarshalJSON tests.

NOTE: The schema at schemaPath is NOT authoritative; docs/atomic-signature.json and the code is, rather!
The schemaPath references are not testing that the code follows the behavior declared by the schema,
they are testing that the schema follows the behavior of the code!

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac mtrmac force-pushed the signature-json-schema branch from ca67152 to 5012539 Compare May 10, 2017 13:27
@mtrmac mtrmac changed the title [Blocked on #251] Add JSON schema for the JSON embedded inside signatures Add JSON schema for the JSON embedded inside signatures May 10, 2017
@mtrmac
Copy link
Collaborator Author

mtrmac commented May 10, 2017

Now ready for review/merging.

@runcom
Copy link
Member

runcom commented May 10, 2017

LGTM

Approved with PullApprove

@mtrmac
Copy link
Collaborator Author

mtrmac commented May 10, 2017

👍

Approved with PullApprove

@mtrmac mtrmac merged commit b1c977d into containers:master May 10, 2017
@mtrmac mtrmac deleted the signature-json-schema branch May 10, 2017 13:50
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.

2 participants