mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-16 20:15:46 -06:00
Avoid invalidating the realm when managing client initial access
Closes #42922 Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
This commit is contained in:
committed by
GitHub
parent
a8d947b1a9
commit
6b49ffe5ee
@@ -1800,28 +1800,32 @@ public class RealmAdapter implements CachedRealmModel {
|
||||
|
||||
@Override
|
||||
public ClientInitialAccessModel createClientInitialAccessModel(int expiration, int count) {
|
||||
getDelegateForUpdate();
|
||||
return updated.createClientInitialAccessModel(expiration, count);
|
||||
// This does not call getDelegateForUpdate() this data is never cached, and calling it would invalidate all cached realm data
|
||||
return modelSupplier.get().createClientInitialAccessModel(expiration, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientInitialAccessModel getClientInitialAccessModel(String id) {
|
||||
return getDelegateForUpdate().getClientInitialAccessModel(id);
|
||||
// This does not call getDelegateForUpdate() this data is never cached, and calling it would invalidate all cached realm data
|
||||
return modelSupplier.get().getClientInitialAccessModel(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeClientInitialAccessModel(String id) {
|
||||
getDelegateForUpdate().removeClientInitialAccessModel(id);
|
||||
// This does not call getDelegateForUpdate() this data is never cached, and calling it would invalidate all cached realm data
|
||||
modelSupplier.get().removeClientInitialAccessModel(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<ClientInitialAccessModel> getClientInitialAccesses() {
|
||||
return getDelegateForUpdate().getClientInitialAccesses();
|
||||
// This does not call getDelegateForUpdate() this data is never cached, and calling it would invalidate all cached realm data
|
||||
return modelSupplier.get().getClientInitialAccesses();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decreaseRemainingCount(ClientInitialAccessModel clientInitialAccess) {
|
||||
getDelegateForUpdate().decreaseRemainingCount(clientInitialAccess);
|
||||
// This does not call getDelegateForUpdate() this data is never cached, and calling it would invalidate all cached realm data
|
||||
modelSupplier.get().decreaseRemainingCount(clientInitialAccess);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user