Skip to content

Commit a3cc292

Browse files
authored
Merge pull request #183 from Meallia/Meallia-patch-1
Don't add an Authorization header is there is no token
2 parents 1790ad7 + 05f77a2 commit a3cc292

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x)
17+
- don't add an Authorization header is there is no token (0.2.27), closes issue [182](https://github.com/oras-project/oras-py/issues/182)
1718
- check for blob existence before uploading (0.2.26)
1819
- fix get_tags for ECR when limit is None, closes issue [173](https://github.com/oras-project/oras-py/issues/173)
1920
- fix empty token for anon tokens to work, closes issue [167](https://github.com/oras-project/oras-py/issues/167)

oras/auth/token.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def set_token_auth(self, token: str):
3232
self.token = token
3333

3434
def get_auth_header(self):
35-
return {"Authorization": "Bearer %s" % self.token}
35+
if self.token:
36+
return {"Authorization": "Bearer %s" % self.token}
37+
return {}
3638

3739
def reset_basic_auth(self):
3840
"""

oras/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright The ORAS Authors."
33
__license__ = "Apache-2.0"
44

5-
__version__ = "0.2.26"
5+
__version__ = "0.2.27"
66
AUTHOR = "Vanessa Sochat"
77
EMAIL = "vsoch@users.noreply.github.com"
88
NAME = "oras"

0 commit comments

Comments
 (0)