storacha-network / w3infra

🏗️ Infra for the w3up UCAN protocol implementation
Other
15 stars 5 forks source link

feat: HTTP to UCAN bridge #325

Closed travis closed 6 months ago

travis commented 7 months ago

To support users in languages that do not have existing UCAN invocation implementations, we are going to launch a bridge that allows them to make simple HTTP requests with JSON bodies that we transform into proper UCAN invocations.

This follows the specification here: https://github.com/web3-storage/specs/pull/112

Values for authorization headers can be generated using the bridge generate-tokens w3cli command proposed here:

https://github.com/web3-storage/w3cli/pull/175

gobengo commented 7 months ago

The proof field of the JSON body is a base64pad encoded

Originally I read this as meaning it was base64 encoded with padding. https://datatracker.ietf.org/doc/html/rfc4648#section-4

It could be good to clarify you mean it is multibase encoded using the multibase encoding for base64+padding. https://www.ietf.org/archive/id/draft-multiformats-multibase-07.html#name-base-64-with-padding-and-mi

travis commented 7 months ago

❤️ love it - thanks for pushing this!

<3

Worth mentioning what you're doing is web3-storage/RFC#1 (comment)

Yes! Though there's a pretty big difference in the authorization - I'm not "passing UCAN delegation as JWT bearer token" because of the 8KB limit I mention in the thread with Ben above, instead passing the secret there and embedding the delegation in the JSON body.

Can you please define response format?

Yep definitely - added a TODO!

seed-deploy[bot] commented 7 months ago
View stack outputs - **pr325-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr325-w3infra-customer spaceDiffTableName | pr325-w3infra-space-diff spaceSnapshotTableName | pr325-w3infra-space-snapshot usageTable | pr325-w3infra-usage - **pr325-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://e6wwgkzr0b.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://u7iiarclptsoadprdahaif6jjy0bklbh.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr325.billing.web3.storage - **pr325-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr325-0 Region | us-east-2 - **pr325-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://nvfaon4i3l.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr325.roundabout.web3.storage - **pr325-w3infra-SatnavStack** Name | Value -- | -- BucketName | satnav-pr325-0 Region | us-east-2 - **pr325-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoint | https://7y7yqu7fj4.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr325.up.web3.storage - **pr325-w3infra-BusStack** - **pr325-w3infra-FilecoinStack** - **pr325-w3infra-ReplicatorStack** - **pr325-w3infra-UcanFirehoseStack** - **pr325-w3infra-UcanInvocationStack** - **pr325-w3infra-UploadDbStack**