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());
}
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());
}
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());
}
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());
}
Aggregations