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

Fix bug with unused (replaced with "") CONSUL_HTTP_AUTH in some places #3395

Merged
merged 1 commit into from
Aug 18, 2017

Conversation

Illirgway
Copy link
Contributor

example: https://github.com/hashicorp/consul/blob/master/watch/plan.go#L26

conf := consulapi.DefaultConfig()
conf.Address = address
conf.Datacenter = p.Datacenter
conf.Token = p.Token                             # <-- replace Token from DefaultConfig/CONSUL_HTTP_AUTH with "" if no "-token"
client, err := consulapi.NewClient(conf)

how to reproduce bug:
0. consul -> localhost:8500 with more than 0 service checks

  1. deny all for anonymous token
  2. create appropriate acl for watch checks (agent:read + node:read,service:read)
  3. bash:
    CONSUL_HTTP_AUTH= consul watch -http-addr=localhost:8500 -type=checks # --> return []
    consul watch -http-addr=localhost:8500 -type=checks -token= # -> return { .... right json result .... }

example: https://github.com/hashicorp/consul/blob/master/watch/plan.go#L26

	conf := consulapi.DefaultConfig()
	conf.Address = address
	conf.Datacenter = p.Datacenter
	conf.Token = p.Token                             # <-- replace Token from DefaultConfig/CONSUL_HTTP_AUTH with ""
	client, err := consulapi.NewClient(conf)

how to reproduce bug:
0. consul -> localhost:8500 with more than 0 service checks
1. deny all for anonymous token
2. create appropriate acl <token> for watch checks (agent:read + node:read,service:read)
3. bash:
CONSUL_HTTP_AUTH=<token> consul watch -http-addr=localhost:8500 -type=checks # --> return []
consul watch -http-addr=localhost:8500 -type=checks -token=<token> # -> return { .... right json result .... }
@preetapan preetapan merged commit 15e0647 into hashicorp:master Aug 18, 2017
@preetapan
Copy link
Member

Thanks for the fix, @Illirgway

@Illirgway Illirgway deleted the patch-1 branch August 22, 2017 08:24
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.

None yet

2 participants