public Authentication getAuthentication() { Authentication auth = null; if (this.username != null && this.password != null) { auth = new Authentication(this.username, this.password); } return auth; }
public Proxy getProxy() { if (isNotBlank(proxyHost) && proxyPort != null) { if (isNotBlank(proxyLogin)) { return new Proxy(proxyProtocol, proxyHost, proxyPort, new Authentication(proxyLogin, proxyPassword)); } else { return new Proxy(proxyProtocol, proxyHost, proxyPort, null); } } return null; }
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); } } }
/** * Get the Authentication object. * @return The Authentication object. */ public Authentication getAuthentication() { return new Authentication( this.username, this.password, this.privatekeyfile, this.passphrase ); } }
private Authentication setPassphraseInternal( char[] passphrase ) { if ( Arrays.equals( this.passphrase, passphrase ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication setPasswordInternal( char[] password ) { if ( Arrays.equals( this.password, password ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication setPassphraseInternal( char[] passphrase ) { if ( Arrays.equals( this.passphrase, passphrase ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication setPassphraseInternal( char[] passphrase ) { if ( Arrays.equals( this.passphrase, passphrase ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication setPasswordInternal( char[] password ) { if ( Arrays.equals( this.password, password ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication setPasswordInternal( char[] password ) { if ( Arrays.equals( this.password, password ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
private Authentication getAuthentication(Map<String, String> proxy) { // user, pass if (proxy.containsKey("user")) { return new Authentication(proxy.get("user"), proxy.get("pass")); } return null; }
/** * Sets the username to use for authentication. * * @param username The username, may be {@code null}. * @return The new authentication, never {@code null}. */ public Authentication setUsername( String username ) { if ( eq( this.username, username ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
/** * Sets the username to use for authentication. * * @param username The username, may be {@code null}. * @return The new authentication, never {@code null}. */ public Authentication setUsername( String username ) { if ( eq( this.username, username ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
/** * Sets the path to the private key file to use for authentication. * * @param privateKeyFile The path to the private key file, may be {@code null}. * @return The new authentication, never {@code null}. */ public Authentication setPrivateKeyFile( String privateKeyFile ) { if ( eq( this.privateKeyFile, privateKeyFile ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
/** * Sets the path to the private key file to use for authentication. * * @param privateKeyFile The path to the private key file, may be {@code null}. * @return The new authentication, never {@code null}. */ public Authentication setPrivateKeyFile( String privateKeyFile ) { if ( eq( this.privateKeyFile, privateKeyFile ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
/** * Sets the path to the private key file to use for authentication. * * @param privateKeyFile The path to the private key file, may be {@code null}. * @return The new authentication, never {@code null}. */ public Authentication setPrivateKeyFile( String privateKeyFile ) { if ( eq( this.privateKeyFile, privateKeyFile ) ) { return this; } return new Authentication( username, privateKeyFile, password, passphrase ); }
Identity identity = injector.getInstance(Identity.class); Authentication auth = new Authentication(); Identity authenticated = auth.authenticate("login","password"); identity.setUid(authenticated.getUid()); identity.setName(authenticated.getName());
public static org.sonatype.aether.repository.Proxy convertFromMavenProxy(org.apache.maven.settings.Proxy proxy) { org.sonatype.aether.repository.Proxy result = null; if (proxy != null) { Authentication auth = new Authentication(proxy.getUsername(), proxy.getPassword()); result = new org.sonatype.aether.repository.Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), auth); } return result; }
private static RemoteRepository makeRemoteRepository(Metadata.Repository info, Server server, boolean snapshot) { return new RemoteRepository(info.getId(), "default", info.getUri()) .setPolicy(true, new RepositoryPolicy(snapshot, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_FAIL)) .setPolicy(false, new RepositoryPolicy(!snapshot, RepositoryPolicy.UPDATE_POLICY_ALWAYS, RepositoryPolicy.CHECKSUM_POLICY_FAIL)) .setAuthentication(new Authentication(server.getUsername(), server.getPassword())); }
static RemoteRepository convertToMavenRepo(final DependencyRepository repo, final Settings settings) { RemoteRepository remoteRepository = new RemoteRepository(repo.getId(), "default", repo.getUrl()); Proxy activeProxy = settings.getActiveProxy(); if (activeProxy != null) { Authentication auth = new Authentication(activeProxy.getUsername(), activeProxy.getPassword()); remoteRepository.setProxy(new org.sonatype.aether.repository.Proxy(activeProxy.getProtocol(), activeProxy .getHost(), activeProxy.getPort(), auth)); } return remoteRepository; }