-
Notifications
You must be signed in to change notification settings - Fork 5
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: ucan invocation handler #133
Conversation
7a55163
to
3288275
Compare
535e099
to
11e5f01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: as a follow up you'll need to update reads
and w3link
to proxy POST /
.
d1a1eec
to
006da33
Compare
Sounds good! The PR is ready for another review, @alanshaw . |
25b9df4
to
36a99a0
Compare
36a99a0
to
38f0047
Compare
8ecc001
to
d67fb4a
Compare
Most of the critical changes were implemented. Waiting for final review.
@Peeja, I will merge this without the |
046b70e
to
7e84090
Compare
7e84090
to
1b44871
Compare
1b44871
to
b6aa238
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for being slow to get back on this, it looks great!
🤖 I have created a release *beep* *boop* --- ## [2.22.0](v2.21.0...v2.22.0) (2024-12-19) ### Features * egress client - ucanto integration ([#123](#123)) ([22bed68](22bed68)) * enable egress tracking in production env ([#135](#135)) ([ad43b62](ad43b62)) * **indexer:** probabilistic feature flag ([#136](#136)) ([dca2b35](dca2b35)) * ucan invocation handler ([#133](#133)) ([b199bfa](b199bfa)) * Use Indexing Service when feature flag is present ([#132](#132)) ([fa3f480](fa3f480)) ### Bug Fixes * **config:** staging kv bidding ([#134](#134)) ([7a523d5](7a523d5)) * **egress-client:** set nonce, expire and fix servedAt ([#130](#130)) ([b135643](b135643)) * enable open telemetry for all envs ([#131](#131)) ([c822465](c822465)) --- 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>
Context
To enable the gateway to serve content from a specific space, the space owner must delegate the
space/content/serve/*
capability to the Gateway. This delegation ensures the Gateway has the authority to serve the content and log egress events accurately.This PR introduces a new handler to process POST requests to the server's root path. The handler acts as a UCAN Invocation handler, processing
access/delegate
invocations and extracting relevant delegation proofs. If a delegation proof is valid, it is stored in Cloudflare KV, allowing other handlers to retrieve and verify the proof to determine whether content should be served and egress logged.Note: It doesn't cover the token verification.
Main Changes
New Functionality
withUcanInvocationHandler.js
to processaccess/delegate
invocations:content serve
delegations.FF_DELEGATIONS_STORAGE_ENABLED
if enabled, the newwithDelegationsStorage.js
handler will be used to find delegations in KV, and the existingwithDelegationsStubs.js
will be disabled.Related Issues
space/content/serve
Spaces by default project-tracking#158space/content/serve/*
delegations project-tracking#160