use of org.sonatype.aether.repository.Authentication in project SSM by Intel-bigdata.
the class AbstractDependencyResolver method setProxy.
public void setProxy(URL proxyUrl, String proxyUser, String proxyPassword) {
Authentication auth = new Authentication(proxyUser, proxyPassword);
Proxy proxy = new Proxy(proxyUrl.getProtocol(), proxyUrl.getHost(), proxyUrl.getPort(), auth);
synchronized (repos) {
for (RemoteRepository repo : repos) {
repo.setProxy(proxy);
}
}
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class AsyncRepositoryConnector method getRealm.
private Realm getRealm(RemoteRepository repository, String credentialEncoding) {
Realm realm = null;
Authentication a = repository.getAuthentication();
if (a != null && a.getUsername() != null) {
realm = new Realm.RealmBuilder().setPrincipal(a.getUsername()).setPassword(a.getPassword()).setUsePreemptiveAuth(false).setEnconding(credentialEncoding).build();
}
return realm;
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class AsyncRepositoryConnector method getProxy.
private ProxyServer getProxy(RemoteRepository repository, String credentialEncoding) {
ProxyServer proxyServer = null;
Proxy p = repository.getProxy();
if (p != null) {
Authentication a = p.getAuthentication();
boolean useSSL = repository.getProtocol().equalsIgnoreCase("https") || repository.getProtocol().equalsIgnoreCase("dav:https");
if (a == null) {
proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort());
} else {
proxyServer = new ProxyServer(useSSL ? Protocol.HTTPS : Protocol.HTTP, p.getHost(), p.getPort(), a.getUsername(), a.getPassword());
proxyServer.setEncoding(credentialEncoding);
}
}
return proxyServer;
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class AuthWithNonAsciiCredentialsPutTest method before.
@Before
@Override
public void before() throws Exception {
super.before();
repository().setAuthentication(new Authentication("user-non-ascii", "\u00E4\u00DF"));
}
use of org.sonatype.aether.repository.Authentication in project sonatype-aether by sonatype.
the class ProxyPutTest method before.
@Override
@Before
public void before() throws Exception {
super.before();
Authentication auth = new Authentication("puser", "password");
Proxy proxy = new Proxy("http", "localhost", provider().getPort(), auth);
repository().setProxy(proxy);
}
Aggregations