Skip to content

Commit a2b8992

Browse files
committed
Merge branch 'trunk' into OAK-11286
2 parents 99cbbce + 01c6410 commit a2b8992

File tree

820 files changed

+7909
-7209
lines changed

Some content is hidden

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

820 files changed

+7909
-7209
lines changed

.commit-check.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
16+
# format as outlined in https://github.com/commit-check/commit-check/blob/main/.commit-check.yml
17+
# further information in https://github.com/commit-check/commit-check/blob/main/README.rst
18+
checks:
19+
- check: message
20+
regex: '^OAK-\d+:?\s\S+.*'
21+
error: "The commit message must start with 'OAK-<ID>[:] ' followed by some descriptive text"
22+
suggest: Please check your commit message whether it matches above regex
23+
24+
- check: author_name
25+
regex: ^[A-Za-z ,.\'-]+$|.*(\[bot])
26+
error: The committer name seems invalid
27+
suggest: run command `git config user.name "Your Name"`
28+
29+
- check: author_email
30+
regex: ^.+@.+$
31+
error: The committer email seems invalid
32+
suggest: run command `git config user.email yourname@example.com`

.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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
18+
name: Commit Check
19+
20+
on:
21+
pull_request:
22+
branches: 'trunk'
23+
24+
jobs:
25+
commit-check:
26+
runs-on: ubuntu-latest
27+
permissions: # use permissions because of use pr-comments
28+
contents: read
29+
pull-requests: write
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
34+
fetch-depth: 0 # required for merge-base check
35+
# https://github.com/commit-check
36+
# must be pinned due to https://infra.apache.org/github-actions-policy.html
37+
- uses: commit-check/commit-check-action@8d507e12899a9feb405c3ed546252ff9508724e0
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
40+
with:
41+
# check commit message formatting convention
42+
message: true
43+
branch: true
44+
author-name: true
45+
author-email: true
46+
commit-signoff: false
47+
merge-base: false
48+
job-summary: true
49+
pr-comments: ${{ github.event_name == 'pull_request' }}

.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/ExternalLoginModuleFactory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import javax.management.MalformedObjectNameException;
2222
import javax.security.auth.spi.LoginModule;
2323

24-
import org.apache.jackrabbit.guava.common.collect.ImmutableMap;
2524
import org.apache.felix.jaas.LoginModuleFactory;
2625
import org.apache.jackrabbit.oak.api.ContentRepository;
2726
import org.apache.jackrabbit.oak.commons.jmx.JmxUtil;
@@ -214,7 +213,7 @@ private void mayRegisterSyncMBean() {
214213
String sncName = osgiConfig.getConfigValue(PARAM_SYNC_HANDLER_NAME, "");
215214

216215
SyncMBeanImpl bean = new SyncMBeanImpl(contentRepository, securityProvider, syncManager, sncName, idpManager, idpName);
217-
Map<String, String> properties = ImmutableMap.of("handler", sncName, "idp", idpName);
216+
Map<String, String> properties = Map.of("handler", sncName, "idp", idpName);
218217
mbeanRegistration = whiteboard.register(SynchronizationMBean.class, bean,
219218
JmxUtil.createObjectNameMap("UserManagement", "External Identity Synchronization Management", properties));
220219
log.debug("Registration of SynchronizationMBean completed");

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";

0 commit comments

Comments
 (0)