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

Replace token query with header attribute #51

Closed
wants to merge 1 commit into from
Closed

Conversation

mbrulatout
Copy link
Contributor

@mbrulatout mbrulatout commented Aug 24, 2023

See : https://developer.hashicorp.com/consul/api-docs/api-structure
The "?token=" query parameter is deprecated and will be removed in Consul 1.17.

@pierrecdn pierrecdn changed the title [WIP] Replace token query with header attribute Replace token query with header attribute Aug 25, 2023
Copy link
Member

@pierrecdn pierrecdn left a comment

Choose a reason for hiding this comment

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

For future readability, you should duplicate the content of the commit message within the PR.

self._session = aiohttp.ClientSession(connector=connector, **session_kwargs)

async def _request(self, callback, method, uri, data=None, connections_timeout=None):
async def _request(self, callback, method, uri, data=None, connections_timeout=None, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we explicitly pass and propagate a "headers" argument instead?
kwargs is quite lax, consequently you won't be able to do that for another use-case in the future.

Copy link

Choose a reason for hiding this comment

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

agree

Copy link

Choose a reason for hiding this comment

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

@mbrulatout any blocker on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it just got lost.
Not sure about the scope of the comment though. Is it line/file specific or global ?
Assuming it's about getting rid of **kwargs everywhere it's been introduced, I'm not a big fan.
I suppose we could keep the **kwargs up to the get/put/post/delete, which would be in charge of building and passing the "headers" arg to _request(...)

See : https://developer.hashicorp.com/consul/api-docs/api-structure
The "?token=" query parameter is deprecated and will be removed in Consul 1.17.
@mbrulatout mbrulatout changed the base branch from tooling to master February 2, 2024 13:28
@mbrulatout
Copy link
Contributor Author

rebase only, comments haven't been processed

@dclaisse dclaisse removed their request for review July 9, 2024 12:22
@mbrulatout mbrulatout closed this Nov 25, 2024
@mbrulatout mbrulatout deleted the token_header branch November 25, 2024 22:25
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.

3 participants