Repository navigation
Always give the pod owner control access - #938
Conversation
RubenVerborgh
left a comment
There was a problem hiding this comment.
2 and 4 are blockers for me.
But I think there's an even more fundamental problem: the ownership handler should be combined with the WebACL authorizer. So the ownership handler should add Control permissions for the pod owner, rather than only giving those permissions.
Right now, as an owner, I will never get read or write permissions, if I interpret this correctly.
So we either need ownership to be a wrapper, or all authorizers should take an object which they augment. (For instance, ownership could remove the need for "control" to be checked down the line, if it has already checked it.)
|
So we'll probably also need an integration test for this case. |
|
This might actually make the case for refactoring auth from pass/fail to returning the allowed modes instead. Then we could build a wrapping CombinedAuthenticationHandler (instead of waterfall) that adds allowed permissions together. Alternatively, can we implement owner access as rule, just like we've implemented groups? (but yeah, it's not WebACL-specific) |
To clarify 2: the headers are only going to be incorrect in the case the authorizer gets used, so specifically a control request done by the owner, all other requests are still going to have correct headers. But not perfect indeed. 4 can probably be resolved by storing an array of settings per WebID instead of a single object as is being done now, and then change the account store interface to return an array as wel instead. Would have to think about how to update preferences then but should be possible, just a bit more hassle perhaps.
You will because the
There might be something there.
There is one, I added a comment to indicate where.
We could do that. One advantage now is that no acl check happens in the case an owner requires control permissions, which removes that backend call, but that's a very specific case so not that relevant. One issue is that for the WAC-Allow headers we need to know both the permissions that are allowed for the current request AND also the permissions required for a public user. We can just return both of course, but that might make our implementation a bit more acl-specific again.
Yea not a fan of this because of reasons mentioned above. |
b32917b to
6a99f47
Compare
Right, I had not computed that indeed. They are currently mutually exclusive, my bad.
I think actually this is my preference; because it also makes Would you be okay with creating a new issue to refactor authorization to return allowed modes? |
abf8f59 to
38bb40a
Compare
|
I refactored this PR to be in line with the changes from #953. Going to look into points 2 and 4 mentioned above. Point 2 (having correct WAC-Allow headers) might already be fixed due to this refactor. The headers on non-acl resources are now going to completely match what is defined in relevant acl resource. The only thing missing is that owners will not see the This can be fixed, but that would mean that we would have to do a call to the account store for every incoming request. I specifically made it so this currently only happens for requests targeting acl resources since this is another call to the backend resource store. |
Sounds good to me. Will review current state now. |
| } | ||
| let settings: AccountSettings; | ||
| try { | ||
| settings = await this.accountStore.getSettings(credentials.agent.webId); |
There was a problem hiding this comment.
If too expensive (re: performance above), maybe we can consider a cache.
There was a problem hiding this comment.
It might be interesting to have some sort of cache for the key/value storages. Did we already have a discussion about this? Because I feel like we did. We would need events to update the caches then. Might even allow us to use an N3 store for the data and have events contain info which data to add/remove.
There was a problem hiding this comment.
Yeah we did indeed. But not a necessity then; we know we can.
38bb40a to
4a07f24
Compare
Account settings are stored using the WebID as key. Reason for using the WebID is that this allows faster access to the settings in authenticated requests. A consequence of this is that passwords are now always required during registration, and that there can only be 1 account per WebID.
4a07f24 to
83c0e0a
Compare
Closes #720
Depends on #936
Some issues with this solution, some of them caused by architecture that might have to change:
addMetadatafunction. We will probably need an extra abstraction layer here somewhere in the future, several of our authorization components are too tightly coupled with the WebACL behaviour. Our internal permissions are probably also too tightly coupled to acl permissions.