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: define access/claim in @web3-storage/capabilities #409

Merged
merged 9 commits into from
Feb 1, 2023

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Jan 31, 2023

Motivation:

Unblocks:

@gobengo gobengo changed the title define access/claim in @web3-storage/capabilities feat: define access/claim in @web3-storage/capabilities Jan 31, 2023
@gobengo gobengo marked this pull request as ready for review January 31, 2023 02:05
@gobengo gobengo requested review from hugomrdias and Gozala January 31, 2023 02:05
await example({ issuer: bob })
}
})
})
Copy link
Contributor

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:

  1. That wrong claims fail validation when with is mismatched.
  2. Since you only support did:key and did:mailto validate that those resources are ok, but other DIDs are not.

Copy link
Contributor Author

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:

Copy link
Contributor

@Gozala Gozala left a 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.

@gobengo gobengo force-pushed the 1675129847-define-access-claim-cap branch from bf99e64 to e6b6963 Compare January 31, 2023 22:14
@gobengo
Copy link
Contributor Author

gobengo commented Jan 31, 2023

update

@gobengo gobengo requested a review from Gozala January 31, 2023 23:42
@@ -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'
Copy link
Contributor Author

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

@gobengo gobengo merged commit 4d72ba3 into main Feb 1, 2023
@gobengo gobengo deleted the 1675129847-define-access-claim-cap branch February 1, 2023 18:24
travis pushed a commit that referenced this pull request Feb 10, 2023
🤖 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).
gobengo added a commit that referenced this pull request Apr 11, 2023
Motivation:
* #408

Unblocks:
* people importing a canonical CapabilityParser for `access/claim`
* adding advanced tests e.g. by [reverting this and finishing the
TODOs](fd0b56f)
* these involve `can=./update` abilities, so may make most sense to add
after #392 which defines
tools for them
gobengo pushed a commit that referenced this pull request Apr 11, 2023
🤖 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).
Peeja pushed a commit to storacha/upload-service that referenced this pull request Jan 17, 2025
🤖 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]>
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