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!: Custom 'now' for proof chain validation #83

Merged
merged 1 commit into from
May 4, 2023

Conversation

cdata
Copy link
Member

@cdata cdata commented May 3, 2023

This breaking change introduces an extra field when validating UCANs, on related implementation for both Ucan and ProofChain . This field lets us set the time to use when validating the UCAN with respect to its lifetime.

This is desired so that we can validate an old/probably-expired UCAN to check that an effect was allowed at the time that it occurred.

Fixes #82

@cdata cdata requested a review from a team as a code owner May 3, 2023 00:19
@codecov-commenter
Copy link

Codecov Report

Merging #83 (0cd4464) into main (77ec26d) will increase coverage by 1.57%.
The diff coverage is 75.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   55.77%   57.34%   +1.57%     
==========================================
  Files          23       23              
  Lines         762      776      +14     
  Branches      191      188       -3     
==========================================
+ Hits          425      445      +20     
+ Misses        204      202       -2     
+ Partials      133      129       -4     
Impacted Files Coverage Δ
ucan/src/chain.rs 63.10% <66.66%> (+2.89%) ⬆️
ucan/src/ucan.rs 69.47% <88.88%> (+4.63%) ⬆️

... and 3 files with indirect coverage changes

@matheus23
Copy link
Member

I actually realize it may be helpful to have a lower-level API that gives you an interval for when certain capabilities were valid.
A small layer around that API may then cross-check that value against now() or some other timestamp.
But it's useful to have that intermediate layer to be able to say e.g. "evict this UCAN from the cache at timestamp X" or have a UI that indicates "You'll have access for two more days".

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.

Custom "now time" when validating UCANs
3 participants