Skip to content

Commit c397bae

Browse files
committed
Merge branch 'main' into 3.x-jakarta-ee10
2 parents 53d6e1d + b91a939 commit c397bae

File tree

20 files changed

+124
-87
lines changed

20 files changed

+124
-87
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,13 @@
1616
# under the License.
1717

1818
version: 2
19-
# Add Maven Central explicitly to work around:
20-
# https://github.com/dependabot/dependabot-core/issues/8329
21-
registries:
22-
maven-central:
23-
type: maven-repository
24-
url: https://repo.maven.apache.org/maven2
25-
2619
updates:
2720
# Dependencies for Maven
2821
- package-ecosystem: 'maven'
2922
directory: '/'
3023
schedule:
3124
interval: 'daily'
3225
open-pull-requests-limit: 50
33-
registries:
34-
- maven-central
3526
ignore:
3627
- dependency-name: "jakarta.platform:*"
3728
update-types: [ "version-update:semver-major" ]
@@ -82,8 +73,6 @@ updates:
8273
schedule:
8374
interval: 'daily'
8475
open-pull-requests-limit: 50
85-
registries:
86-
- maven-central
8776
ignore:
8877
- dependency-name: "jakarta.servlet.*:*"
8978
update-types: [ "version-update:semver-major" ]

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ jobs:
6363
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6464

6565
- name: Cache local Maven repository
66-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf #v4.2.2
66+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
6767
with:
6868
path: ~/.m2
6969
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
7070
restore-keys: ${{ runner.os }}-m2
7171

7272
# Initializes the CodeQL tools for scanning.
7373
- name: Initialize CodeQL
74-
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
74+
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
7575
with:
7676
languages: ${{ matrix.language }}
7777
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -96,6 +96,6 @@ jobs:
9696
# ./location_of_script_within_repo/buildscript.sh
9797

9898
- name: Perform CodeQL Analysis
99-
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
99+
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
100100
with:
101101
category: "/language:${{matrix.language}}"

.github/workflows/maven.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737

3838
- name: Set up JDK
39-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
39+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
4040
with:
4141
java-version: 17
4242
distribution: temurin
@@ -83,7 +83,7 @@ jobs:
8383
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8484

8585
- name: Set up JDK
86-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
86+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
8787
with:
8888
java-version: ${{ matrix.jdk }}
8989
distribution: ${{ matrix.dist }}
@@ -101,7 +101,7 @@ jobs:
101101
-Pskip_jakarta_ee_tests
102102
103103
- name: Archive test run logs
104-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
104+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
105105
if: always()
106106
with:
107107
name: test-logs-${{ matrix.os }}-${{ matrix.jdk }}-${{ matrix.dist }}

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ jobs:
6666
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6767
# format to the repository Actions tab.
6868
- name: "Upload artifact"
69-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # tag=v4.6.1
69+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
7070
with:
7171
name: SARIF file
7272
path: results.sarif
7373
retention-days: 5
7474

7575
# Upload the results to GitHub's code scanning dashboard.
7676
- name: "Upload to code-scanning"
77-
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d #tag=v2
77+
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b #tag=v2
7878
with:
7979
sarif_file: results.sarif

.github/workflows/stale.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Close Stale Issues
37-
uses: actions/stale@v9
37+
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
3838
with:
3939
# default is 60
4040
days-before-stale: 90
41+
exempt-issue-labels: valid
42+
exempt-pr-labels: valid

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/org.apache.shiro/shiro-core)](https://central.sonatype.com/artifact/org.apache.shiro/shiro-core/)
44
[![Build Status](https://ci-builds.apache.org/buildStatus/icon?job=Shiro%2FShiro-all%2Fmain)](https://ci-builds.apache.org/job/Shiro/job/Shiro-all/job/main/)
5-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/apache/shiro/badge)](https://api.securityscorecards.dev/projects/github.com/apache/shiro)
5+
[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/apache/shiro?style=plastic&label=openssf%20scorecard)](https://deps.dev/project/github/apache%2Fshiro)
66
[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/apache/shiro/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/shiro/README.md)
77

88
Apache Shiro

core/src/main/java/org/apache/shiro/mgt/AbstractRememberMeManager.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.apache.shiro.lang.io.Serializer;
3030
import org.apache.shiro.lang.util.ByteSource;
3131
import org.apache.shiro.lang.util.ByteUtils;
32+
import org.apache.shiro.lang.util.ClassUtils;
3233
import org.apache.shiro.subject.PrincipalCollection;
3334
import org.apache.shiro.subject.Subject;
3435
import org.apache.shiro.subject.SubjectContext;
@@ -509,7 +510,12 @@ protected byte[] decrypt(byte[] encrypted) {
509510
* @return the serialized principal collection in the form of a byte array
510511
*/
511512
protected byte[] serialize(PrincipalCollection principals) {
512-
return getSerializer().serialize(principals);
513+
ClassUtils.setAdditionalClassLoader(AbstractRememberMeManager.class.getClassLoader());
514+
try {
515+
return getSerializer().serialize(principals);
516+
} finally {
517+
ClassUtils.removeAdditionalClassLoader();
518+
}
513519
}
514520

515521
/**
@@ -520,7 +526,12 @@ protected byte[] serialize(PrincipalCollection principals) {
520526
* @return the deserialized (reconstituted) {@code PrincipalCollection}
521527
*/
522528
protected PrincipalCollection deserialize(byte[] serializedIdentity) {
523-
return getSerializer().deserialize(serializedIdentity);
529+
ClassUtils.setAdditionalClassLoader(AbstractRememberMeManager.class.getClassLoader());
530+
try {
531+
return getSerializer().deserialize(serializedIdentity);
532+
} finally {
533+
ClassUtils.removeAdditionalClassLoader();
534+
}
524535
}
525536

526537
/**

core/src/main/java/org/apache/shiro/realm/AuthenticatingRealm.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public boolean supports(AuthenticationToken token) {
391391
* @since 1.2
392392
*/
393393
public final void init() {
394-
//trigger obtaining the authorization cache if possible
394+
//trigger obtaining the authentication cache if possible
395395
getAvailableAuthenticationCache();
396396
onInit();
397397
}
@@ -411,7 +411,7 @@ protected void onInit() {
411411
* @since 1.2
412412
*/
413413
protected void afterCacheManagerSet() {
414-
//trigger obtaining the authorization cache if possible
414+
//trigger obtaining the authentication cache if possible
415415
getAvailableAuthenticationCache();
416416
}
417417

@@ -485,9 +485,9 @@ private AuthenticationInfo getCachedAuthenticationInfo(AuthenticationToken token
485485
Object key = getAuthenticationCacheKey(token);
486486
info = cache.get(key);
487487
if (info == null) {
488-
LOGGER.trace("No AuthorizationInfo found in cache for key [{}]", key);
488+
LOGGER.trace("No AuthenticationInfo found in cache for key [{}]", key);
489489
} else {
490-
LOGGER.trace("Found cached AuthorizationInfo for key [{}]", key);
490+
LOGGER.trace("Found cached AuthenticationInfo for key [{}]", key);
491491
}
492492
}
493493

@@ -677,7 +677,7 @@ private static boolean isEmpty(PrincipalCollection pc) {
677677
* {@link #clearCache(org.apache.shiro.subject.PrincipalCollection)} method instead (which will in turn call this
678678
* method by default).
679679
*
680-
* @param principals the principals of the account for which to clear the cached AuthorizationInfo.
680+
* @param principals the principals of the account for which to clear the cached AuthenticationInfo.
681681
* @see #clearCache(org.apache.shiro.subject.PrincipalCollection)
682682
* @since 1.2
683683
*/

core/src/main/java/org/apache/shiro/session/mgt/AbstractValidatingSessionManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,18 @@ protected void validate(Session session, SessionKey key) throws InvalidSessionEx
140140
try {
141141
doValidate(session);
142142
} catch (ExpiredSessionException ese) {
143-
onExpiration(session, ese, key);
143+
try {
144+
onExpiration(session, ese, key);
145+
} catch (IllegalStateException eise) {
146+
LOGGER.trace("Attempting to validate an expired session with key {}", key, eise);
147+
}
144148
throw ese;
145149
} catch (InvalidSessionException ise) {
146-
onInvalidation(session, ise, key);
150+
try {
151+
onInvalidation(session, ise, key);
152+
} catch (IllegalStateException eise) {
153+
LOGGER.trace("Attempting to validate session with key {}", key, eise);
154+
}
147155
throw ise;
148156
}
149157
}

core/src/main/java/org/apache/shiro/util/ThreadContext.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public abstract class ThreadContext {
6060
*/
6161
private static final Logger LOGGER = LoggerFactory.getLogger(ThreadContext.class);
6262

63-
private static final ThreadLocal<Map<Object, Object>> RESOURCES = new InheritableThreadLocalMap<Map<Object, Object>>();
63+
private static final ThreadLocal<Map<Object, Object>> RESOURCES = new ThreadLocal<>();
6464

6565
/**
6666
* Default no-argument constructor.
@@ -327,26 +327,5 @@ public static void bind(Subject subject) {
327327
public static Subject unbindSubject() {
328328
return (Subject) remove(SUBJECT_KEY);
329329
}
330-
331-
private static final class InheritableThreadLocalMap<T extends Map<Object, Object>>
332-
extends InheritableThreadLocal<Map<Object, Object>> {
333-
334-
/**
335-
* This implementation was added to address a
336-
* <a href="http://jsecurity.markmail.org/search/?q=#query:+page:1+mid:xqi2yxurwmrpqrvj+state:results">
337-
* user-reported issue</a>.
338-
*
339-
* @param parentValue the parent value, a HashMap as defined in the {@link #initialValue()} method.
340-
* @return the HashMap to be used by any parent-spawned child threads (a clone of the parent HashMap).
341-
*/
342-
@SuppressWarnings({"unchecked"})
343-
protected Map<Object, Object> childValue(Map<Object, Object> parentValue) {
344-
if (parentValue != null) {
345-
return (Map<Object, Object>) ((HashMap<Object, Object>) parentValue).clone();
346-
} else {
347-
return null;
348-
}
349-
}
350-
}
351330
}
352331

0 commit comments

Comments
 (0)