Skip to content

Commit 6c4d741

Browse files
committed
Merge branch 'trunk' into OAK-11300
2 parents d179c36 + 28e5c03 commit 6c4d741

File tree

509 files changed

+3672
-3363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

509 files changed

+3672
-3363
lines changed

.commit-check.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
# format as outlined in https://github.com/commit-check/commit-check/blob/main/.commit-check.yml
217
# further information in https://github.com/commit-check/commit-check/blob/main/README.rst
318
checks:
419
- check: message
5-
regex: '^OAK-\d+\s\S+.*'
6-
error: "The commit message must start with 'OAK-<ID> ' followed by some descriptive text"
20+
regex: '^OAK-\d+:?\s\S+.*'
21+
error: "The commit message must start with 'OAK-<ID>[:] ' followed by some descriptive text"
722
suggest: Please check your commit message whether it matches above regex
823

924
- check: author_name

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ~ Licensed to the Apache Software Foundation (ASF) under one
1+
# ~ Licensed to the Apache Software Foundation (ASF) under one
22
# ~ or more contributor license agreements. See the NOTICE file
33
# ~ distributed with this work for additional information
44
# ~ regarding copyright ownership. The ASF licenses this file
@@ -37,7 +37,7 @@ jobs:
3737
cache: maven
3838
- name: Build
3939
# executing ITs requires installing artifacts to the local repository
40-
run: mvn -B install -Pcoverage -PintegrationTesting -Dnsfixtures=SEGMENT_TAR,DOCUMENT_NS
40+
run: mvn -B install -Pcoverage,integrationTesting,javadoc -Dnsfixtures=SEGMENT_TAR,DOCUMENT_NS
4141
- name: Upload build result
4242
uses: actions/upload-artifact@v4
4343
with:

.github/workflows/commit-check.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# ~ Licensed to the Apache Software Foundation (ASF) under one
2+
# ~ or more contributor license agreements. See the NOTICE file
3+
# ~ distributed with this work for additional information
4+
# ~ regarding copyright ownership. The ASF licenses this file
5+
# ~ to you under the Apache License, Version 2.0 (the
6+
# ~ "License"); you may not use this file except in compliance
7+
# ~ with the License. You may obtain a copy of the License at
8+
# ~
9+
# ~ http://www.apache.org/licenses/LICENSE-2.0
10+
# ~
11+
# ~ Unless required by applicable law or agreed to in writing,
12+
# ~ software distributed under the License is distributed on an
13+
# ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# ~ KIND, either express or implied. See the License for the
15+
# ~ specific language governing permissions and limitations
16+
# ~ under the License.
17+
118
name: Commit Check
219

320
on:

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ~ Licensed to the Apache Software Foundation (ASF) under one
1+
# ~ Licensed to the Apache Software Foundation (ASF) under one
22
# ~ or more contributor license agreements. See the NOTICE file
33
# ~ distributed with this work for additional information
44
# ~ regarding copyright ownership. The ASF licenses this file

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def buildModule(moduleSpec) {
6363
// clean all modules
6464
sh "${MAVEN_CMD} -T 1C clean"
6565
// build and install up to desired module
66-
sh "${MAVEN_CMD} -Dbaseline.skip=true -Prat -T 1C install -DskipTests -pl :${moduleName} -am"
66+
sh "${MAVEN_CMD} -Dbaseline.skip=true -T 1C install -DskipTests -pl :${moduleName} -am"
6767
try {
6868
sh "${MAVEN_CMD} ${testOptions} -DtrimStackTrace=false -Dnsfixtures=SEGMENT_TAR,DOCUMENT_NS -Dmongo.db=MongoMKDB-${MONGODB_SUFFIX} clean verify -pl :${moduleName}"
6969
} finally {

oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/basic/DefaultSyncConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
import java.util.Collections;
2020
import java.util.HashSet;
2121
import java.util.Map;
22+
import java.util.Objects;
2223
import java.util.Set;
24+
import java.util.stream.Collectors;
25+
import java.util.stream.Stream;
2326

24-
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
2527
import org.jetbrains.annotations.NotNull;
2628

2729
/**
@@ -203,9 +205,7 @@ public Authorizable setAutoMembershipConfig(@NotNull AutoMembershipConfig autoMe
203205
*/
204206
@NotNull
205207
public Set<String> getAutoMembership(@NotNull org.apache.jackrabbit.api.security.user.Authorizable authorizable) {
206-
return ImmutableSet.<String>builder().
207-
addAll(autoMembershipConfig.getAutoMembership(authorizable)).
208-
addAll(getAutoMembership()).build();
208+
return Stream.concat(autoMembershipConfig.getAutoMembership(authorizable).stream().filter(Objects::nonNull), getAutoMembership().stream().filter(Objects::nonNull)).collect(Collectors.toUnmodifiableSet());
209209
}
210210

211211
/**

oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/jmx/Delegatee.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.jackrabbit.oak.api.ContentRepository;
2424
import org.apache.jackrabbit.oak.api.ContentSession;
2525
import org.apache.jackrabbit.oak.api.Root;
26+
import org.apache.jackrabbit.oak.commons.jdkcompat.Java23Subject;
2627
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
2728
import org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl;
2829
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
@@ -46,7 +47,6 @@
4647
import org.slf4j.LoggerFactory;
4748

4849
import javax.jcr.RepositoryException;
49-
import javax.security.auth.Subject;
5050
import java.io.IOException;
5151
import java.security.PrivilegedActionException;
5252
import java.security.PrivilegedExceptionAction;
@@ -107,7 +107,7 @@ static Delegatee createInstance(@NotNull final ContentRepository repository,
107107
int batchSize) {
108108
ContentSession systemSession;
109109
try {
110-
systemSession = Subject.doAs(SystemSubject.INSTANCE, (PrivilegedExceptionAction<ContentSession>) () -> repository.login(null, null));
110+
systemSession = Java23Subject.doAs(SystemSubject.INSTANCE, (PrivilegedExceptionAction<ContentSession>) () -> repository.login(null, null));
111111
} catch (PrivilegedActionException e) {
112112
throw new SyncRuntimeException(ERROR_CREATE_DELEGATEE, e);
113113
}

oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/AutoMembershipPrincipals.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.apache.jackrabbit.api.security.user.Authorizable;
2020
import org.apache.jackrabbit.api.security.user.Group;
2121
import org.apache.jackrabbit.api.security.user.UserManager;
22-
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
2322
import org.apache.jackrabbit.guava.common.collect.Iterators;
2423
import org.apache.jackrabbit.oak.spi.security.authentication.external.basic.AutoMembershipConfig;
2524
import org.apache.jackrabbit.oak.spi.security.principal.GroupPrincipals;
@@ -220,7 +219,7 @@ private Map<Principal, Group> collectGlobalAutoMembershipPrincipals(@NotNull Str
220219
}
221220
}
222221
// only cache the principal instance but not the group (tree might become disconnected)
223-
principalMap.put(idpName, ImmutableSet.copyOf(map.keySet()));
222+
principalMap.put(idpName, Set.copyOf(map.keySet()));
224223
} else {
225224
// resolve Group objects from cached principals
226225
principalMap.get(idpName).forEach(groupPrincipal -> {

oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalAuthorizableActionProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*/
1717
package org.apache.jackrabbit.oak.spi.security.authentication.external.impl.principal;
1818

19-
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
2019
import org.apache.jackrabbit.api.security.user.Authorizable;
2120
import org.apache.jackrabbit.api.security.user.Group;
2221
import org.apache.jackrabbit.oak.api.Root;
2322
import org.apache.jackrabbit.oak.commons.PropertiesUtil;
23+
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
2424
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
2525
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
2626
import org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
@@ -199,7 +199,7 @@ private Map<String, Set<String>> getAutomembership(boolean memberIsGroup) {
199199

200200
private static void updateAutoMembershipMap(@NotNull Map<String, Set<String>> map, @NotNull String syncHandlerName,
201201
@NotNull String idpName, @NotNull String[] membership) {
202-
Set<String> userMembership = ImmutableSet.copyOf(membership);
202+
Set<String> userMembership = CollectionUtils.toSet(membership);
203203
Set<String> previous = map.put(idpName, userMembership);
204204
if (previous != null) {
205205
String msg = previous.equals(userMembership) ? "Duplicate" : "Colliding";

oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/ExternalGroupPrincipalProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.apache.jackrabbit.api.security.user.Group;
4646
import org.apache.jackrabbit.api.security.user.UserManager;
4747
import org.apache.jackrabbit.commons.iterator.AbstractLazyIterator;
48-
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
4948
import org.apache.jackrabbit.guava.common.collect.Iterables;
5049
import org.apache.jackrabbit.guava.common.collect.Iterators;
5150
import org.apache.jackrabbit.oak.api.PropertyState;
@@ -56,6 +55,7 @@
5655
import org.apache.jackrabbit.oak.api.Root;
5756
import org.apache.jackrabbit.oak.api.Tree;
5857
import org.apache.jackrabbit.oak.api.Type;
58+
import org.apache.jackrabbit.oak.commons.collections.CollectionUtils;
5959
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
6060
import org.apache.jackrabbit.oak.plugins.memory.PropertyValues;
6161
import org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
@@ -326,7 +326,7 @@ public boolean isMember(@NotNull Group group, @NotNull Authorizable authorizable
326326
return Collections.emptyIterator();
327327
}
328328

329-
Set<Value> valueSet = ImmutableSet.copyOf(vs);
329+
Set<Value> valueSet = CollectionUtils.toSet(vs);
330330
Iterator<Group> declared = Iterators.filter(Iterators.transform(valueSet.iterator(), value -> {
331331
try {
332332
String groupPrincipalName = value.getString();

0 commit comments

Comments
 (0)