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

fix: do not set empty token so anon works for public ecr #176

Merged
merged 1 commit into from
Dec 6, 2024
Merged
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The versions coincide with releases on pip. Only major versions will be released

## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
- check for blob existence before uploading (0.2.26)
- fix get_tags for ECR when limit is None, closes issue [173](https://github.com/oras-project/oras-py/issues/173)
- fix get_tags for ECR when limit is None, closes issue [173](https://github.com/oras-project/oras-py/issues/173)
- fix empty token for anon tokens to work, closes issue [167](https://github.com/oras-project/oras-py/issues/167)
- retry on 500 (0.2.25)
- align provider config_path type annotations (0.2.24)
- add missing prefix property to auth backend (0.2.23)
Expand Down
6 changes: 5 additions & 1 deletion oras/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,11 @@ def do_request(
:type stream: bool
"""
# Make the request and return to calling function, but attempt to use auth token if previously obtained
if headers is not None and isinstance(self.auth, oras.auth.TokenAuth):
if (
headers is not None
and isinstance(self.auth, oras.auth.TokenAuth)
and self.auth.token is not None
):
headers.update(self.auth.get_auth_header())
response = self.session.request(
method,
Expand Down
Loading