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

Can you please provide support to pass X-Consul-Token in header #186

Open
bdhayakar opened this issue May 16, 2019 · 1 comment
Open

Can you please provide support to pass X-Consul-Token in header #186

bdhayakar opened this issue May 16, 2019 · 1 comment

Comments

@bdhayakar
Copy link

bdhayakar commented May 16, 2019

Hi,

Does the library support passing "X-Consul-Token" in headers.
As per consul documentation https://www.consul.io/api/index.html, passing token as query parameter is discouraged.
Is there a plan to implement this feature ?

Thanks
Dayakar

vgv added a commit that referenced this issue Sep 2, 2019
Step 1: Add support for headers in HttpTransport
vgv added a commit that referenced this issue Sep 6, 2019
@marcokrikke
Copy link

Seems this library still uses the token query parameter

UrlParameters tokenParams = token != null ? new SingleUrlParameters("token", token) : null;

This is deprecated and will be removed in Consul 1.17. From then on, only the X-Consul-Token header or a Bearer token are supported.

mehiel pushed a commit to mehiel/consul-api that referenced this issue May 5, 2023
Consul now warns aggressively when token is provided as a request param
and the X-Consul-Token is required. Also as already mentioned in Ecwid#186
token request param will be removed in Consul v1.17.

By reading the code and related PRs I've seen that in the so called
"new http architecture" this is addressed although not all clients fully
utilize the new Request class.

This PR uses the Request class for both Catalog and KV clients.

Should address both Ecwid#186 and Ecwid#237.
lucwillems pushed a commit to lucwillems/consul-api that referenced this issue Mar 27, 2024
Consul now warns aggressively when token is provided as a request param
and the X-Consul-Token is required. Also as already mentioned in Ecwid#186
token request param will be removed in Consul v1.17.

By reading the code and related PRs I've seen that in the so called
"new http architecture" this is addressed although not all clients fully
utilize the new Request class.

This PR uses the Request class for both Catalog and KV clients.

Should address both Ecwid#186 and Ecwid#237.
lucwillems added a commit to lucwillems/consul-api that referenced this issue Mar 27, 2024
- more places where token was still used as url parameter
- throw Hard Runtime error is we still use token as url parameter
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