OAK-11498: Expose Session-bound principals via JackrabbitSession
Commit-Check ❌
Commit rejected by Commit-Check.
(c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c)
/ ._. \ / ._. \ / ._. \ / ._. \ / ._. \
__\( C )/__ __\( H )/__ __\( E )/__ __\( C )/__ __\( K )/__
(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)
|| E || || R || || R || || O || || R ||
_.' '-' '._ _.' '-' '._ _.' '-' '._ _.' '-' '._ _.' '-' '._
(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)
`-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´
Commit rejected.
Type message check failed => add tests
It doesn't match regex: ^OAK-\d+:?\s\S+.*
The commit message must start with 'OAK-<ID>[:] ' followed by some descriptive text
Suggest: Please check your commit message whether it matches above regex
I am gonna merge end of this week, if there is no other feedback.
@anchela - how would a default implementation help? (FWIW, I'd like to understand as well how we would implement this in Jackrabbit Classic).
as i said before the fact that principals can be exposed on the jackrabbit API is very much an implementation detail of oak and i am not really convinced that this should be exposed in jackrabbit API.
We do have several principal related API classes already in https://github.com/apache/jackrabbit-oak/tree/trunk/oak-jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/principal. As JCR 2.0 spec relies on principals for access control (https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/16_Access_Control_Management.html#16.5.1%20Access%20Control%20Entries) it is natural that somehow you have it bound to a session as each impl would need to somehow compute those to check for access.
For JR2 I think the subject.getPrincipals (https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java#L384) should work in general. Maybe with some additional logic to get transitive group memberships like in https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java#L682C30-L682C43.
@anchela - I do not understand how having a default impl would avoid bumping up the package version - or did you have something else in mind?
@kwin - that said, would it be possible to have a meaningful default impl?
I don't think a default impl in the JR-API module without additional dependencies would work, rather one impl for Oak and one for JR2.
Having a default implementation which just throws an exception is actually worse than requiring any provider. to come up with a reasonable impl. Otherwise semantic versioning becomes useless
@kwin , i was not thinking about an impl that throws but one that leverages public API. i will work with @Amoratinos to get this unblocked.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
89.3% Coverage on New Code
0.0% Duplication on New Code
@anchela I am gonna merge beginning of next week if I don't receive any further comments here.