private String printCollectRequest(CollectRequest collectRequest) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("["); Iterator<RemoteRepository> iterator = collectRequest.getRepositories().iterator(); while (iterator.hasNext()) { RemoteRepository remoteRepository = iterator.next(); stringBuilder.append(remoteRepository); stringBuilder.append("->authentication["); if (remoteRepository.getAuthentication() != null) { stringBuilder.append(remoteRepository.getAuthentication()); } stringBuilder.append("]"); if (iterator.hasNext()) { stringBuilder.append(", "); } } stringBuilder.append("]"); return collectRequest.getRoot() + " -> " + collectRequest.getDependencies() + " < " + stringBuilder.toString(); }
public Authentication getAuthentication( RemoteRepository repository ) { return repository.getAuthentication(); }
public Authentication getAuthentication( RemoteRepository repository ) { return repository.getAuthentication(); }
/** * Gets an authentication context for the specified repository. * * @param session The repository system session during which the repository is accessed, must not be {@code null}. * @param repository The repository for which to create an authentication context, must not be {@code null}. * @return An authentication context for the repository or {@code null} if no authentication is configured for it. */ public static AuthenticationContext forRepository( RepositorySystemSession session, RemoteRepository repository ) { return newInstance( session, repository, null, repository.getAuthentication() ); }
public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); }
public Authentication getAuthentication( RemoteRepository repository ) { Authentication auth = repository.getAuthentication(); if ( auth != null ) { return auth; } return selector.getAuthentication( repository ); }
/** * Gets an authentication context for the specified repository. * * @param session The repository system session during which the repository is accessed, must not be {@code null}. * @param repository The repository for which to create an authentication context, must not be {@code null}. * @return An authentication context for the repository or {@code null} if no authentication is configured for it. */ public static AuthenticationContext forRepository( RepositorySystemSession session, RemoteRepository repository ) { return newInstance( session, repository, null, repository.getAuthentication() ); }
/** * Sets the authentication to use in order to access the repository. * * @param authentication The authentication to use, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setAuthentication( Authentication authentication ) { this.authentication = authentication; if ( prototype != null ) { delta( AUTH, this.authentication, prototype.getAuthentication() ); } return this; }
/** * Sets the authentication to use in order to access the repository. * * @param authentication The authentication to use, may be {@code null}. * @return This builder for chaining, never {@code null}. */ public Builder setAuthentication( Authentication authentication ) { this.authentication = authentication; if ( prototype != null ) { delta( AUTH, this.authentication, prototype.getAuthentication() ); } return this; }
private String printCollectRequest(CollectRequest collectRequest) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("["); Iterator<RemoteRepository> iterator = collectRequest.getRepositories().iterator(); while (iterator.hasNext()) { RemoteRepository remoteRepository = iterator.next(); stringBuilder.append(remoteRepository); stringBuilder.append("->authentication["); if (remoteRepository.getAuthentication() != null) { stringBuilder.append(remoteRepository.getAuthentication()); } stringBuilder.append("]"); if (iterator.hasNext()) { stringBuilder.append(", "); } } stringBuilder.append("]"); return collectRequest.getRoot() + " -> " + collectRequest.getDependencies() + " < " + stringBuilder.toString(); }
/** * Capture deployed artifacts remote repo config for later use in uploading the buildinfo for the artifact. */ private void logRepositoryConfiguration(final ArtifactOperationDTO operation, final RepositoryEvent event) { if (event.getRepository() != null) { log.debug("Repo type: {}; info {}", event.getRepository().getClass(), event.getRepository()); } if (ArtifactOperationDTO.DEPLOYED.equals(operation)) { ArtifactRepository repository = event.getRepository(); if (repository instanceof RemoteRepository) { RemoteRepository remoteRepo = (RemoteRepository) repository; log.debug("Deploy info for remote repository: {}", repository); log.debug(" Authentication: {}", remoteRepo.getAuthentication()); } } }
/** * Gets the fingerprint for the authentication of the specified repository. * * @param session The repository system session during which the fingerprint is requested, must not be {@code null}. * @param repository The repository whose authentication is to be fingerprinted, must not be {@code null}. * @return The fingerprint of the repository authentication or an empty string if no authentication is configured, * never {@code null}. */ public static String forRepository( RepositorySystemSession session, RemoteRepository repository ) { String digest = ""; Authentication auth = repository.getAuthentication(); if ( auth != null ) { AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, null ); auth.digest( authDigest ); digest = authDigest.digest(); } return digest; }
/** * Gets the fingerprint for the authentication of the specified repository. * * @param session The repository system session during which the fingerprint is requested, must not be {@code null}. * @param repository The repository whose authentication is to be fingerprinted, must not be {@code null}. * @return The fingerprint of the repository authentication or an empty string if no authentication is configured, * never {@code null}. */ public static String forRepository( RepositorySystemSession session, RemoteRepository repository ) { String digest = ""; Authentication auth = repository.getAuthentication(); if ( auth != null ) { AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, null ); auth.digest( authDigest ); digest = authDigest.digest(); } return digest; }
buffer.append( " for " ).append( repository.getUrl() ); Authentication auth = repository.getAuthentication(); if ( auth != null )
private RemoteRepository applyAuthentication(RemoteRepository repository) { if (repository.getAuthentication() == null) { RemoteRepository.Builder builder = new RemoteRepository.Builder(repository); builder.setAuthentication(this.session.getAuthenticationSelector() .getAuthentication(repository)); repository = builder.build(); } return repository; }
return false; Authentication auth = repo.getAuthentication(); Class<? extends Authentication> class1 = auth.getClass(); try {
return false; Authentication auth = repo.getAuthentication(); Class<? extends Authentication> class1 = auth.getClass(); try {
return false; Authentication auth = repo.getAuthentication(); Class<? extends Authentication> class1 = auth.getClass(); try {
private RemoteRepository getRemoteRepository( RepositorySystemSession session, ArtifactRepository remoteRepository ) throws ArtifactDeployerException { // CHECKSTYLE_OFF: LineLength RemoteRepository aetherRepo = (RemoteRepository) Invoker.invoke( RepositoryUtils.class, "toRepo", org.apache.maven.artifact.repository.ArtifactRepository.class, remoteRepository ); // CHECKSTYLE_ON: LineLength if ( aetherRepo.getAuthentication() == null || aetherRepo.getProxy() == null ) { RemoteRepository.Builder builder = new RemoteRepository.Builder( aetherRepo ); if ( aetherRepo.getAuthentication() == null ) { builder.setAuthentication( session.getAuthenticationSelector().getAuthentication( aetherRepo ) ); } if ( aetherRepo.getProxy() == null ) { builder.setProxy( session.getProxySelector().getProxy( aetherRepo ) ); } aetherRepo = builder.build(); } return aetherRepo; } }
public LocalState( RepositorySystemSession session, RemoteRepository repo, SslConfig sslConfig ) { global = GlobalState.get( session ); userToken = this; if ( global == null ) { connMgr = GlobalState.newConnectionManager( sslConfig ); userTokenKey = null; expectContinueKey = null; authSchemePools = new ConcurrentHashMap<HttpHost, AuthSchemePool>(); } else { connMgr = global.getConnectionManager( sslConfig ); userTokenKey = new CompoundKey( repo.getId(), repo.getUrl(), repo.getAuthentication(), repo.getProxy() ); expectContinueKey = new CompoundKey( repo.getUrl(), repo.getProxy() ); authSchemePools = global.getAuthSchemePools(); } if ( !ConfigUtils.getBoolean( session, true, CONFIG_PROP_WEBDAV + '.' + repo.getId(), CONFIG_PROP_WEBDAV ) ) { webDav = false; } }