use of org.keycloak.storage.CacheableStorageProviderModel in project keycloak by keycloak.
the class UserCacheSession method validateCache.
protected UserModel validateCache(RealmModel realm, CachedUser cached) {
if (!realm.getId().equals(cached.getRealm())) {
return null;
}
StorageId storageId = cached.getFederationLink() != null ? new StorageId(cached.getFederationLink(), cached.getId()) : new StorageId(cached.getId());
if (!storageId.isLocal()) {
ComponentModel component = realm.getComponent(storageId.getProviderId());
CacheableStorageProviderModel model = new CacheableStorageProviderModel(component);
// its also hard to test stuff
if (model.shouldInvalidate(cached)) {
registerUserInvalidation(realm, cached);
return getDelegate().getUserById(realm, cached.getId());
}
}
return new UserAdapter(cached, this, session, realm);
}
Aggregations