A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/commercialhaskell/stack/issues/5509 below:

Support basic auth in package-indices · Issue #5509 · commercialhaskell/stack · GitHub

Please follow the steps below for reporting a bug:

Make sure that you are using the latest release (currently stack-2.5.1).
See the upgrade instructions to upgrade.

Please use the following schema for your bug report:

General summary/comments (optional)

We're trying to set up a company internal proxy for Hackage, so we're trying to set download-prefix in package-indices to https://username:password@internal-hackage.leapyear.io.

TL;DR pantry's get function in Hackage.Security.Client.Repository.HttpLib.HttpClient

Steps to reproduce

Specify a URL in download-prefix with username/password. rm -rf stack.yaml.lock. When running stack build, check network traces and notice that username/password isn't being propagated.

Expected

It should download files from our proxy with user credentials

Actual

First problem: we get an error about root.json:

Could not deserialize <repo>/root.json: Schema error: Expected field "signed"

which is weird because if we curl the URL, we load root.json fine. With some debug statements, we found out that our proxy is actually returning a JSON object saying Authentication is required. This ticket is filed here: haskell/hackage-security#251

So after debugging the first issue, we find out that stack is somehow not propagating the basic auth credentials. Then I printed out uri in Hackage.Security.Client.Repository.Remote.getFile.download and it shows the URI with the basic auth credentials, so up to that point it keeps the basic auth around. But then it calls httpGet which pantry implements in its own implementation of Hackage.Security.Client.Repository.HttpLib.HttpClient, and there it calls setRequestHeaders, which seems to override the Authorization header set in setUri.

Stack version

Built from master

Method of installation

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4