Skip to content

Commit

Permalink
core: TokenAuth request_token fix missing auth
Browse files Browse the repository at this point in the history
the method is intended to request authenticated
token, per pydocs, but was passing an headers
which was always missing Authorization.

Signed-off-by: tarilabs <matteo.mortari@gmail.com>
  • Loading branch information
tarilabs committed Jul 6, 2024
1 parent caf8db5 commit 10e010b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oras/auth/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def request_token(self, h: auth_utils.authHeader) -> bool:
"""
params = {}
headers = {}
if self._basic_auth: # we exchange the basic auth for the token
headers["Authorization"] = "Basic %s" % self._basic_auth

# Prepare request to retry
if h.service:
Expand Down

0 comments on commit 10e010b

Please sign in to comment.