Skip to content

Commit aca9643

Browse files
authored
Merge pull request #322 from xdev-software/develop
Release
2 parents 774bde9 + 70acf1f commit aca9643

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/broken-links.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Broken links
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "23 23 * * 0"
6+
- cron: "23 5 * * 0"
77

88
permissions:
99
issues: write
@@ -21,6 +21,7 @@ jobs:
2121
id: lychee
2222
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
2323
with:
24+
args: "--verbose --no-progress './**/*.md'"
2425
fail: false # Don't fail on broken links, create an issue instead
2526

2627
- name: Find already existing issue

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.2.1
2+
* Use `ConcurrentReferenceHashMap` in favor of `Collections.synchronizedMap(new WeakHashMap<>())` to improve performance
3+
14
# 2.2.0
25
* Vaadin
36
* `SecureVaadinRequestCache` now uses `RequestUtil#isSecuredFlowRoute` which should be more performant and future-proof

oauth2-oidc-remember-me/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ There are some problems with that:
2323
* The session needs to be serializable
2424
* If using Java Serialization: [It's insecure and will always be](https://github.com/frohoff/ysoserial)
2525
* When updating your app the session data might become incompatible (especially when using Java serialization) and migrating it might be extremely difficult
26-
* The sessions can contain a ton of data (and that needs to be store somewhere on the backend)
26+
* The sessions can contain a ton of data (and that needs to be stored somewhere on the backend)
2727
* If the persistent data/backend is breached, an attacker can easily use this data to login in / steal personal information
2828
* When restoring the session it might be necessary to invoke app-specific logic
2929

oauth2-oidc-remember-me/src/main/java/software/xdev/sse/oauth2/rememberme/EnsureNonConcurrentExec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
*/
1616
package software.xdev.sse.oauth2.rememberme;
1717

18-
import java.util.Collections;
1918
import java.util.Map;
20-
import java.util.WeakHashMap;
2119
import java.util.concurrent.ConcurrentHashMap;
2220
import java.util.concurrent.locks.Lock;
2321
import java.util.concurrent.locks.ReentrantLock;
2422
import java.util.function.Function;
2523

2624
import org.slf4j.Logger;
2725
import org.slf4j.LoggerFactory;
26+
import org.springframework.util.ConcurrentReferenceHashMap;
2827

2928

3029
/**
@@ -35,7 +34,8 @@ public class EnsureNonConcurrentExec<K, V>
3534
private static final Logger LOG = LoggerFactory.getLogger(EnsureNonConcurrentExec.class);
3635

3736
protected final Map<K, Lock> keyLocks = new ConcurrentHashMap<>();
38-
protected final Map<Lock, SavedResult<V>> lockResultsCache = Collections.synchronizedMap(new WeakHashMap<>());
37+
protected final Map<Lock, SavedResult<V>> lockResultsCache =
38+
new ConcurrentReferenceHashMap<>(32, ConcurrentReferenceHashMap.ReferenceType.WEAK);
3939

4040
protected final Function<RuntimeException, SavedResult<V>> onException;
4141

oauth2-oidc/src/main/java/software/xdev/sse/oauth2/checkauth/OAuth2AuthChecker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken;
3333
import org.springframework.security.oauth2.core.AbstractOAuth2Token;
3434
import org.springframework.security.oauth2.core.OAuth2ErrorCodes;
35+
import org.springframework.util.ConcurrentReferenceHashMap;
3536

3637
import software.xdev.sse.oauth2.checkauth.disabledcheck.OAuth2IsDisabledChecker;
3738

@@ -58,7 +59,7 @@ public class OAuth2AuthChecker
5859
// https://docs.pmd-code.org/pmd-doc-7.5.0/pmd_rules_java_multithreading.html#avoidsynchronizedstatement
5960
// https://openjdk.org/jeps/8337395
6061
protected final Map<OAuth2AuthorizedClient, ReentrantLock> clientLocks =
61-
Collections.synchronizedMap(new WeakHashMap<>());
62+
new ConcurrentReferenceHashMap<>(32, ConcurrentReferenceHashMap.ReferenceType.WEAK);
6263

6364
public OAuth2AuthChecker(
6465
final OAuth2AuthorizedClientManager clientManager,

0 commit comments

Comments
 (0)