-
Notifications
You must be signed in to change notification settings - Fork 22
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: define access/claim in @web3-storage/capabilities #409
Conversation
await example({ issuer: bob }) | ||
} | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is testing exactly that no error is thrown ? I would suggest covering more surface here, specifically to ensure:
- That wrong claims fail validation when
with
is mismatched. - Since you only support
did:key
anddid:mailto
validate that those resources are ok, but other DIDs are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you say this is a valid test for what you mean by #1?
For #2 I added:
- throws if try to create invocation using
Access.claim
using unexpectedwith
did method - 6556e21#diff-67e9cd2926c4b07ca092fa34e8015b5ed3ce81c5708473253964f5d7a0da0c4fR268 - does not authorize
access/claim
whosewith
is an unexpected did method a57ef04#diff-67e9cd2926c4b07ca092fa34e8015b5ed3ce81c5708473253964f5d7a0da0c4fR282
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but I think it would be better to add more tests and an access/delegate
capability before landing.
That said I'm fine landing this as is and doing rest as followups.
bf99e64
to
e6b6963
Compare
… unexpected did methods
…n issuer in proofs
update
|
@@ -3,6 +3,8 @@ import { access } from '@ucanto/validator' | |||
import { Verifier } from '@ucanto/principal/ed25519' | |||
import * as Access from '../../src/access.js' | |||
import { alice, bob, service, mallory } from '../helpers/fixtures.js' | |||
import * as Ucanto from '@ucanto/interface' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would have required a comment to disable tsc no-unused-vars, but it no longer does because of adding jsdoc/no-undefined-types rule
related to: https://github.com/web3-storage/w3protocol/pull/392/files#r1090596726
🤖 I have created a release *beep* *boop* --- ## [2.3.0](capabilities-v2.2.0...capabilities-v2.3.0) (2023-02-10) ### Features * add `pre` caveat to `store/list` and `upload/list` ([#423](#423)) ([a0f6d28](a0f6d28)) * add access/delegate capability parser exported from @web3-storage/capabilities ([#420](#420)) ([e8e2b1a](e8e2b1a)) * add support for access/authorize and update ([#392](#392)) ([9c8ca0b](9c8ca0b)), closes [#386](#386) * define access/claim in @web3-storage/capabilities ([#409](#409)) ([4d72ba3](4d72ba3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [2.3.0](capabilities-v2.2.0...capabilities-v2.3.0) (2023-02-10) ### Features * add `pre` caveat to `store/list` and `upload/list` ([#423](#423)) ([9cce414](9cce414)) * add access/delegate capability parser exported from @web3-storage/capabilities ([#420](#420)) ([7834cf2](7834cf2)) * add support for access/authorize and update ([#392](#392)) ([bf41071](bf41071)), closes [#386](#386) * define access/claim in @web3-storage/capabilities ([#409](#409)) ([2fb34dd](2fb34dd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [3.0.0](storacha/w3ui@solid-uploads-list-v2.0.2...solid-uploads-list-v3.0.0) (2023-03-23) ### ⚠ BREAKING CHANGES * use new account model ([storacha#400](storacha/w3ui#400)) ### Features * use new account model ([storacha#400](storacha/w3ui#400)) ([66dd20b](storacha/w3ui@66dd20b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Travis Vachon <[email protected]>
Motivation:
Unblocks:
access/claim
can=./update
abilities, so may make most sense to add after feat: add support for access/authorize and update #392 which defines tools for them