use of org.infinispan.cli.user.UserTool in project infinispan by infinispan.
the class AbstractInfinispanServerDriver method createUserFile.
protected void createUserFile(String realm) {
// Create users and groups for individual permissions
UserTool userTool = new UserTool(rootDir.getAbsolutePath());
for (AuthorizationPermission permission : AuthorizationPermission.values()) {
String name = permission.name().toLowerCase();
userTool.createUser(name + "_user", name, realm, UserTool.Encryption.DEFAULT, Collections.singletonList(name), null);
}
// Create users with composite roles
for (TestUser user : TestUser.values()) {
if (user != TestUser.ANONYMOUS) {
userTool.createUser(user.getUser(), user.getPassword(), realm, UserTool.Encryption.DEFAULT, user.getRoles(), null);
}
}
}
use of org.infinispan.cli.user.UserTool in project infinispan by infinispan.
the class SecurityRealmServerListener method before.
@Override
public void before(InfinispanServerDriver driver) {
UserTool userTool = new UserTool(driver.getRootDir().getAbsolutePath(), realm + "-users.properties", realm + "-groups.properties");
// Create users and groups for individual permissions
for (AuthorizationPermission permission : AuthorizationPermission.values()) {
String name = permission.name().toLowerCase();
userTool.createUser(username(name + "_user"), name, realm, UserTool.Encryption.DEFAULT, Collections.singletonList(name), null);
}
// Create users with composite roles
for (TestUser user : TestUser.values()) {
if (user != TestUser.ANONYMOUS) {
userTool.createUser(username(user.getUser()), user.getPassword(), realm, UserTool.Encryption.DEFAULT, user.getRoles(), null);
}
}
}
Aggregations