use of com.emc.storageos.model.auth.AuthnProviderRestRep in project coprhd-controller by CoprHD.
the class Tenants method addRenderArgs.
@Util
private static void addRenderArgs(TenantForm tenant) {
List<String> domains = Lists.newArrayList();
for (AuthnProviderRestRep authProvider : AuthnProviderUtils.getAuthnProviders()) {
if (!authProvider.getDisable()) {
domains.addAll(authProvider.getDomains());
}
}
Gson g = new Gson();
renderArgs.put("domainsJson", g.toJson(domains));
List<StringOption> allNamespace = TenantUtils.getUnmappedNamespace();
renderArgs.put("namespaceOptions", allNamespace);
}
use of com.emc.storageos.model.auth.AuthnProviderRestRep in project coprhd-controller by CoprHD.
the class ACLUtils method validateActiveDirectoryGroupName.
public static boolean validateActiveDirectoryGroupName(String name) {
if (StringUtils.isNotBlank(name)) {
String group = stripDomainName(name);
String domain = extractDomainName(name);
if (StringUtils.isNotBlank(group) && StringUtils.isNotBlank(domain)) {
List<AuthnProviderRestRep> authnProviderRestReps = AuthnProviderUtils.getAuthProvidersByDomainName(domain);
for (AuthnProviderRestRep authnProviderRestRep : authnProviderRestReps) {
if (isActiveDirectoryProvider(authnProviderRestRep) && isGroupOnWhiteList(authnProviderRestRep.getGroupWhitelistValues(), group)) {
return true;
}
}
}
}
return false;
}
use of com.emc.storageos.model.auth.AuthnProviderRestRep in project coprhd-controller by CoprHD.
the class TrustStoreTest method addResourcesShouldSucceed.
/**
*/
private void addResourcesShouldSucceed() {
resourcesToRemove = new ArrayList<RestLinkRep>();
ClientResponse response = addLDAPSAuthProvider();
Assert.assertEquals(200, response.getStatus());
AuthnProviderRestRep authnResp = response.getEntity(AuthnProviderRestRep.class);
Assert.assertNotNull(authnResp);
resourcesToRemove.add(authnResp.getLink());
}
use of com.emc.storageos.model.auth.AuthnProviderRestRep in project coprhd-controller by CoprHD.
the class Tenants method list.
public static void list() {
TenantsDataTable dataTable = new TenantsDataTable();
renderArgs.put("sources", TenantSource.options(TenantSource.TENANTS_SOURCE_ALL, TenantSource.TENANTS_SOURCE_LOCAL, TenantSource.TENANTS_SOURCE_OS));
renderArgs.put("currentSource", Models.currentSource());
if (isKeystoneAuthnProviderCreated()) {
AuthnProviderRestRep authnProvider = AuthnProviderUtils.getKeystoneAuthProvider();
authnProviderName = authnProvider.getName();
TenantsSyncOptionsForm keystoneProvider = new TenantsSyncOptionsForm();
keystoneProvider.readFrom(authnProvider);
renderArgs.put("tenantsOptions", TenantsSynchronizationOptions.options(TenantsSynchronizationOptions.ADDITION, TenantsSynchronizationOptions.DELETION));
renderArgs.put("interval", getInterval(authnProvider));
renderArgs.put("osTenantsToAdd", new KeystoneSynchronizationTenantsDataTable());
renderArgs.put("osTenantsToRemove", new KeystoneSynchronizationTenantsDataTable());
render(dataTable, keystoneProvider);
}
render(dataTable);
}
use of com.emc.storageos.model.auth.AuthnProviderRestRep in project coprhd-controller by CoprHD.
the class LDAPsources method save.
@FlashException(keep = true)
public static void save(LDAPsourcesForm ldapSources) {
ldapSources.validate("ldapSources");
if (Validation.hasErrors()) {
Common.handleError();
}
AuthnProviderRestRep authnProvider = ldapSources.save();
authProviderName = ldapSources.name;
flash.success(MessagesUtils.get(SAVED, ldapSources.name));
if (ldapSources.autoRegCoprHDNImportOSProjects && !authProviderAutoReg) {
renderArgs.put("showDialog", "true");
edit(new LDAPsourcesForm(authnProvider));
}
list();
}
Aggregations