use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class IdRepoTest method getPrivileges.
@Parameters({ "realm", "uid" })
@Test(groups = { "cli-idrepo", "show-privileges" }, dependsOnMethods = { "createIdentity" })
public void getPrivileges(String realm, String uid) throws CLIException, IdRepoException, SSOException {
String[] param = { realm, uid };
entering("getPrivileges", param);
String[] args = { "show-privileges", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_TYPE, "Group", CLIConstants.PREFIX_ARGUMENT_LONG + IdentityCommand.ARGUMENT_ID_NAME, TOP_LEVEL_ADMIN_GROUP, CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME, realm };
SSOToken adminSSOToken = getAdminSSOToken();
CLIRequest req = new CLIRequest(null, args, adminSSOToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
exiting("getPrivileges");
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class CreateApplicationTest method createApp.
@Test
public void createApp() throws CLIException {
String[] args = new String[18];
args[0] = "create-appl";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME;
args[2] = "/";
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + CreateApplication.PARAM_APPL_NAME;
args[4] = APPL_NAME;
args[5] = CLIConstants.PREFIX_ARGUMENT_LONG + CreateApplication.PARAM_APPL_TYPE_NAME;
args[6] = ApplicationTypeManager.URL_APPLICATION_TYPE_NAME;
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.ATTRIBUTE_VALUES;
args[8] = CreateApplication.ATTR_ACTIONS + "=GET=true";
args[9] = CreateApplication.ATTR_ACTIONS + "=POST=true";
args[10] = CreateApplication.ATTR_CONDITIONS + "=com.sun.identity.admin.model.DateRangeCondition";
args[11] = CreateApplication.ATTR_SUBJECTS + "=com.sun.identity.admin.model.IdRepoGroupViewSubject";
args[12] = CreateApplication.ATTR_RESOURCES + "=https://";
args[13] = CreateApplication.ATTR_SUBJECT_ATTRIBUTE_NAMES + "=uid";
args[14] = CreateApplication.ATTR_ENTITLEMENT_COMBINER + "=com.sun.identity.entitlement.DenyOverride";
args[15] = CreateApplication.ATTR_RESOURCE_COMPARATOR + "=com.sun.identity.entitlement.URLResourceName";
args[16] = CreateApplication.ATTR_SAVE_INDEX + "=com.sun.identity.entitlement.util.ResourceNameIndexGenerator";
args[17] = CreateApplication.ATTR_SEARCH_INDEX + "=com.sun.identity.entitlement.util.ResourceNameSplitter";
CLIRequest req = new CLIRequest(null, args, adminToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class DeleteApplicationsTest method deleteApp.
@Test
public void deleteApp() throws CLIException {
String[] args = new String[5];
args[0] = "delete-appls";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME;
args[2] = "/";
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + CreateApplication.PARAM_APPL_NAMES;
args[4] = APPL_NAME;
CLIRequest req = new CLIRequest(null, args, adminToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class ListApplicationTypesTest method listAppTypes.
@Test
public void listAppTypes() throws CLIException {
String[] args = new String[1];
args[0] = "list-appl-types";
CLIRequest req = new CLIRequest(null, args, adminToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
}
use of com.sun.identity.cli.CLIRequest in project OpenAM by OpenRock.
the class ApplicationPrivilegeCLITest method setSubjects.
@Test(dependsOnMethods = "changeAction")
public void setSubjects() throws Exception {
String[] args = new String[9];
args[0] = "update-app-priv-subjects";
args[1] = CLIConstants.PREFIX_ARGUMENT_LONG + IArgument.REALM_NAME;
args[2] = "/";
args[3] = CLIConstants.PREFIX_ARGUMENT_LONG + ApplicationPrivilegeBase.PARAM_NAME;
args[4] = PRIVILEGE_NAME;
args[5] = CLIConstants.PREFIX_ARGUMENT_LONG + ApplicationPrivilegeBase.PARAM_SUBJECT_TYPE;
args[6] = ApplicationPrivilegeBase.PARAM_SUBJECT_USER;
args[7] = CLIConstants.PREFIX_ARGUMENT_LONG + ApplicationPrivilegeBase.PARAM_SUBJECTS;
args[8] = user2.getUniversalId();
CLIRequest req = new CLIRequest(null, args, adminToken);
cmdManager.addToRequestQueue(req);
cmdManager.serviceRequestQueue();
ApplicationPrivilegeManager apm = ApplicationPrivilegeManager.getInstance("/", adminSubject);
ApplicationPrivilege ap = apm.getPrivilege(PRIVILEGE_NAME);
Set<AMIdentity> users = new HashSet<AMIdentity>();
users.add(user2);
validateSubjects(ap, users, "setSubjects");
}
Aggregations