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 certs to release package #33

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Add certs to release package #33

merged 1 commit into from
Oct 8, 2024

Conversation

theory
Copy link
Member

@theory theory commented Oct 8, 2024

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.

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.
@theory theory requested a review from vrmiguel October 8, 2024 16:15
@theory theory self-assigned this Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0773ad7) to head (acb0d22).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Base automatically changed from certs-schemas to main October 8, 2024 18:14
release: ReleasePayload,
}

impl<'de> Deserialize<'de> for Release {
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

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

Baller

@theory theory merged commit acb0d22 into main Oct 8, 2024
138 checks passed
@theory theory deleted the release-certs branch October 8, 2024 19:43
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