-
Notifications
You must be signed in to change notification settings - Fork 1
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 certs to release package #33
Conversation
Add the `certs` field to the `Release` struct and modify the `release` field to contain `ReleasePayload` parsed from the `pgxn` field of the `certs` hash map. Since the `release` field does not exist in the JSON, add custom deserialization to the `Release` struct that parses only the `dist` and `certs` fields and then extracts the `pgxn` JWS data and validates its base64-encoded JSON payload. No JWS validation yet, as the key management has not yet been worked out. Revise the `v1_to_v2_release` method to build an appropriate Base 64-encoded payload and mock signature from v1 release metadata. Add tests to ensure that the keys are included in the JSON in unicode code point order (alphabetical, since it's all lowercase ASCII) and that there are no spaces. Update the release tests for the new properties as well as the `certs` JSON schema.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 1083 1131 +48
=========================================
+ Hits 1083 1131 +48 ☔ View full report in Codecov by Sentry. |
release: ReleasePayload, | ||
} | ||
|
||
impl<'de> Deserialize<'de> for Release { |
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.
Cool!
.get("payload") | ||
.unwrap() | ||
.as_str() | ||
.unwrap(); |
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.
Baller
Add the
certs
field to theRelease
struct and modify therelease
field to containReleasePayload
parsed from thepgxn
field of thecerts
hash map. Since therelease
field does not exist in the JSON, add custom deserialization to theRelease
struct that parses only thedist
andcerts
fields and then extracts thepgxn
JWS data and validates its base64-encoded JSON payload. No JWS validation yet, as the key management has not yet been worked out.Revise the
v1_to_v2_release
method to build an appropriate Base 64-encoded payload and mock signature from v1 release metadata. Add tests to ensure that the keys are included in the JSON in unicode code point order (alphabetical, since it's all lowercase ASCII) and that there are no spaces.Update the release tests for the new properties as well as the
certs
JSON schema.