Search in sources :

Example 36 with SignedDomain

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

Example 37 with SignedDomain

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

Example 38 with SignedDomain

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

Example 39 with SignedDomain

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

Example 40 with SignedDomain

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);
    }
}
Also used : SignedDomain(com.yahoo.athenz.zms.SignedDomain) SimplePrincipal(com.yahoo.athenz.auth.impl.SimplePrincipal) PrincipalAuthority(com.yahoo.athenz.auth.impl.PrincipalAuthority) Test(org.testng.annotations.Test)

Aggregations

SignedDomain (com.yahoo.athenz.zms.SignedDomain)78 Test (org.testng.annotations.Test)68 SimplePrincipal (com.yahoo.athenz.auth.impl.SimplePrincipal)30 PrincipalAuthority (com.yahoo.athenz.auth.impl.PrincipalAuthority)16 ZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore)16 InstanceProvider (com.yahoo.athenz.instance.provider.InstanceProvider)14 MockZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore)14 DomainData (com.yahoo.athenz.zms.DomainData)13 ArrayList (java.util.ArrayList)13 S3Object (com.amazonaws.services.s3.model.S3Object)10 S3ObjectInputStream (com.amazonaws.services.s3.model.S3ObjectInputStream)10 Principal (com.yahoo.athenz.auth.Principal)10 SignedDomains (com.yahoo.athenz.zms.SignedDomains)10 ChangeLogStore (com.yahoo.athenz.zts.store.ChangeLogStore)9 DataStore (com.yahoo.athenz.zts.store.DataStore)9 HashSet (java.util.HashSet)7 AuditLogMsgBuilder (com.yahoo.athenz.common.server.log.AuditLogMsgBuilder)6 AuditLogger (com.yahoo.athenz.common.server.log.AuditLogger)6 DefaultAuditLogMsgBuilder (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogMsgBuilder)6 DefaultAuditLogger (com.yahoo.athenz.common.server.log.impl.DefaultAuditLogger)6