Skip to content

Commit

Permalink
Merge pull request #176 from natefaerber/fix/public-ecr-anon-token
Browse files Browse the repository at this point in the history
fix: do not set empty token so anon works for public ecr
  • Loading branch information
vsoch authored Dec 6, 2024
2 parents 2fb51e3 + f9268e6 commit c5289c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit c5289c1

Please sign in to comment.