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

feat: Allow nullable expiry per 0.9.0 spec. Fixes #23 #95

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

jsantell
Copy link
Contributor

No description provided.

@jsantell jsantell requested review from cdata and a team as code owners May 24, 2023 19:18
@codecov-commenter
Copy link

codecov-commenter commented May 24, 2023

Codecov Report

Merging #95 (382219a) into main (3d30ec8) will increase coverage by 0.15%.
The diff coverage is 88.88%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   57.10%   57.26%   +0.15%     
==========================================
  Files          24       24              
  Lines         802      805       +3     
  Branches      196      197       +1     
==========================================
+ Hits          458      461       +3     
  Misses        206      206              
  Partials      138      138              
Impacted Files Coverage Δ
ucan/src/chain.rs 61.90% <ø> (ø)
ucan/src/ipld/ucan.rs 71.11% <ø> (ø)
ucan/src/ucan.rs 68.04% <75.00%> (-0.78%) ⬇️
ucan/src/builder.rs 80.80% <100.00%> (+1.80%) ⬆️

@jsantell jsantell force-pushed the 0.9.0-nullable-expiry branch 2 times, most recently from ade9916 to e4d0f76 Compare May 25, 2023 19:39
@jsantell
Copy link
Contributor Author

Updated to not encode expiry if empty per canonicalization

@jsantell jsantell force-pushed the 0.9.0-nullable-expiry branch from e4d0f76 to 45d324e Compare May 25, 2023 20:32
@jsantell
Copy link
Contributor Author

Updated to not encode expiry if empty per canonicalization

Stepping back from this. The exp field is both required and nullable. Per canonicalization, optional fields MUST not be encoded e.g. fct and prf. exp was explicitly made NOT optional due to safety concerns, so to adhere to canonicalization, we should encode empty exp fields as Null.

@jsantell jsantell force-pushed the 0.9.0-nullable-expiry branch 2 times, most recently from 51a934b to 382219a Compare June 5, 2023 16:45
Copy link
Member

@cdata cdata left a comment

Choose a reason for hiding this comment

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

Looks good, just a request for some coverage 🙏

ucan/src/ucan.rs Show resolved Hide resolved
@jsantell jsantell force-pushed the 0.9.0-nullable-expiry branch from 382219a to cda9d76 Compare June 6, 2023 18:35
@jsantell
Copy link
Contributor Author

jsantell commented Jun 6, 2023

Broke out tests into two: one for serialization without optionals (covers and clarifies these collection of PRs with optionality changes), and one specifically for lifetime_ends_after(), adding a case for the missing (Some, Some) scenario

@jsantell jsantell requested a review from cdata June 6, 2023 18:40
Copy link
Member

@cdata cdata left a comment

Choose a reason for hiding this comment

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

:shipit:

@cdata cdata merged commit 12d4756 into ucan-wg:main Jun 6, 2023
@jsantell jsantell deleted the 0.9.0-nullable-expiry branch June 6, 2023 18:49
@github-actions github-actions bot mentioned this pull request Jun 6, 2023
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