-
Notifications
You must be signed in to change notification settings - Fork 48
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
Strengthen the schema w/r/t format, required fields #397
Changes from 66 commits
4b3824a
e0c6de0
a6b72b2
bf78213
5e9de32
00ac587
b60ecdb
2ad6e87
d159768
6793eff
0f662bb
167e8de
eeb32b4
cc2f8b6
7afa5b0
bac9875
fdfda2e
45ea044
645b3fb
ffd812e
a1ae005
5ddfdc5
65771ad
cf7731b
0f38b05
6144588
62aab52
520733f
bf73b63
dca05b5
304b829
253dcaa
b95edfc
32ab6b5
421cb97
8433c33
c348259
5089cbc
43e5ce0
de98d66
f603cb3
cff3e9d
42dc8ba
cce99b6
d36c1ab
7be3f5a
cf67d64
7a5fafa
d4f5793
876e9a0
0bc7ee0
13eb936
af5d9b7
f0bc914
8f4fc95
094c0a2
e8846cc
a01aab3
1f3e236
4a4d1bb
89e2a2f
84939e1
901c6ed
9a40d26
984eb16
103fd3f
4ec47fe
0ca90a1
02a9fad
5cdfa1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,20 @@ | |
"type": "string" | ||
}, | ||
"base64": { | ||
"type": "string" | ||
"type": "string", | ||
"pattern": "^[0-9A-Za-z=+/]{4,}$" | ||
}, | ||
"url": { | ||
"type": "string" | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"sha256": { | ||
"type": "string" | ||
"type": "string", | ||
"pattern": "^[0-9A-Za-z]{64}$" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you think about just making it all-lower or all-upper? Reason being, then it's easier to do a naive "string compare" to see if "hash matched" -- otherwise it takes extra code that somebody is likely to get wrong... I'd rather force the generation to be all-lower than rely on the equality check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with all lowercase because that's customary. I was wondering if device makers would have other opinions, especially from non-Unix platforms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this is a mistake and it should be a-f not a-z. |
||
} | ||
} | ||
}, | ||
"oneOf": [ | ||
{ "required": ["content_type", "base64"] }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have expected oneOf { base64, url } (transport mechanism), and then sha256 is always required, and then content_type is optional? I suppose sha256 isn't required with base64... But doesn't content_type potentially apply to all transport mechanisms? Oh wait, is it because content_type is included in the HTTP response? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, content_type comes from http so we don't want to allow overriding it--feels dangerous to me |
||
{ "required": ["url", "sha256"] } | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": 1, | ||
"blobset": { | ||
"blobs": { | ||
"arbitrary_manufacturer_id": { | ||
"phase": "applied", | ||
"content_type": "application/zip", | ||
"base64": "UEsDBAoAAAAAAAZZ3VSU7ZiuBQAAAAUAAAAIABwAYm9vdC5pbWdVVAkAA9xqvGLcarxidXgLAAEEFjQAAARTXwEAYm9vdApQSwMECgAAAAAAB1ndVK9osDMDAAAAAwAAAAYAHABmdy5pbWdVVAkAA95qvGLearxidXgLAAEEFjQAAARTXwEAZncKUEsBAh4DCgAAAAAABlndVJTtmK4FAAAABQAAAAgAGAAAAAAAAQAAAKSBAAAAAGJvb3QuaW1nVVQFAAPcarxidXgLAAEEFjQAAARTXwEAUEsBAh4DCgAAAAAAB1ndVK9osDMDAAAAAwAAAAYAGAAAAAAAAQAAAKSBRwAAAGZ3LmltZ1VUBQAD3mq8YnV4CwABBBY0AAAEU18BAFBLBQYAAAAAAgACAJoAAACKAAAAAAA=" | ||
}, | ||
"_firmware_update": { | ||
"phase": "applied", | ||
"url": "https://manuf.com/path/file.zip", | ||
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | ||
}, | ||
"_endpoint_redirect": { | ||
"phase": "applied", | ||
"content_type": "application/json", | ||
"base64": "e30=" | ||
} | ||
} | ||
}, | ||
"timestamp": "2022-07-13T12:00:00.000Z" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"blobset": { | ||
"blobs": { | ||
"arbitrary_manufacturer_id": { | ||
"phase": "applied", | ||
"base64": "UEsDBAoAAAAAAAZZ3VSU7ZiuBQAAAAUAAAAIABwAYm9vdC5pbWdVVAkAA9xqvGLcarxidXgLAAEEFjQAAARTXwEAYm9vdApQSwMECgAAAAAAB1ndVK9osDMDAAAAAwAAAAYAHABmdy5pbWdVVAkAA95qvGLearxidXgLAAEEFjQAAARTXwEAZncKUEsBAh4DCgAAAAAABlndVJTtmK4FAAAABQAAAAgAGAAAAAAAAQAAAKSBAAAAAGJvb3QuaW1nVVQFAAPcarxidXgLAAEEFjQAAARTXwEAUEsBAh4DCgAAAAAAB1ndVK9osDMDAAAAAwAAAAYAGAAAAAAAAQAAAKSBRwAAAGZ3LmltZ1VUBQAD3mq8YnV4CwABBBY0AAAEU18BAFBLBQYAAAAAAgACAJoAAACKAAAAAAA=" | ||
} | ||
} | ||
}, | ||
"timestamp": "2022-07-13T12:00:00.000Z" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 schema violations found | ||
instance failed to match exactly one schema (matched 0 out of 2) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"blobset": { | ||
"blobs": { | ||
"_firmware_update": { | ||
"phase": "applied", | ||
"url": "https://manuf.com/path/file.zip" | ||
} | ||
} | ||
}, | ||
"timestamp": "2022-07-13T12:00:00.000Z" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 schema violations found | ||
instance failed to match exactly one schema (matched 0 out of 2) |
This file was deleted.
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.
unexpected #