Search in sources :

Example 36 with LoginConnectionService

use of ch.cyberduck.core.LoginConnectionService in project cyberduck by iterate-ch.

the class AbstractDriveTest method setup.

@Before
public void setup() throws Exception {
    final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new DriveProtocol())));
    final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Google Drive.cyberduckprofile"));
    final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials("cyberduck"));
    session = new DriveSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
    final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            fail(reason);
            return null;
        }
    }, new DisabledHostKeyCallback(), new TestPasswordStore(), new DisabledProgressListener());
    login.check(session, new DisabledCancelCallback());
}
Also used : DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) LoginConnectionService(ch.cyberduck.core.LoginConnectionService) Host(ch.cyberduck.core.Host) ProfilePlistReader(ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader) Profile(ch.cyberduck.core.Profile) ProtocolFactory(ch.cyberduck.core.ProtocolFactory) LoginOptions(ch.cyberduck.core.LoginOptions) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Credentials(ch.cyberduck.core.Credentials) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Before(org.junit.Before)

Example 37 with LoginConnectionService

use of ch.cyberduck.core.LoginConnectionService in project cyberduck by iterate-ch.

the class AbstractAzureTest method setup.

@Before
public void setup() throws Exception {
    final Host host = new Host(new AzureProtocol(), "kahy9boj3eib.blob.core.windows.net", new Credentials(System.getProperties().getProperty("azure.account"), System.getProperties().getProperty("azure.key")));
    session = new AzureSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) {
            fail(reason);
            return null;
        }
    }, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
    login.check(session, new DisabledCancelCallback());
}
Also used : DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) LoginConnectionService(ch.cyberduck.core.LoginConnectionService) Host(ch.cyberduck.core.Host) LoginOptions(ch.cyberduck.core.LoginOptions) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) Credentials(ch.cyberduck.core.Credentials) Before(org.junit.Before)

Example 38 with LoginConnectionService

use of ch.cyberduck.core.LoginConnectionService in project cyberduck by iterate-ch.

the class AbstractB2Test method setup.

@Before
public void setup() throws Exception {
    final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new B2Protocol())));
    final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/B2.cyberduckprofile"));
    session = new B2Session(new Host(profile, profile.getDefaultHostname(), new Credentials(System.getProperties().getProperty("b2.user"), System.getProperties().getProperty("b2.key"))), new DefaultX509TrustManager(), new DefaultX509KeyManager());
    final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            fail(reason);
            return null;
        }
    }, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
    login.check(session, new DisabledCancelCallback());
}
Also used : DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) LoginConnectionService(ch.cyberduck.core.LoginConnectionService) Host(ch.cyberduck.core.Host) ProfilePlistReader(ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader) Profile(ch.cyberduck.core.Profile) ProtocolFactory(ch.cyberduck.core.ProtocolFactory) LoginOptions(ch.cyberduck.core.LoginOptions) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) Credentials(ch.cyberduck.core.Credentials) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Before(org.junit.Before)

Example 39 with LoginConnectionService

use of ch.cyberduck.core.LoginConnectionService in project cyberduck by iterate-ch.

the class AzureSessionTest method testConnectSharedAccessSignature.

@Test
public void testConnectSharedAccessSignature() throws Exception {
    final Host host = new Host(new AzureProtocol() {

        @Override
        public boolean isUsernameConfigurable() {
            return false;
        }

        @Override
        public boolean isPasswordConfigurable() {
            return false;
        }

        @Override
        public boolean isTokenConfigurable() {
            return true;
        }
    }, "kahy9boj3eib.blob.core.windows.net", new Credentials(null, null, "?sv=2017-07-29&ss=bfqt&srt=sco&sp=rwdlacup&se=2030-05-20T04:29:30Z&st=2018-05-09T20:29:30Z&spr=https&sig=bMKAZ3tXmX%2B56%2Bb5JhHAeWnMOpMp%2BoYlHDIAZVAjHzE%3D"));
    final AzureSession session = new AzureSession(host);
    final LoginConnectionService connect = new LoginConnectionService(new DisabledLoginCallback(), new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
    connect.connect(session, new DisabledCancelCallback());
    assertTrue(session.isConnected());
    session.close();
    assertFalse(session.isConnected());
}
Also used : DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) LoginConnectionService(ch.cyberduck.core.LoginConnectionService) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) Host(ch.cyberduck.core.Host) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) Credentials(ch.cyberduck.core.Credentials) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

DisabledCancelCallback (ch.cyberduck.core.DisabledCancelCallback)39 DisabledHostKeyCallback (ch.cyberduck.core.DisabledHostKeyCallback)39 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)39 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)39 LoginConnectionService (ch.cyberduck.core.LoginConnectionService)39 Credentials (ch.cyberduck.core.Credentials)35 Host (ch.cyberduck.core.Host)35 DisabledPasswordStore (ch.cyberduck.core.DisabledPasswordStore)33 DefaultX509KeyManager (ch.cyberduck.core.ssl.DefaultX509KeyManager)30 LoginOptions (ch.cyberduck.core.LoginOptions)27 IntegrationTest (ch.cyberduck.test.IntegrationTest)21 Test (org.junit.Test)21 Before (org.junit.Before)18 Profile (ch.cyberduck.core.Profile)16 ProtocolFactory (ch.cyberduck.core.ProtocolFactory)16 ProfilePlistReader (ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader)16 DefaultX509TrustManager (ch.cyberduck.core.ssl.DefaultX509TrustManager)15 DisabledX509TrustManager (ch.cyberduck.core.ssl.DisabledX509TrustManager)15 Scheme (ch.cyberduck.core.Scheme)13 LoginCanceledException (ch.cyberduck.core.exception.LoginCanceledException)9