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!: Update voucher API #163

Closed
wants to merge 9 commits into from
Closed

feat!: Update voucher API #163

wants to merge 9 commits into from

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Nov 12, 2022

Overview

Originally voucher spec used:

  1. nb.of (named nb.product here) to identify a product.
  2. nb.at (named nb.service here) to identify a provider service of the product.
  3. with field in voucher/redeem was basically web3.storage did so it could self-issued.

With this change we simplify things by:

  1. Identifying products via did:key
  2. Requiring that vouche/redeem used product DID in the with field, which in turn implies product owner should delegate capability to the validator.

Background

I realized that we could simply identify products via did:key, which in turns remove need for both nb.of and nb.at fields. Not only it simplifies things it also means that any one could create a product (not just us but also our users) and likewise anyone could install any product as long as product owner delegated that capability by whatever means.

  • Of course we may not do anything if some account installs some product we're not aware of, but that is ok it's like upload/list we just need to save products in the list product list and only change account settings based on products we're aware of.
  • In the future we may also create ability to publishing products, e.g PL could create "pl-tier" product which basically would provide accounts with some space while billing "pl-tier" owner.

⚠️ Please note that this branch targets #159 because it fixed bunch of problems which I did not want to deal once again. Once #159 lands I'll change target to main branch

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 12, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e25205a
Status: ✅  Deploy successful!
Preview URL: https://13dfe1b1.ucan-protocol.pages.dev
Branch Preview URL: https://feat-voucher-v2.ucan-protocol.pages.dev

View logs

@Gozala Gozala temporarily deployed to dev November 12, 2022 08:25 Inactive
@Gozala
Copy link
Contributor Author

Gozala commented Nov 12, 2022

I'm also starting to think that maybe we don't need voucher/redeem but instead it should be something like product/install

// provider DID.
const products = new Map([
[
ctx.signer.did(),
Copy link
Member

Choose a reason for hiding this comment

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

Should we create a separate DID for this? This is the DID of the service no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In practice I think we should have DID per product, that said I was not sure what the best way to thread that through, so I thought this was reasonable compromise to get at least discussion started.

Base automatically changed from feat/cap-docs to main November 15, 2022 22:48
@Gozala Gozala force-pushed the main branch 2 times, most recently from 900c28e to 6496773 Compare November 15, 2022 23:20
@Gozala Gozala changed the title Update voucher API feat!: Update voucher API Nov 17, 2022
@Gozala
Copy link
Contributor Author

Gozala commented Nov 17, 2022

After thinking about treading through delegations from voucher -> service I've realized there are bunch of complications:

  1. If we rotate service key we need to coordinate all voucher delegations
  2. For tests we we'll need to somehow have another set of delegations (because DID in test is different)

Since #182 will basically address all the above, I'm going to pause it for now and resume it afterwards

@Gozala Gozala closed this Mar 3, 2023
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-uploader-v2.1.2...solid-uploader-v3.0.0)
(2022-12-15)


### ⚠ BREAKING CHANGES

* core and framework components have changed considerably. Please read
the updated doucmentation.

### Features

* consume access and upload client
([storacha#159](storacha/w3ui#159))
([e36d842](storacha/w3ui@e36d842))

---
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>
Peeja pushed a commit to storacha/upload-service that referenced this pull request Jan 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](storacha/w3ui@solid-uploader-v2.1.2...solid-uploader-v3.0.0)
(2022-12-15)


### ⚠ BREAKING CHANGES

* core and framework components have changed considerably. Please read
the updated doucmentation.

### Features

* consume access and upload client
([storacha#159](storacha/w3ui#159))
([dc086fd](storacha/w3ui@dc086fd))

---
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>
fforbeck pushed a commit to storacha/upload-service that referenced this pull request Feb 5, 2025
it turns out Stripe already adds the `checkout.session` query param to
this URL - this means we don't even need to update Stripe to fix this!
fforbeck pushed a commit to storacha/upload-service that referenced this pull request Feb 5, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.16.1](storacha/console@w3console-v1.16.0...w3console-v1.16.1)
(2024-12-12)


### Bug Fixes

* make it possible to skip the plan gate after Stripe checkout
([storacha#162](storacha/console#162))
([b399b37](storacha/console@b399b37))
* tweak plan gate query param
([storacha#163](storacha/console#163))
([0ce071e](storacha/console@0ce071e))


### Other Changes

* update copy ([storacha#159](storacha/console#159))
([0253b05](storacha/console@0253b05))

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