Repository navigation
Add acl support for IDP components - #968
Conversation
RubenVerborgh
left a comment
There was a problem hiding this comment.
The auth component of the LDP handler has been extracted to a separate handler. The LDP handler no longer exists and is now just a combination of an HTTP parsing handler and an authorization handler.
Woah! That was a big one, but the code makes a lot of sense.
This is also a consequence of Operation being used outside of an LDP context, as we've discussed in another issue.
Great work, great reuse between systems.
Minor nit: I'm not sure about the need for OperationHandler input. (I do like the parameter rename from input to operation in the individual handlers' code though.) Is that needed? Seems like operation handlers should only handle operations, and those operations thus should contain everything.
| private readonly errorHandler: ErrorHandler; | ||
| private readonly responseWriter: ResponseWriter; | ||
| private readonly operationMetadataCollector: OperationMetadataCollector; | ||
| private readonly source: OperationHttpHandler; |
There was a problem hiding this comment.
To what? I just the name source here to be similar to how we chain resource stores together (where we also use the source parameter for the nested entry).
There was a problem hiding this comment.
operationHandler, I think.
The |
Understood; that's a good argument indeed. |
This allows easier reuse of certain reoccurring behaviours, such as authorization. The AuthenticatedLdpHandler is no longer required since it is a combination of parsing and authorization. This did require a small change to the OperationHandler interface.
The initializer can now be used for any container. The initializer also does not handle the repeat check anymore, this is now configured with a ConditionalHandler.
84600f7 to
86ab493
Compare
|
PR should be finished now. Changes that happened:
|
RubenVerborgh
left a comment
There was a problem hiding this comment.
🎉
Let's not forget to update RELEASE_NOTES.md
| "allow": true | ||
| }, | ||
| { | ||
| "comment": "No auth resources are required if everything is allowed.", |
There was a problem hiding this comment.
I didn't fully understand that sentence in isolation.
Configuration has been updated so the IDP requests also pass through an Authorization component. A new config option was added to choose which authorization scheme to use for the IDP.
86ab493 to
e651908
Compare
Draft of potential solution for #924.
This solution works, but still requires integration tests, config cleanup, config documentation and nice commits. But I first wanted to ask for opinions on this before I put in the effort of doing all that.
This is the best solution I can see to have full acl support for the IDP components (specifically registration). We don't really need this though, we could also just have a simpler component where you hardcode a list of WebIDs in the config in a custom IDP permission reader.
How this works:
/idp/. This is required since we can't guarantee there is an acl at/. This is done by generalizing RootInitializer to ContainerInitializer.^/idp/.*\.acl$to the LDP handler. This routing is added before the IDP routing. This way acl requests use the normal LDP behaviour, even though their identifier starts with/idp/(which would otherwise be redirected to the IDP handler).The main "issue" that I see with this solution is that it requires a bit of complex configuration, and the user will have to make sure their
/idp/.aclis configured correctly so nobody else can break the IDP component. But I see this as a specific power user feature so that second part seems less of an issue.Mainly want to know if this should be finished or if we want to look into a simpler solution.