From 10e010b365e56488963ca14b6e9e08b1ea7e4a7a Mon Sep 17 00:00:00 2001 From: tarilabs Date: Sat, 6 Jul 2024 22:08:41 +0200 Subject: [PATCH] core: TokenAuth request_token fix missing auth the method is intended to request authenticated token, per pydocs, but was passing an headers which was always missing Authorization. Signed-off-by: tarilabs --- oras/auth/token.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oras/auth/token.py b/oras/auth/token.py index cdb8fd0..d35f734 100644 --- a/oras/auth/token.py +++ b/oras/auth/token.py @@ -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: