Skip to content

Commit

Permalink
Remote protostream cache workarounds
Browse files Browse the repository at this point in the history
* Remove protected cache security check.
* Add remote query server dependency to the infinispan main module so
  that caches that use compatibility marshaller
  CompatibilityProtoStreamMarshaller can be defined
  • Loading branch information
galderz committed Apr 20, 2017
1 parent 71f21d4 commit 1e092e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -111,15 +111,9 @@ void obtainCache(EmbeddedCacheManager cacheManager, boolean loopback) throws Req
String.format("Remote requests are not allowed to private caches. Do no send remote requests to cache '%s'", cacheName),
header.version, header.messageId);
} else if (icr.internalCacheHasFlag(cacheName, InternalCacheRegistry.Flag.PROTECTED)) {
if (!cacheManager.getCacheManagerConfiguration().security().authorization().enabled() && !loopback) {
throw new RequestParsingException(
String.format("Remote requests are allowed to protected caches only over loopback or if authorization is enabled. Do no send remote requests to cache '%s'", cacheName),
header.version, header.messageId);
} else {
// We want to make sure the cache access is checked everytime, so don't store it as a "known" cache. More
// expensive, but these caches should not be accessed frequently
cache = server.getCacheInstance(cacheName, cacheManager, true, false);
}
// We want to make sure the cache access is checked everytime, so don't store it as a "known" cache. More
// expensive, but these caches should not be accessed frequently
cache = server.getCacheInstance(cacheName, cacheManager, true, false);
} else if (!cacheName.isEmpty() && !cacheManager.getCacheNames().contains(cacheName)) {
throw new CacheNotFoundException(
String.format("Cache with name '%s' not found amongst the configured caches", cacheName),
Expand Down
Expand Up @@ -11,6 +11,12 @@
<module name="org.jboss.logging"/>
<module name="org.infinispan.commons" export="true"/>
<module name="org.infinispan.query" optional="true" services="import"/>
<!-- MOD :: START :: add remote query server dependency to be able to
define org.infinispan.query.remote.CompatibilityProtoStreamMarshaller
as compatibility marshaller
-->
<module name="org.infinispan.remote-query.server" optional="true"/>
<!-- MOD :: END -->
<module name="org.infinispan.lucene-directory" optional="true" export="true" services="export" />
<module name="org.jboss.marshalling" services="import"/>
<module name="org.jgroups"/>
Expand Down

0 comments on commit 1e092e9

Please sign in to comment.