You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flowchart TD
subgraph Client Side
A[User] -->|Creates Space & Authorizes Gateway| B[w3up-client]
end
subgraph Cloudflare Workers
C[Access/Delegate Endpoint]
F[Freeway Worker]
end
subgraph KV Storage
D[Delegations Store]
end
B -->|UCAN: access/delegate| C
C -->|Validates Space & Proof Chain| E[Validate Space Exists & Capability]
E -->|Stores Valid Delegation| D
F -->|Retrieves Delegation| D[Delegations Store]
Loading
Explanation
User Interaction: The user interacts with the w3up-client to create a space and authorize the gateway to serve content.
UCAN Invocation: The w3up-client invokes the access/delegate UCAN handler, providing the delegation details ({ space, proofs }). The request is sent to the Cloudflare Access/Delegate Endpoint.
Validation Steps:
The endpoint checks whether the space referenced in the delegation has been provisioned.
It validates that the delegation matches the expected capability (space/content/serve/*).
It ensures the proof chain is valid.
Relevance Check: Only delegations associated with a provisioned space are accepted to prevent unnecessary resource usage and mitigate the risk of DoS attacks.
Storing Delegation: After successful validation, the delegation is stored in the KV Store (Delegations Store) for further use.
Freeway Worker Retrieval: The Freeway Worker retrieves the validated delegations from the KV Store to serve content for authorized spaces.
Key Considerations
Mitigating DoS Attacks: By verifying that the space is provisioned before accepting the delegation, we can reduce the risk of abuse from unauthorized or irrelevant requests.
Efficiency: This additional validation ensures only relevant delegations are processed and stored, minimizing resource waste.
Implementation: Adding a check against the space provisioning status in the Access/Delegate Endpoint can be done efficiently by querying the space registry or relevant provisioning database. I will probably tackle that in a second iteration.
The text was updated successfully, but these errors were encountered:
fforbeck
changed the title
(Felipe) Update the w3up-client to save the new delegation in the Delegations Store
Update the w3up-client to save the new delegation in the Delegations Store
Nov 27, 2024
fforbeck
changed the title
Update the w3up-client to save the new delegation in the Delegations Store
Update the w3up-client to send a UCAN request to save the delegation in Cloudflare
Nov 27, 2024
Gateway Authorization Flow
Explanation
User Interaction: The user interacts with the
w3up-client
to create a space and authorize the gateway to serve content.UCAN Invocation: The
w3up-client
invokes theaccess/delegate
UCAN handler, providing the delegation details ({ space, proofs }
). The request is sent to the CloudflareAccess/Delegate Endpoint
.Validation Steps:
space/content/serve/*
).Relevance Check: Only delegations associated with a provisioned space are accepted to prevent unnecessary resource usage and mitigate the risk of DoS attacks.
Storing Delegation: After successful validation, the delegation is stored in the KV Store (
Delegations Store
) for further use.Freeway Worker Retrieval: The Freeway Worker retrieves the validated delegations from the KV Store to serve content for authorized spaces.
Key Considerations
Access/Delegate Endpoint
can be done efficiently by querying the space registry or relevant provisioning database. I will probably tackle that in a second iteration.The text was updated successfully, but these errors were encountered: