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: added script to generate ucan for w3up space and docs for how to access the space using console.web3.storage #2554

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Apr 2, 2024

Context

  • nft storage can now upload things to w3up spaces using w3up-client
  • i wanted to be able to visualize the things that were being added now that we have that running a bit on staging.nft.storage
  • console.web3.storage is good for visualizing w3up spaces
  • but it isn't trivial to authorize a console.web3.storage session to be able to access the space, so I wanted to figure it out and document it for others

What?

  • this adds a command to the nft.storage api cli script that prompts the user for some stuff that is in our configuration secrets vault, asks for a DID of their console.web3.storage session, then builds a UCAN delegation authorizing their console.web3.storage session to access the space and saves it as a CAR file. The UCAN CAR file can then be imported at https://console.web3.storage/space/import to access the space.
  • adds docs to README

How to Test

Copy link

Deploying nft-storage with  Cloudflare Pages  Cloudflare Pages

Latest commit: 186f068
Status: ✅  Deploy successful!
Preview URL: https://c3395678.nft-storage-1at.pages.dev
Branch Preview URL: https://w3up-console-ucan-script.nft-storage-1at.pages.dev

View logs

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5d94ec5) to head (ddc3dda).
Report is 5 commits behind head on main.

❗ Current head ddc3dda differs from pull request most recent head 186f068. Consider uploading reports for the commit 186f068 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2554   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines         1324      1324           
=========================================
  Hits          1324      1324           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gobengo gobengo marked this pull request as ready for review April 2, 2024 23:52
@gobengo gobengo requested review from travis and Gozala April 2, 2024 23:52
Copy link
Contributor

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

I hemmed and hawwed a bit but you can safely ignore - this is fantastic!


The credentials used in staging/production are in the usual vault of secrets under 'w3up credentials'.

Run the cli command `w3up console ucan generate`
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe better to use the yarn command?

Suggested change
Run the cli command `w3up console ucan generate`
Run the cli command `yarn w3up:console:ucan:generate`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by 'the cli command' I meant 'arguments passed to the ./scripts/cli.js I found'. So I think the way I wrote it was ambiguous and probably should change, but not necessarily to one that mentions yarn.

```shell
(
cd packages/api
node scripts/cli.js w3up console ucan generate
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh lol but I just noticed this - also seems fine. Since this README is already in the packages/api directory it feels a little weird to have that here BUT it's unambiguous, where omitting it wouldn't be. Overall I think you could go either way, so maybe just ignore this and the previous comment ;-p

@gobengo gobengo merged commit ad33faf into main Apr 3, 2024
23 checks passed
@gobengo gobengo deleted the w3up-console-ucan-script branch April 3, 2024 22:41
travis pushed a commit that referenced this pull request Apr 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.6.0](api-v4.5.0...api-v4.6.0)
(2024-04-04)


### Features

* added script to generate ucan for w3up space and docs for how to
access the space using console.web3.storage
([#2554](#2554))
([ad33faf](ad33faf))
* lock w3up uploads feature switch open
([#2556](#2556))
([6eeefeb](6eeefeb))

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

None yet

3 participants