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

Don't use http.DefaultClient #702

Merged
merged 3 commits into from
Oct 20, 2015
Merged

Don't use http.DefaultClient #702

merged 3 commits into from
Oct 20, 2015

Conversation

jefferai
Copy link
Member

This strips out http.DefaultClient everywhere I could immediately find
it. Too many things use it and then modify it in incompatible ways.

Unit tests pass, and additionally I ran the acceptance tests for GitHub auth.

Fixes #700, I believe.

@jefferai
Copy link
Member Author

@vishalnayak Could you test the SSH stuff when you get a chance?

This strips out http.DefaultClient everywhere I could immediately find
it. Too many things use it and then modify it in incompatible ways.

Fixes #700, I believe.
@@ -26,7 +26,7 @@ func TestBackend_Config(t *testing.T) {

login_data := map[string]interface{}{
// This token has to be replaced with a working token for the test to work.
"token": "4fb5f4f0738c7aea5ee06dd595f15236ea78918b",
"token": os.Getenv("GITHUB_TOKEN"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a big fan of this change, we should use a restricted token that we just keep around. This requires that for the test to pass we set a token. Also, this change is weirdly unrelated to the PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's related in that I was trying to ensure the acceptance tests worked since the GitHub backend is one of the ones most affected by this change. The static token isn't valid, so the acceptance tests currently always fail. GITHUB_TOKEN is already required for the acceptance tests; this just uses that same token value to attempt to run this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, if this is an acceptance test then this is okay.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the future this should likely be a separate PR though since it is unrealted.

@mitchellh
Copy link
Contributor

This PR also removes the X-Vault-Token header checking everywhere. Is this intended? It just wasn't present in the description of the PR.

@@ -21,6 +21,7 @@ BUG FIXES:
* core: Stale leader entries will now be reaped [GH-679]
* core: Using `mount-tune` on the auth/token path did not take effect. [GH-688]
* core: Fix a potential race condition when (un)sealing the vault with metrics enabled [GH-694]
* everywhere: Don't use http.DefaultClient, as it shares state implicitly and is a source of hard-to-track-down bugs [GH-700]
Copy link
Contributor

Choose a reason for hiding this comment

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

split on 80 chars please

@mitchellh
Copy link
Contributor

Sorry it just looks like it was the forwarding but since we got rid of all redirect support, its fine.

LGTM

jefferai added a commit that referenced this pull request Oct 20, 2015
@jefferai jefferai merged commit 0968bd9 into master Oct 20, 2015
@jefferai jefferai deleted the no-default-httpclient branch October 20, 2015 17:07
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