-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Use authenticated_url when accessing HTTP BASIC repository #10432
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideUpdated HTTP repository request URL construction to use the authenticated_url property for endpoints, ensuring HTTP Basic credentials are included when accessing the repository. Class diagram for updated HTTP repository URL usageclassDiagram
class HttpRepository {
- _url: str
- authenticated_url: str
- session: requests.Session
+ _get_response(endpoint: str): requests.Response | None
...
}
HttpRepository : _get_response now uses authenticated_url for requests
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -401,7 +401,7 @@ def calculate_sha256(self, link: Link) -> str | None: | |||
return None | |||
|
|||
def _get_response(self, endpoint: str) -> requests.Response | None: | |||
url = self._url + endpoint | |||
url = self.authenticated_url + endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is always correct? There is also
poetry/src/poetry/utils/authenticator.py
Lines 196 to 198 in fee7d0d
request = requests.auth.HTTPBasicAuth( | |
credential.username or "", credential.password or "" | |
)(request) |
which seems to handle HTTP basic auth by adding a header if I understand correctly.
Pull Request Check List
Resolves: Authorization error accessing when using http-basic repository and credentials configuration
Summary by Sourcery
Bug Fixes: