Skip to content

Making requests_client.py's Authenticator URL matches() port-tolerant#384

Open
myselfhimself wants to merge 1 commit into
Yelp:masterfrom
myselfhimself:myselfhimself-non-port-tolerant-authenticator-matches
Open

Making requests_client.py's Authenticator URL matches() port-tolerant#384
myselfhimself wants to merge 1 commit into
Yelp:masterfrom
myselfhimself:myselfhimself-non-port-tolerant-authenticator-matches

Conversation

@myselfhimself
Copy link
Copy Markdown

Authenticator::matches()'s documentation advertises full host, scheme and port match, when it just checks for hosts. However when checking hosts, it cannot compare well a configured self.host:withPort (eg. localhost:8080) with the outgoing request full URL's host.
Such a corner case can happen with this piece of code:
http_client.set_basic_auth(
'localhost:8080',
BASIC_AUTH_LOGIN, BASIC_AUTH_PASSWORD
)

Authenticator::matches()'s documentation advertises full host, scheme and port match, when it just checks for hosts. However when checking hosts, it cannot compare well a configured self.host:withPort (eg. localhost:8080) with the outgoing request full URL's host.
Such a corner case can happen with this piece of code:
http_client.set_basic_auth(
        'localhost:8080',
        BASIC_AUTH_LOGIN, BASIC_AUTH_PASSWORD
    )
@myselfhimself
Copy link
Copy Markdown
Author

Same issue with the set_api_key() method. This makes authenticated bravado requests fail when unit testing on a local server hosted at localhost:8080..

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 19, 2018

Coverage Status

Coverage remained the same at 98.499% when pulling 16cf8ea on myselfhimself:myselfhimself-non-port-tolerant-authenticator-matches into d30b9bd on Yelp:master.

@axsapronov
Copy link
Copy Markdown

⬆️

@myselfhimself
Copy link
Copy Markdown
Author

myselfhimself commented Nov 26, 2019 via email

@sjaensch
Copy link
Copy Markdown
Contributor

sjaensch commented Feb 6, 2020

This has been reworked in the meantime (in #444), and now compares host and port (correctly). Are you able to test with the latest master and confirm that it fixes the issue for you @myselfhimself ? I could then make a release that includes the change.

@myselfhimself
Copy link
Copy Markdown
Author

myselfhimself commented Feb 7, 2020 via email

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.

4 participants