Search in sources :

Example 11 with ObjectExpiration

use of ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration in project cyberduck by iterate-ch.

the class SDSSharesUrlProviderTest method testToUrlWeakPassword.

@Test(expected = InteroperabilityException.class)
public void testToUrlWeakPassword() throws Exception {
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new SDSTouchFeature(session, nodeid).touch(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
    try {
        final DescriptiveUrl url = new SDSSharesUrlProvider(session, nodeid).toDownloadUrl(test, new CreateDownloadShareRequest().expiration(new ObjectExpiration().enableExpiration(false)).notifyCreator(false).sendMail(false).mailRecipients(null).sendSms(false).password("p").mailSubject(null).mailBody(null).maxDownloads(null), new DisabledPasswordCallback());
    } finally {
        new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) ObjectExpiration(ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration) CreateDownloadShareRequest(ch.cyberduck.core.sds.io.swagger.client.model.CreateDownloadShareRequest) DescriptiveUrl(ch.cyberduck.core.DescriptiveUrl) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 12 with ObjectExpiration

use of ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration in project cyberduck by iterate-ch.

the class SDSSharesUrlProviderTest method testToUrlExpiryInvalidDate.

@Test(expected = InteroperabilityException.class)
public void testToUrlExpiryInvalidDate() throws Exception {
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new SDSTouchFeature(session, nodeid).touch(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
    final DescriptiveUrl url = new SDSSharesUrlProvider(session, nodeid).toDownloadUrl(test, new CreateDownloadShareRequest().expiration(new ObjectExpiration().enableExpiration(true).expireAt(new DateTime(17443L))).notifyCreator(false).sendMail(false).sendSms(false).password(null).mailRecipients(null).mailSubject(null).mailBody(null).maxDownloads(null), new DisabledPasswordCallback());
    assertNotEquals(DescriptiveUrl.EMPTY, url);
    assertEquals(DescriptiveUrl.Type.signed, url.getType());
    assertTrue(url.getUrl().startsWith("https://duck.dracoon.com/#/public/shares-downloads/"));
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) ObjectExpiration(ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration) CreateDownloadShareRequest(ch.cyberduck.core.sds.io.swagger.client.model.CreateDownloadShareRequest) DateTime(org.joda.time.DateTime) DescriptiveUrl(ch.cyberduck.core.DescriptiveUrl) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 13 with ObjectExpiration

use of ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration in project cyberduck by iterate-ch.

the class SDSSharesUrlProviderTest method testToUrlMissingEmailRecipients.

@Test(expected = InteroperabilityException.class)
public void testToUrlMissingEmailRecipients() throws Exception {
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new SDSTouchFeature(session, nodeid).touch(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
    try {
        final DescriptiveUrl url = new SDSSharesUrlProvider(session, nodeid).toDownloadUrl(test, new CreateDownloadShareRequest().expiration(new ObjectExpiration().enableExpiration(false)).notifyCreator(false).sendMail(true).mailRecipients(null).sendSms(false).password(null).mailSubject(null).mailBody(null).maxDownloads(null), new DisabledPasswordCallback());
    } finally {
        new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) ObjectExpiration(ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration) CreateDownloadShareRequest(ch.cyberduck.core.sds.io.swagger.client.model.CreateDownloadShareRequest) DescriptiveUrl(ch.cyberduck.core.DescriptiveUrl) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 14 with ObjectExpiration

use of ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration in project cyberduck by iterate-ch.

the class SDSSharesUrlProviderTest method testUploadAccountEncrypted.

@Test
public void testUploadAccountEncrypted() throws Exception {
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).createRoom(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), true);
    final Path folder = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
    final DescriptiveUrl url = new SDSSharesUrlProvider(session, nodeid).toUploadUrl(folder, new CreateUploadShareRequest().name(new AlphanumericRandomStringService().random()).expiration(new ObjectExpiration().enableExpiration(false)).notifyCreator(false).sendMail(false).sendSms(false).password(null).mailRecipients(null).mailSubject(null).mailBody(null).maxSize(null).maxSlots(null).notes(null).filesExpiryPeriod(null), new DisabledPasswordCallback());
    assertNotEquals(DescriptiveUrl.EMPTY, url);
    assertEquals(DescriptiveUrl.Type.signed, url.getType());
    assertTrue(url.getUrl().startsWith("https://duck.dracoon.com/#/public/shares-uploads/"));
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) ObjectExpiration(ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration) DescriptiveUrl(ch.cyberduck.core.DescriptiveUrl) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) CreateUploadShareRequest(ch.cyberduck.core.sds.io.swagger.client.model.CreateUploadShareRequest) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)14 DescriptiveUrl (ch.cyberduck.core.DescriptiveUrl)14 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)14 DisabledPasswordCallback (ch.cyberduck.core.DisabledPasswordCallback)14 Path (ch.cyberduck.core.Path)14 Delete (ch.cyberduck.core.features.Delete)14 ObjectExpiration (ch.cyberduck.core.sds.io.swagger.client.model.ObjectExpiration)14 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)14 IntegrationTest (ch.cyberduck.test.IntegrationTest)14 Test (org.junit.Test)14 CreateDownloadShareRequest (ch.cyberduck.core.sds.io.swagger.client.model.CreateDownloadShareRequest)11 CreateUploadShareRequest (ch.cyberduck.core.sds.io.swagger.client.model.CreateUploadShareRequest)3 DateTime (org.joda.time.DateTime)2 Credentials (ch.cyberduck.core.Credentials)1 Host (ch.cyberduck.core.Host)1 LoginOptions (ch.cyberduck.core.LoginOptions)1 VaultCredentials (ch.cyberduck.core.vault.VaultCredentials)1