ucan-wg / rs-ucan

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

`prf` and `fct` fields should be optional #98

Closed cdata closed 1 year ago

cdata commented 1 year ago

This was an oversight in the implementation of rs-ucan going back at least as far as spec version v0.8.0. Most likely, ts-ucan and rs-ucan both produce empty arrays for these fields by default (given that rs-ucan was originally derived from ts-ucan, and UCANs produced by both libraries tend to interoperate).

At any rate, fct was marked as optional in v0.8.0 of the spec..

And, prf is optional as of v0.9.0 of the spec.

We should make these fields optional so that rs-ucan is more gracious when it comes to accepting inputs, especially from other implementations.

cdata commented 1 year ago

@jsantell reference in UCAN IPLD for canonicalization topics: https://github.com/ucan-wg/ucan-ipld/#3-jwt-canonicalization

All unused optional fields (such as fct) that are empty MUST be omitted