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(w3up-client): add default gateway authorization #1604

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

fforbeck
Copy link
Member

@fforbeck fforbeck commented Dec 13, 2024

Context

While updating the web3-storage docs, w3cli, and @storacha/client, I found it inconvenient to repeatedly define the gateway DID and URL every time I created a space. Also, if we don't provide the skipGatewayAuthorization=true, it will throw an error saying it is required to provide the gateway services to authorize.

Changes

Following @travis suggestion (see: storacha/docs#21 (comment)), I've updated the client to automatically authorize the Storacha Gateway (Production) by default if skipGatewayAuthorization is not set to true and authorizeGatewayServices is not provided or is empty.

Once approved, this change will need to be ported to upload-service/w3up-client.

And the PR storacha/freeway#135 needs to be merged before this change gets released.

@fforbeck fforbeck requested review from travis and alanshaw December 13, 2024 15:42
@fforbeck fforbeck self-assigned this Dec 13, 2024
Copy link
Member

@travis travis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question about this new DX and a suggestion that may or may not make sense!

packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
@fforbeck fforbeck force-pushed the feat/default-gateway-auth branch from 870af09 to 1a4a913 Compare December 16, 2024 16:10
@fforbeck fforbeck merged commit e669b55 into main Dec 19, 2024
5 checks passed
@fforbeck fforbeck deleted the feat/default-gateway-auth branch December 19, 2024 14:29
fforbeck added a commit to storacha/upload-service that referenced this pull request Dec 19, 2024
…ay (#99)

To enable a gateway to serve content from a specific space, we must
ensure that the space owner delegates the `space/content/serve/*`
capability to the Gateway. This delegation allows the Gateway to serve
content and log egress events appropriately.

I created a new function `authorizeContentServe` for this implementation
and included it in the `createSpace` flow. This is a breaking change
because now the user is forced to provide the DIDs of the Content Serve
services, and the connection, or skip the authorization flow.

Additionally, with the `authorizeContentServe` function, we can
implement a feature in the Console App that enables users to explicitly
authorize the Freeway Gateway to serve content from existing/legacy
spaces.

- **New Functionality:** 
- Added a new function, `authorizeContentServe`, in the `w3up-client`
module to facilitate the delegation process. Integrated it with the
`createdSpace` flow.
- It also sets the Storacha Gateway as the default content server
service in case the user doesn't provide any in the `createSpace` call,
and doesn't use the `skipGatewayAuthorization=true` flag.
- **Testing:** Introduced test cases to verify the authorization of
specified gateways.
- **Fixes:** Resolved issues with previously broken test cases (Egress
Record).

### Related Issues
- storacha/project-tracking#158
- storacha/project-tracking#160
- storacha/project-tracking#207
- storacha#1604
- Resolves storacha/project-tracking#196
fforbeck pushed a commit that referenced this pull request Dec 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[17.1.0](w3up-client-v17.0.0...w3up-client-v17.1.0)
(2024-12-19)


### Features

* **w3up-client:** add default gateway authorization
([#1604](#1604))
([e669b55](e669b55))


### Other Changes

* **capabilities:** top level filecoin cap
([#1606](#1606))
([22d0bf9](22d0bf9))

---
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>
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