Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
- Add Auth headers to request when using `BasicAuth` (0.2.39)
- fix Python 3.7+ compatibility by avoiding union syntax and rely on typing (0.2.38)
- Use the correct credsStore/credHelpers binary (0.2.37)
- Properly prioritize auth methods (0.2.36)
Expand Down
8 changes: 7 additions & 1 deletion oras/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,13 @@ def do_request(
headers = {}

# Make the request and return to calling function, but attempt to use auth token if previously obtained
if isinstance(self.auth, oras.auth.TokenAuth) and self.auth.token is not None:
if (
Copy link
Contributor

Choose a reason for hiding this comment

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

I think generally speaking we want to add auth headers only after the registry requests it.

isinstance(self.auth, oras.auth.TokenAuth) and self.auth.token is not None
) or (
isinstance(self.auth, oras.auth.BasicAuth)
and hasattr(self.auth, "_basic_auth")
and self.auth._basic_auth is not None
):
headers.update(self.auth.get_auth_header())
response = self.session.request(
method,
Expand Down
2 changes: 1 addition & 1 deletion oras/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__copyright__ = "Copyright The ORAS Authors."
__license__ = "Apache-2.0"

__version__ = "0.2.38"
__version__ = "0.2.39"
AUTHOR = "Vanessa Sochat"
EMAIL = "vsoch@users.noreply.github.com"
NAME = "oras"
Expand Down