-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Initial work refactoring noosphere-gateway to be generic over the spheres it manages. #698
Conversation
6a50daf
to
b599a96
Compare
Updates:
|
Rebased on #685 |
Test flake analysis
Flake summary for
|
rebased |
IIUC what you wrote here correctly:
This is actually a lot more expensive for the DID route, which currently is an unauthorized route that just response with a string:
Note that accessing a |
Can you speak a little bit about what this is building towards? Have you chosen a serverless function stack? |
Step 1 is to genericize sphere context access in the gateway to share functionality between single-sphere gateways and a multi-tenant one, using the high-level Step 2 involves more long term abstraction over how we want to extend the gateway. Using the high level No opinions on serverless function stacks; the multi tenant gateway is designed to run as several instances operating over common data. Could become serverless functions if needed. Does not seem immediately relevant to spinning up multi-tenant gateways
We can add a more lightweight function in |
It's relevant insofar as we are writing |
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.
This is a good first pass. I think some aspects need a bit of thought, but I'm excited about the direction it's going in.
a57d8ec
to
3119127
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.
Tentatively this looks like a candidate for merge, but let's talk F2F about some of my last comments!
95313a0
to
40ece80
Compare
spheres it manages. * Reconfigure setting up the gateway as a [Gateway] struct. * Introduce [GatewayManager] to manage sphere context access and customization (e.g. counterpart extraction), functioning as the shared state throughout [axum]. * Introduce [SingleTenantGatewayManager] that implements [GatewayManager] for usage in orb. * Isolate extractors.
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.
Great work on this!
trait ContextManager
is provided to the gateway to access managed spheres' contexts.SingleSphereContextManager
implementation for existingorb
gateway and tests.X-SPHERE-IDENTITY
header to specify the target sphere. Corresponding UCAN auth could apply to many spheres.GatewayAuthority
synthesized for authenticated routes, there's nowGatewaySphereContext
which provides access to the targeted gateway sphere.X-SPHERE-IDENTITY
andUCAN
headers into a proof chain. Note using theheaders
module, it should be the same version asaxum
in servers.cargo test --features test-kubo,helpers
passing locally