use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetHttpsProvider.
@Test
public void testGetHttpsProvider() {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
store.processDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, null);
InstanceProvider client = provider.getProvider("coretech.weather");
assertNotNull(client);
client.close();
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetHttpsProviderInvalidName.
@Test
public void testGetHttpsProviderInvalidName() {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
store.processDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, null);
InstanceProvider client = provider.getProvider("coretech");
assertNull(client);
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetProviderClientNoEndpoint.
@Test
public void testGetProviderClientNoEndpoint() {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, false);
store.processDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, null);
InstanceProvider client = provider.getProvider("coretech.weather");
assertNull(client);
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class DataStoreTest method testProcessTrustMembershipNoTrustDomainMatch.
@Test
public void testProcessTrustMembershipNoTrustDomainMatch() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
store.loadZMSPublicKeys();
SignedDomain signedDomain = createSignedDomain("coretech", "weather");
store.processDomain(signedDomain, true);
signedDomain = createTenantSignedDomain("weather", "coretech");
store.processDomain(signedDomain, true);
Set<String> accessibleRoles = new HashSet<>();
String prefix = "coretech" + ROLE_POSTFIX;
String identity = "user_domain.user100";
store.processTrustMembership(store.getCacheStore().getIfPresent("coretech"), identity, prefix, null, accessibleRoles, false);
assertEquals(accessibleRoles.size(), 1);
assertTrue(accessibleRoles.contains("tenant.readers"));
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class DataStoreTest method testProcessLocalDomain.
@Test
public void testProcessLocalDomain() {
ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0");
DataStore store = new DataStore(clogStore, null);
store.loadZMSPublicKeys();
SignedDomain signedDomain = createSignedDomain("coretech", "weather");
store.processDomain(signedDomain, true);
store = new DataStore(clogStore, null);
boolean result = store.processLocalDomain("coretech");
assertTrue(result);
assertNotNull(store.getDomainData("coretech"));
}
Aggregations