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

fix: access-api ctx.signer no longer uses env.DID. instead env.DID is only used for ucanto server id #303

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

@gobengo gobengo requested a review from Gozala December 13, 2022 20:57
@gobengo gobengo temporarily deployed to dev December 13, 2022 21:00 — with GitHub Actions Inactive
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.

Looks good to me! Mind also creating an issue to revert this after we propagate storacha/ucanto#168

@gobengo
Copy link
Contributor Author

gobengo commented Dec 13, 2022

ty @Gozala I made this issue #304

@gobengo gobengo merged commit 93d7003 into main Dec 13, 2022
@gobengo gobengo deleted the 1670962156-access-api-did-differently branch December 13, 2022 21:21
gobengo added a commit that referenced this pull request Dec 13, 2022
…ner prop (#305)

Motivation:
* `@web3-storage/access` cli expects to be able to fetch /version and
pull the `did` property in order to create the ucanto Verifier that is
used as the `aud` when signing ucans
*
https://github.com/web3-storage/w3protocol/blob/main/packages/access-client/src/cli/utils.js#L28
* before this change, that `did` property came from `ctx.signer`, which
will have a `did:key`.
* but since #303 , the
verifier used in the ucanto server for upload-api is actually different
than `ctx.signer.did()`. So this PR makes it so /version `did` property
actually comes from `ctx.config.ucantoServerId`
* it also adds a new key to that endpoint, `signer`, which is the public
key of the signer (which now can be different than the `DID` of the
ucanto server id). I added this just in case someone wants to use the
/version endpoint to know the undelrying signer pubkey
olizilla pushed a commit to storacha/w3infra that referenced this pull request Dec 14, 2022
…lient (#100)

Motivation:
* @alanshaw informed me via slack that upload-api signs invocations sent
to access-api. These signatures wouldn't be verifiable if their signer
did was a non-key-did.

What
* This PR makes it so the service signer for most of upload-api knows
nothing about `env.UPLOAD_API_DID`.
* `env.UPLOAD_API_DID` only is used for the Principal passed to the
ucanto server id (to verify incoming invocations 'aud')
* similar to this I did for w3protocol
storacha/w3up#303
* /version api response object has new property `aud`, which is the
expected `aud` value of any UCAN invocations sent to the ucanto server
(when env.UPLOAD_API_DID is set, it'll be that did)

Signed-off-by: Oli Evans <[email protected]>
alanshaw pushed a commit that referenced this pull request Dec 14, 2022
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](access-api-v4.0.0...access-api-v4.1.0)
(2022-12-14)


### Features

* access-api version route sets did=ucantoServerId and adds a signer
prop ([#305](#305))
([5eab262](5eab262))
* embedded key resolution
([#312](#312))
([4da91d5](4da91d5))
* include ucanto server principal did as 'aud' key in /version endpoint
([#309](#309))
([bf3b171](bf3b171))


### Bug Fixes

* access-api ctx.signer no longer uses env.DID. instead env.DID is only
used for ucanto server id
([#303](#303))
([93d7003](93d7003))
* access-api wrangler.toml sets DID env var in env.dev
([#297](#297))
([c4ca459](c4ca459))
* access-client/src/agent default PRINCIPAL is did:web:web3.storage
([#296](#296))
([27f2f60](27f2f60))
* add support for did:web in the cli
([#301](#301))
([885f7c1](885f7c1))
* fix client cli service did resolve
([#292](#292))
([6be9608](6be9608))
* use did:web key in root handler
([#311](#311))
([537dc48](537dc48))

---
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: Alan Shaw <[email protected]>
gobengo added a commit that referenced this pull request Apr 11, 2023
… only used for ucanto server id (#303)

Motivation:
* #302
gobengo added a commit that referenced this pull request Apr 11, 2023
…ner prop (#305)

Motivation:
* `@web3-storage/access` cli expects to be able to fetch /version and
pull the `did` property in order to create the ucanto Verifier that is
used as the `aud` when signing ucans
*
https://github.com/web3-storage/w3protocol/blob/main/packages/access-client/src/cli/utils.js#L28
* before this change, that `did` property came from `ctx.signer`, which
will have a `did:key`.
* but since #303 , the
verifier used in the ucanto server for upload-api is actually different
than `ctx.signer.did()`. So this PR makes it so /version `did` property
actually comes from `ctx.config.ucantoServerId`
* it also adds a new key to that endpoint, `signer`, which is the public
key of the signer (which now can be different than the `DID` of the
ucanto server id). I added this just in case someone wants to use the
/version endpoint to know the undelrying signer pubkey
gobengo pushed a commit that referenced this pull request Apr 11, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](access-api-v4.0.0...access-api-v4.1.0)
(2022-12-14)


### Features

* access-api version route sets did=ucantoServerId and adds a signer
prop ([#305](#305))
([7452839](7452839))
* embedded key resolution
([#312](#312))
([45f367d](45f367d))
* include ucanto server principal did as 'aud' key in /version endpoint
([#309](#309))
([45e19ca](45e19ca))


### Bug Fixes

* access-api ctx.signer no longer uses env.DID. instead env.DID is only
used for ucanto server id
([#303](#303))
([1155998](1155998))
* access-api wrangler.toml sets DID env var in env.dev
([#297](#297))
([7f4082f](7f4082f))
* access-client/src/agent default PRINCIPAL is did:web:web3.storage
([#296](#296))
([1dd7217](1dd7217))
* add support for did:web in the cli
([#301](#301))
([a1f9e85](a1f9e85))
* fix client cli service did resolve
([#292](#292))
([45e7ad4](45e7ad4))
* use did:web key in root handler
([#311](#311))
([d7bdade](d7bdade))

---
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: Alan Shaw <[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.

2 participants