ucan-wg / rs-ucan

Rust implementation of UCAN
Apache License 2.0
63 stars 15 forks source link

feat: allow fct and prf to be nullable. Fixes #98 #99

Closed jsantell closed 1 year ago

jsantell commented 1 year ago

Description

Allows fct and prf to be nullable when consuming, and adhering to canonicalization, will not encode empty values in the resulting JWT.

Link to issue

98

Type of change

This makes rs-ucan adhere to the spec as of 0.9.0 w/r/t prf and fct fields which MAY be undefined. This is a breaking change w/r/t some interfaces, but notably also the canonicalization.

Test plan (required)

Updated existing tests

codecov-commenter commented 1 year ago

Codecov Report

Merging #99 (2267bec) into main (c0bec08) will increase coverage by 0.06%. The diff coverage is 66.66%.

:exclamation: 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](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99/graphs/tree.svg?width=650&height=150&src=pr&token=UZ53MKNKJC&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg)](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg) ```diff @@ Coverage Diff @@ ## main #99 +/- ## ========================================== + Coverage 57.36% 57.43% +0.06% ========================================== Files 23 23 Lines 774 787 +13 Branches 187 191 +4 ========================================== + Hits 444 452 +8 - Misses 202 204 +2 - Partials 128 131 +3 ``` | [Impacted Files](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg) | Coverage Δ | | |---|---|---| | [ucan/src/chain.rs](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg#diff-dWNhbi9zcmMvY2hhaW4ucnM=) | `63.80% <57.14%> (+0.34%)` | :arrow_up: | | [ucan/src/ipld/ucan.rs](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg#diff-dWNhbi9zcmMvaXBsZC91Y2FuLnJz) | `71.11% <60.00%> (-3.25%)` | :arrow_down: | | [ucan/src/builder.rs](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg#diff-dWNhbi9zcmMvYnVpbGRlci5ycw==) | `78.57% <75.00%> (-0.78%)` | :arrow_down: | | [ucan/src/ucan.rs](https://app.codecov.io/gh/ucan-wg/rs-ucan/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ucan-wg#diff-dWNhbi9zcmMvdWNhbi5ycw==) | `69.47% <100.00%> (ø)` | |