-
Notifications
You must be signed in to change notification settings - Fork 22
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!: content serve authorization #1590
base: main
Are you sure you want to change the base?
Conversation
b98e723
to
5d8ba9b
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.
9984a07
to
7a395a9
Compare
e0fb6fb
to
d533b7a
Compare
d533b7a
to
5f414b0
Compare
@@ -13,13 +13,15 @@ export const provide = (ctx) => | |||
|
|||
/** | |||
* Checks if the given Principal is an Account. | |||
* |
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.
fixed lint issue
* @param {API.Principal} principal | ||
* @returns {principal is API.Principal<API.DID<'mailto'>>} | ||
*/ | ||
const isAccount = (principal) => principal.did().startsWith('did:mailto:') | ||
|
||
/** | ||
* Returns true when the delegation has a `ucan:*` capability. | ||
* |
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.
fixed lint issue
* @param {Agent<S>} agent | ||
* @param {Types.Invocation} invocation |
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.
fixed lint issue
Context
To enable a gateway to serve content from a specific space, we must ensure that the space owner delegates the
space/content/serve/*
capability to the Gateway. This delegation allows the Gateway to serve content and log egress events appropriately.I created a new function
authorizeContentServe
for this implementation and included it in thecreateSpace
flow. This is a breaking change because now the user is forced to provide the DIDs of the Content Serve services, and the connection, or skip the authorization flow.Additionally, with the
authorizeContentServe
function, we can implement a feature in the Console App that enables users to explicitly authorize the Freeway Gateway to serve content from existing/legacy spaces.Main Changes
authorizeContentServe
, in thew3up-client
module to facilitate the delegation process. Integrated it with thecreatedSpace
flow.Issue: #158