Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack upload uses HTTP digest authentication #2584

Merged
merged 3 commits into from
Sep 15, 2016
Merged

stack upload uses HTTP digest authentication #2584

merged 3 commits into from
Sep 15, 2016

Conversation

snoyberg
Copy link
Contributor

No description provided.

@snoyberg
Copy link
Contributor Author

I'll be pushing a new commit shortly, once http-client-tls-0.3.1 is available on the indices.

@snoyberg snoyberg force-pushed the digest-auth branch 3 times, most recently from 79ca553 to b24424e Compare September 13, 2016 04:12
@Blaisorblade
Copy link
Collaborator

stack-8.0.yaml needs an extra-dep—Travis gives http-client-tls: needed (>=0.3.1), 0.3.0 found (https://travis-ci.org/commercialhaskell/stack/jobs/159490050#L224).

@snoyberg
Copy link
Contributor Author

Ugh, I missed one! Hold on...

@snoyberg
Copy link
Contributor Author

I've just pushed another commit which bumps to http-client-0.5.3.1, due to: snoyberg/http-client#225.

@@ -187,7 +187,7 @@ library
, hit
, hpc
, http-client >= 0.5.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, shouldn't d52c9bc also increase the cabal bound to http-client >= 0.5.3.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a good idea.

Without this, using stack upload with digest support triggers
snoyberg/http-client#225. This change could arguably be made in a
separate PR, but including with digest support since it would be a very
dangerous idea to not bump the http-client version.
putStr $ "Uploading " ++ tarName ++ "... "
hFlush stdout
withResponse req3 manager $ \res ->
withResponse (fromMaybe req2 mreq3) manager $ \res ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we handle applyDigestAuth failing, I'd prefer to have it logged, with sth. better than:

when (isNull mreq3)
  $logWarn "Failure in applyDigestAuth"

So if a submission without password fails, there's a chance to realize that's because digest authentication failed, not because we didn't try authentication.

BTW sorry for thinking about this now, I realize multiple reviews are annoying 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary. If mreq3 is Nothing, then we're going to retry the same request again, and when it (almost) inevitably fails, we'll display the error message from the server to the user.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that; my point is, I'd expect the error would be misleading. If anything hinted at "no password provided", I'd wonder why stack isn't providing a password, not why Hackage is rejecting digest authentication. I'm not implying some hypothetical user would be confused, I'm implying I would be confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I'm not sure what message would be better than the proposed "Failure in applyDigestAuth."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one's fine then!

@Blaisorblade
Copy link
Collaborator

Other than this comment, LGTM. I'll leave merging to you 😉

@snoyberg snoyberg merged commit 448d9a9 into master Sep 15, 2016
@snoyberg snoyberg deleted the digest-auth branch September 15, 2016 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants