Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and repair
The custom authenticator skipped its configured strategy when multiple realms were configured but only one supported the token. This let AtLeastTwo accept a single successful password realm. Multi-configured-realm authentication now executes the configured strategy; truly single-configured-realm behavior follows Shiro's existing contract.
OnlyOne now rejects zero-success results at the authenticator layer and counts successful realm callbacks per invocation, including same-named realms. Both custom count strategies aggregate copies of principal collections and mutable credential collections, avoiding mutation of cached realm results across attempts. DefaultCredentialsMatcher evaluates its protected comparison exactly once. The hashed matcher synchronizes lazy cache initialization and its direct cache setter for safe publication. OnlyOne also explicitly rejects non-null realm results with null/empty principals using AuthenticationException, even if another realm succeeded.
Compatibility
Validation
clean verify: 40 tests, zero failures/errors/skips.Unresolved: retry counter atomicity — keep draft
Both retry matchers still have a confirmed first-insertion get/put race. This PR does NOT claim to fix atomic retry counting, cross-wrapper synchronization, distributed limits or generic cache TTL semantics. Shiro Cache has no CAS/atomic increment/remaining-TTL API. Blind per-attempt puts can refresh provider TTL; wrapper-local locks cannot coordinate other wrappers or JVMs. Controlled failing race probes and the design assessment are retained in the local task evidence and are not weakened into accepting assertions. A separately agreed provider/scoping contract is required for the counter repair.
The CI workflow still pins JWT issuer 6b1a4de65a12a155e98e957ea82e446ef6420b36; it does not validate the later c6edbf6 cache-collision fix.
Keep this PR in draft. No ready, approval or merge operation is part of this update.