Repository navigation
[OID4VCI] Cache issued verifiable credentials - #53332
Open
forkimenjeckayang wants to merge 9 commits into
Open
forkimenjeckayang wants to merge 9 commits into
forkimenjeckayang wants to merge 9 commits into
Conversation
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Pending global invalidations can return stale data within a transaction, while no-op cleanup unnecessarily invalidates the cluster-wide cache.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds per-user caching and cluster-aware invalidation for issued OID4VCI credentials.
Changes:
- Adds revisioned issued-credential cache entries and invalidation events.
- Invalidates caches after credential changes, cleanup, user changes, and related resource deletion.
- Adds local and clustered integration coverage.
| File | Description |
|---|---|
tests/clustering/.../IssuedVerifiableCredentialCacheInvalidationTest.java |
Tests two-node invalidation. |
tests/base/.../IssuedVerifiableCredentialTest.java |
Tests add and unscoped-remove invalidation. |
test-framework/.../IssuedVerifiableCredentialTestHelper.java |
Provides clustered-test operations. |
server-spi/.../UserProvider.java |
Adds credential lookup by ID. |
model/storage/.../UserVerifiableCredentialFederatedStorage.java |
Adds federated lookup contract. |
model/storage-private/.../UserStorageManager.java |
Resolves credentials across storage types. |
model/jpa/.../JpaUserFederatedStorageProvider.java |
Implements federated ID lookup. |
model/jpa/.../JpaUserProvider.java |
Implements local ID lookup. |
model/infinispan/.../UserCacheSession.java |
Implements caching and invalidation behavior. |
model/infinispan/.../UserCacheManager.java |
Manages cache keys and global revisions. |
model/infinispan/.../UserIssuedVerifiableCredentialsUpdatedEvent.java |
Defines clustered invalidation events. |
model/infinispan/.../CachedUserIssuedVerifiableCredentials.java |
Stores cached credential collections. |
model/infinispan/.../CachedUserIssuedVerifiableCredential.java |
Stores cached credential values. |
model/infinispan/.../Marshalling.java |
Allocates the event type ID. |
model/infinispan/.../KeycloakModelSchema.java |
Registers event marshalling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The cache lifecycle, storage implementations, marshalling registration, and clustered invalidation paths are consistent and adequately tested.
Review effort: Balanced
Findings: None
Resolved since last review (2)
forkimenjeckayang
force-pushed
the
issue-49335
branch
from
October 1, 2026 07:11
c0cda98 to
6a5832e
Compare
<
8000
a class="avatar avatar-user" style="width:20px;height:20px;" data-test-selector="commits-avatar-stack-avatar-link" data-hovercard-type="user" data-hovercard-url="/users/forkimenjeckayang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/forkimenjeckayang">
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
forkimenjeckayang
force-pushed
the
issue-49335
branch
from
October 1, 2026 10:38
6a5832e to
5326aad
Compare
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
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.


Summary
Add caching support for issued verifiable credentials.
Issued credential collections are now cached per user using dedicated
revisioned cache entries. Empty collections are cached as well, avoiding
repeated storage queries for users without issued credentials.
Cache entries are invalidated when:
Unscoped issued-credential removal now resolves the owning user before
deletion, allowing the correct per-user cache entry to be invalidated.
Cluster invalidation
Introduce a ProtoStream-marshalled user-cache event supporting targeted
and all-users invalidation.
All-users invalidation advances a dedicated global revision marker.
Each cached collection records the marker revision observed when it was
loaded. This prevents an in-flight cache load from reintroducing stale
data after a bulk invalidation event.
Invalidations are propagated through Keycloak's existing user-cache
invalidation channel for clustered and cross-DC deployments.
Testing
Added integration coverage for:
is removed;
nodes;
closes #49335