use of org.commonjava.util.jhttpc.auth.MemoryPasswordManager in project indy by Commonjava.
the class AbstractKojiIT method setupKojiBase.
@Before
public void setupKojiBase() {
System.out.println("\n\n #### SETUP: " + name.getMethodName() + " #### \n\n");
passwordManager = new MemoryPasswordManager();
factory = new HttpFactory(passwordManager);
System.out.println("\n\n #### START: " + name.getMethodName() + " #### \n\n");
String buildDir = System.getProperty("project.build.directory", "target");
downloadDir = Paths.get(buildDir, "downloads", name.getMethodName()).toFile();
downloadDir.mkdirs();
}
use of org.commonjava.util.jhttpc.auth.MemoryPasswordManager in project indy by Commonjava.
the class DownloadDiagBundleTest method createIndyClient.
protected Indy createIndyClient() throws IndyClientException {
SiteConfig config = new SiteConfigBuilder("indy", fixture.getUrl()).withRequestTimeoutSeconds(120).build();
Collection<IndyClientModule> modules = getAdditionalClientModules();
return new Indy(config, new MemoryPasswordManager(), new IndyObjectMapper(getAdditionalMapperModules()), modules.toArray(new IndyClientModule[modules.size()]));
}
use of org.commonjava.util.jhttpc.auth.MemoryPasswordManager in project indy by Commonjava.
the class AbstractIndyFunctionalTest method createIndyClient.
protected Indy createIndyClient() throws IndyClientException {
SiteConfig config = new SiteConfigBuilder("indy", fixture.getUrl()).withRequestTimeoutSeconds(60).build();
Collection<IndyClientModule> modules = getAdditionalClientModules();
return new Indy(config, new MemoryPasswordManager(), new IndyObjectMapper(getAdditionalMapperModules()), modules.toArray(new IndyClientModule[modules.size()]));
}
use of org.commonjava.util.jhttpc.auth.MemoryPasswordManager in project indy by Commonjava.
the class KojiMavenMetadataProviderTest method initKojiClient.
private void initKojiClient(String exchangeName, boolean verifyArtifacts) throws IOException, GalleyInitException, IndyDataException, KojiClientException {
StoreDataManager storeDataManager = new MemoryStoreDataManager(true);
if (verifyArtifacts) {
RemoteRepository verifyRepo = new RemoteRepository(MAVEN_PKG_KEY, VERIFY_REPO, server.formatUrl(VERIFY_BASEPATH));
storeDataManager.storeArtifactStore(verifyRepo, new ChangeSummary(ChangeSummary.SYSTEM_USER, "Adding verification repo"), false, true, new EventMetadata());
kojiConfig.setArtifactAuthorityStore(new StoreKey(MAVEN_PKG_KEY, remote, VERIFY_REPO).toString());
}
String resourceBase = "koji-metadata/" + exchangeName;
configureKojiServer(server, KOJI_BASEPATH, counter, resourceBase, verifyArtifacts, VERIFY_BASEPATH);
kojiClient = new KojiClient(kojiConfig, new MemoryPasswordManager(), Executors.newCachedThreadPool());
GalleyCore galley = new GalleyCoreBuilder(new FileCacheProviderFactory(temp.newFolder("cache"))).withEnabledTransports(new HttpClientTransport(new HttpImpl(new org.commonjava.maven.galley.auth.MemoryPasswordManager()), new IndyObjectMapper(true), new GlobalHttpConfiguration(), null, null)).build();
WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DownloadManager downloadManager = new DefaultDownloadManager(storeDataManager, galley.getTransferManager(), new IndyLocationExpander(storeDataManager), rescanService);
WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DirectContentAccess directContentAccess = new DefaultDirectContentAccess(downloadManager, contentAccessService);
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, contentAccessService);
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
KojiBuildAuthority buildAuthority = new KojiBuildAuthority(kojiConfig, new StandardTypeMapper(), kojiClient, storeDataManager, contentDigester, directContentAccess, cacheManager);
WeftExecutorService kojiMDService = new PoolWeftExecutorService("test-koji-metadata-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
provider = new KojiMavenMetadataProvider(this.cache, kojiClient, buildAuthority, kojiConfig, kojiMDService, cacheManager);
}
use of org.commonjava.util.jhttpc.auth.MemoryPasswordManager in project indy by Commonjava.
the class KojijiProvider method start.
@Override
public void start() throws IndyLifecycleException {
if (!config.isEnabled()) {
return;
}
kojiPasswordManager = new MemoryPasswordManager();
if (config.getProxyPassword() != null) {
kojiPasswordManager.bind(config.getProxyPassword(), config.getKojiSiteId(), PasswordType.PROXY);
}
if (config.getKeyPassword() != null) {
kojiPasswordManager.bind(config.getKeyPassword(), config.getKojiSiteId(), PasswordType.KEY);
}
try {
if (indyMetricsConfig.isKojiMetricEnabled()) {
kojiClient = new KojiClient(config, kojiPasswordManager, kojiExecutor, metricRegistry);
} else {
kojiClient = new KojiClient(config, kojiPasswordManager, kojiExecutor);
}
} catch (KojiClientException e) {
throw new IndyLifecycleException("Failed to initialize Koji client.", e);
}
versionMetadataLocks = new Locker<>();
}
Aggregations