Search in sources :

Example 86 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class WebsiteCloudFrontDistributionConfigurationTest method testGetMethodsAWS.

@Test
public void testGetMethodsAWS() {
    final S3Session session = new S3Session(new Host(new S3Protocol()));
    final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.DOWNLOAD));
    assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.STREAMING));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.CUSTOM));
    assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE_CDN));
    assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb_b", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) S3Session(ch.cyberduck.core.s3.S3Session) Host(ch.cyberduck.core.Host) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) S3Protocol(ch.cyberduck.core.s3.S3Protocol) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 87 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class WebsiteCloudFrontDistributionConfigurationTest method testFeatures.

@Test
public void testFeatures() {
    final WebsiteCloudFrontDistributionConfiguration d = new WebsiteCloudFrontDistributionConfiguration(new S3Session(new Host(new S3Protocol(), new S3Protocol().getDefaultHostname())), new DisabledX509TrustManager(), new DefaultX509KeyManager());
    assertNotNull(d.getFeature(Purge.class, Distribution.DOWNLOAD));
    assertNotNull(d.getFeature(Purge.class, Distribution.WEBSITE_CDN));
    assertNull(d.getFeature(Purge.class, Distribution.STREAMING));
    assertNull(d.getFeature(Purge.class, Distribution.WEBSITE));
    assertNotNull(d.getFeature(Index.class, Distribution.DOWNLOAD));
    assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE_CDN));
    assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE));
    assertNull(d.getFeature(Index.class, Distribution.STREAMING));
    assertNotNull(d.getFeature(DistributionLogging.class, Distribution.DOWNLOAD));
    assertNotNull(d.getFeature(Cname.class, Distribution.DOWNLOAD));
    assertNotNull(d.getFeature(Cname.class, Distribution.WEBSITE));
}
Also used : DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) S3Session(ch.cyberduck.core.s3.S3Session) Purge(ch.cyberduck.core.cdn.features.Purge) DistributionLogging(ch.cyberduck.core.cdn.features.DistributionLogging) Host(ch.cyberduck.core.Host) Index(ch.cyberduck.core.cdn.features.Index) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Cname(ch.cyberduck.core.cdn.features.Cname) S3Protocol(ch.cyberduck.core.s3.S3Protocol) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 88 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class WebsiteCloudFrontDistributionConfigurationTest method testReadNoWebsiteConfiguration.

@Test
public void testReadNoWebsiteConfiguration() throws Exception {
    final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
    final Distribution distribution = configuration.read(container, Distribution.WEBSITE, new DisabledLoginCallback());
    assertEquals("The specified bucket does not have a website configuration", distribution.getStatus());
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) Distribution(ch.cyberduck.core.cdn.Distribution) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 89 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class WebsiteCloudFrontDistributionConfigurationTest method testGetName.

@Test
public void testGetName() {
    final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    assertEquals("Amazon CloudFront", configuration.getName());
}
Also used : DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 90 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class WebsiteCloudFrontDistributionConfigurationTest method testGetMethodsNonAWS.

@Test
public void testGetMethodsNonAWS() {
    final S3Session session = new S3Session(new Host(new S3Protocol(), "s3.cyberduck.io"));
    final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.DOWNLOAD));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.STREAMING));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.CUSTOM));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE_CDN));
    assertTrue(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
    assertFalse(configuration.getMethods(new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb_b", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) S3Session(ch.cyberduck.core.s3.S3Session) Host(ch.cyberduck.core.Host) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) S3Protocol(ch.cyberduck.core.s3.S3Protocol) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

DefaultX509KeyManager (ch.cyberduck.core.ssl.DefaultX509KeyManager)176 Test (org.junit.Test)155 DisabledX509TrustManager (ch.cyberduck.core.ssl.DisabledX509TrustManager)145 Host (ch.cyberduck.core.Host)136 IntegrationTest (ch.cyberduck.test.IntegrationTest)124 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)111 Credentials (ch.cyberduck.core.Credentials)103 DisabledCancelCallback (ch.cyberduck.core.DisabledCancelCallback)99 DisabledHostKeyCallback (ch.cyberduck.core.DisabledHostKeyCallback)97 Path (ch.cyberduck.core.Path)86 Scheme (ch.cyberduck.core.Scheme)51 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)45 Delete (ch.cyberduck.core.features.Delete)40 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)36 LoginOptions (ch.cyberduck.core.LoginOptions)31 LoginConnectionService (ch.cyberduck.core.LoginConnectionService)30 ProfilePlistReader (ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader)30 DefaultX509TrustManager (ch.cyberduck.core.ssl.DefaultX509TrustManager)30 TransferItem (ch.cyberduck.core.transfer.TransferItem)27 DisabledPasswordStore (ch.cyberduck.core.DisabledPasswordStore)26