Skip to content

Commit d50efab

Browse files
committed
OAK-11409: Fixed security-spi package version
1 parent 0e6ac4d commit d50efab

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConfiguration.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
2222
import org.apache.jackrabbit.oak.spi.security.SecurityConfiguration;
2323
import org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider;
24+
import org.apache.jackrabbit.oak.spi.security.user.cache.CacheConstants;
2425
import org.apache.jackrabbit.oak.spi.security.user.cache.CachePrincipalFactory;
2526
import org.apache.jackrabbit.oak.spi.security.user.cache.CachedMembershipReader;
2627
import org.jetbrains.annotations.NotNull;
@@ -67,6 +68,26 @@ public interface UserConfiguration extends SecurityConfiguration {
6768
PrincipalProvider getUserPrincipalProvider(@NotNull Root root, @NotNull NamePathMapper namePathMapper);
6869

6970

71+
/**
72+
* Optional method that allows a given user management implementation to
73+
* provide a specific and optimized implementation of the {@link CachedMembershipReader}
74+
* interface for the principals represented by the user/groups known to
75+
* this implementation.
76+
*
77+
* If this method returns {@code null} the security setup won't, by default, use
78+
* a cached membership reader.
79+
*
80+
* @param root The root used to read the principal information from.
81+
* @param cachePrincipalFactory The factory to create the principal from the cache.
82+
* @param propName The name of the property that contains the cache.
83+
* @return An implementation of {@code CachedMembershipReader} or {@code null} if the UserConfiguration implementation
84+
* does not provide a cached membership reader.
85+
*/
86+
@Nullable
87+
default CachedMembershipReader getCachedMembershipReader(@NotNull Root root, @NotNull CachePrincipalFactory cachePrincipalFactory, @NotNull String propName) {
88+
return getCachedMembershipReader(root, cachePrincipalFactory, propName, CacheConstants.REP_EXPIRATION);
89+
}
90+
7091
/**
7192
* Optional method that allows a given user management implementation to
7293
* provide a specific and optimized implementation of the {@link CachedMembershipReader}

oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/user/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
@Version("2.8.0")
17+
@Version("2.9.0")
1818
package org.apache.jackrabbit.oak.spi.security.user;
1919

2020
import org.osgi.annotation.versioning.Version;

0 commit comments

Comments
 (0)