Search in sources :

Example 66 with SignedDomain

use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.

the class ZTSImplTest method testGetPublicKey.

@Test
public void testGetPublicKey() {
    SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", true);
    store.processDomain(signedDomain, false);
    String pubKey = zts.getPublicKey("coretech", "storage", "0");
    assertEquals(pubKey, ZTS_PEM_CERT0);
    pubKey = zts.getPublicKey("coretech", "storage", "100");
    assertNull(pubKey);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) Test(org.testng.annotations.Test)

Example 67 with SignedDomain

use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetHttpsProviderUnknownProvider.

@Test
public void testGetHttpsProviderUnknownProvider() {
    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();
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 68 with SignedDomain

use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetProviderClientInvalidService.

@Test
public void testGetProviderClientInvalidService() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather2");
    assertNull(client);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 69 with SignedDomain

use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetClassProvider.

@Test
public void testGetClassProvider() {
    SignedDomain signedDomain = createSignedDomainClassEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech.weather");
    assertNotNull(client);
    client.close();
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Example 70 with SignedDomain

use of com.yahoo.athenz.zms.SignedDomain in project athenz by yahoo.

the class InstanceProviderManagerTest method testGetProviderClientInvalidDomain.

@Test
public void testGetProviderClientInvalidDomain() {
    SignedDomain signedDomain = createSignedDomainHttpsEndpoint("coretech", "weather", true, true);
    store.processDomain(signedDomain, false);
    InstanceProviderManager provider = new InstanceProviderManager(store, null);
    InstanceProvider client = provider.getProvider("coretech2.weather");
    assertNull(client);
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) InstanceProviderManager(com.yahoo.athenz.zts.InstanceProviderManager) InstanceProvider(com.yahoo.athenz.instance.provider.InstanceProvider) Test(org.testng.annotations.Test)

Aggregations

SignedDomain (com.yahoo.athenz.zms.SignedDomain)157 Test (org.testng.annotations.Test)137 ZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore)72 MockZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore)71 SimplePrincipal (com.yahoo.athenz.auth.impl.SimplePrincipal)70 ArrayList (java.util.ArrayList)44 ChangeLogStore (com.yahoo.athenz.zts.store.ChangeLogStore)38 DataStore (com.yahoo.athenz.zts.store.DataStore)38 Principal (com.yahoo.athenz.auth.Principal)33 InstanceProvider (com.yahoo.athenz.instance.provider.InstanceProvider)31 Path (java.nio.file.Path)30 RoleMember (com.yahoo.athenz.zms.RoleMember)26 DomainData (com.yahoo.athenz.zms.DomainData)25 InstanceCertManager (com.yahoo.athenz.zts.cert.InstanceCertManager)25 Role (com.yahoo.athenz.zms.Role)22 CertificateAuthority (com.yahoo.athenz.auth.impl.CertificateAuthority)20 HashSet (java.util.HashSet)20 X509Certificate (java.security.cert.X509Certificate)19 InstanceConfirmation (com.yahoo.athenz.instance.provider.InstanceConfirmation)18 X509CertRecord (com.yahoo.athenz.zts.cert.X509CertRecord)18