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

CONSUL_HTTP_TOKEN doesn't provide access to all keys #18

Open
duffrecords opened this issue Jan 9, 2017 · 3 comments
Open

CONSUL_HTTP_TOKEN doesn't provide access to all keys #18

duffrecords opened this issue Jan 9, 2017 · 3 comments

Comments

@duffrecords
Copy link

When I provide a management token in the CONSUL_HTTP_TOKEN environment variable, the resulting backup only contains the key/value pairs that I would see with an anonymous token. Using the same management token in the Consul web UI, I can see everything. I put some debug statements in the consul-snapshot code and confirmed the correct token is read with os.Getenv("CONSUL_HTTP_TOKEN") in consul-snapshot/vendor/github.com/hashicorp/consul/api/api.go.

@duffrecords
Copy link
Author

More specifically, the only keys in the backup are those beginning with "global/" but none of the "local/" keys are there.

@pshima
Copy link
Owner

pshima commented Jan 10, 2017

This sounds like a bug thanks for reporting @duffrecords, I'll take a closer look at it when I have some time.

@duffrecords
Copy link
Author

duffrecords commented Jan 10, 2017

I was able to get it to work by setting CONSUL_HTTP_ADDR to 'localhost:8500' but setting it to 'fqdn.of.consul.server:8500' only retrieves keys that are visible with the anonymous token. Apparently the tool is able to authenticate with the local Consul client but not directly with the Consul server itself (I'm running consul-snapshot on a different machine than the Consul server).

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

No branches or pull requests

2 participants