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
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class IPvXTest { | |
| static void match(String s) { | |
| Pattern p = Pattern.compile("(\\[(?<v6host>[0-9A-Fa-f:]+)\\]|(?<v4host>[^:/?#]*))(?::(?<port>\\d*))?"); | |
| Matcher matcher = p.matcher(s); | |
| if (matcher.matches()) { | |
| String v6host = matcher.group("v6host"); |
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
| <?xml version='1.0' encoding='UTF-8'?> | |
| <server xmlns="urn:jboss:domain:1.4"> | |
| <extensions> | |
| <extension module="org.infinispan.server.endpoint"/> | |
| <extension module="org.jboss.as.clustering.infinispan"/> | |
| <extension module="org.jboss.as.clustering.jgroups"/> | |
| <extension module="org.jboss.as.connector"/> | |
| <extension module="org.jboss.as.jdr"/> | |
| <extension module="org.jboss.as.jmx"/> |
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
| <cache-container name="default" > | |
| <security> | |
| <authorization enabled="true" mapper="org.infinispan.security.impl.IdentityRoleMapper"> | |
| <role name="admin" permissions="ALL" /> | |
| <role name="reader" permissions="READ" /> | |
| <role name="writer" permissions="WRITE" /> | |
| <role name="supervisor" permissions="READ WRITE EXEC"/> | |
| </authorization> | |
| </security> | |
| </cache-container> |
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
| <local-cache name="secured"> | |
| <security> | |
| <authorization enabled="true" roles="admin reader writer" /> | |
| </security> | |
| </local-cache> |
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
| String value = Subject.doAs(mySubject, new PrivilegedAction<String>() { | |
| @Override | |
| public String run() { | |
| return cacheManager.getCache().get("key"); | |
| } | |
| }); |
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
| String value = Subject.doAs(mySubject, PrivilegedAction<String>() -> cacheManager.getCache().get("key")); |
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
| <server xmlns="urn:jboss:domain:2.1"> | |
| <management> | |
| <security-realms> | |
| <security-realm name="ApplicationRealm"> | |
| <authentication> | |
| <local default-user="$local" allowed-users="*" skip-group-loading="true"/> | |
| <properties path="application-users.properties" relative-to="jboss.server.config.dir"/> | |
| </authentication> | |
| <authorization> | |
| <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/> |
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
| import java.util.Collections; | |
| import javax.security.sasl.Sasl; | |
| import org.infinispan.client.hotrod.RemoteCache; | |
| import org.infinispan.client.hotrod.RemoteCacheManager; | |
| import org.infinispan.client.hotrod.configuration.ConfigurationBuilder; | |
| public class AuthenticatedHotRodClient { |
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
| // mode=local,language=javascript | |
| var cache = cacheManager.getCache(); | |
| cache.get("a"); |
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
| package mypackage; | |
| import java.util.Map; | |
| import org.infinispan.configuration.cache.Configuration; | |
| import org.infinispan.factories.ComponentRegistry; | |
| import org.infinispan.lifecycle.AbstractModuleLifecycle; | |
| import org.infinispan.lifecycle.ModuleLifecycle; | |
| import org.kohsuke.MetaInfServices; | |
| @MetaInfServices(ModuleLifecycle.class) |