use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetHttpsProvider.
@Test
public void testGetHttpsProvider() throws NoSuchAlgorithmException {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
store.processSignedDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, SSLContext.getDefault(), null, null, null);
InstanceProvider client = provider.getProvider("coretech.weather", null);
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.processSignedDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, null, null, null, null);
InstanceProvider client = provider.getProvider("coretech", null);
assertNull(client);
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class InstanceProviderManagerTest method testGetHttpsProviderUnknownProvider.
@Test
public void testGetHttpsProviderUnknownProvider() throws NoSuchAlgorithmException {
SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
store.processSignedDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, SSLContext.getDefault(), null, null, null);
InstanceProvider client = provider.getProvider("coretech.weather2", null);
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.processSignedDomain(signedDomain, false);
InstanceProviderManager provider = new InstanceProviderManager(store, null, null, null, null);
InstanceProvider client = provider.getProvider("coretech.weather", null);
assertNull(client);
}
use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.
the class ZTSImplTest method testGetPublicKeyEntryInvalidService.
@Test
public void testGetPublicKeyEntryInvalidService() {
SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", true);
store.processDomain(signedDomain, false);
SimplePrincipal principal = (SimplePrincipal) SimplePrincipal.create("hockey", "kings", "v=S1,d=hockey;n=kings;s=sig", 0, new PrincipalAuthority());
ResourceContext context = createResourceContext(principal);
try {
zts.getPublicKeyEntry(context, "coretech", "nonexistentservice", "0");
fail();
} catch (ResourceException ex) {
assertEquals(ex.getCode(), 404);
}
}
Aggregations