Merge pull request #4456 from pedroigor/master
[KEYCLOAK-5389] - Invalidating ResourceStore.findByUri cache when creating new resources
This commit is contained in:
commit
c8eeeffdeb
1 changed files with 2 additions and 1 deletions
|
@ -509,8 +509,9 @@ public class StoreFactoryCacheSession implements CachedStoreFactoryProvider {
|
||||||
@Override
|
@Override
|
||||||
public Resource create(String name, ResourceServer resourceServer, String owner) {
|
public Resource create(String name, ResourceServer resourceServer, String owner) {
|
||||||
Resource resource = getResourceStoreDelegate().create(name, resourceServer, owner);
|
Resource resource = getResourceStoreDelegate().create(name, resourceServer, owner);
|
||||||
|
Resource cached = findById(resource.getId(), resourceServer.getId());
|
||||||
registerResourceInvalidation(resource.getId(), resource.getName(), resource.getType(), resource.getUri(), resource.getScopes().stream().map(scope -> scope.getId()).collect(Collectors.toSet()), resourceServer.getId(), resource.getOwner());
|
registerResourceInvalidation(resource.getId(), resource.getName(), resource.getType(), resource.getUri(), resource.getScopes().stream().map(scope -> scope.getId()).collect(Collectors.toSet()), resourceServer.getId(), resource.getOwner());
|
||||||
return resource;
|
return cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue