diff --git a/CHANGELOG.md b/CHANGELOG.md index 470cc7f..af11f35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are: The versions coincide with releases on pip. Only major versions will be released as tags on Github. ## [0.0.x](https://github.com/oras-project/oras-py/tree/main) (0.0.x) + - add missing basic auth data for request token function in token auth backend (0.2.2) - re-enable chunked upload (0.2.1) - refactor of auth to be provided by backend modules (0.2.0) - bugfix maintain requests's verify valorization for all invocations, augment basic auth header to existing headers diff --git a/oras/auth/token.py b/oras/auth/token.py index cdb8fd0..355848d 100644 --- a/oras/auth/token.py +++ b/oras/auth/token.py @@ -57,7 +57,6 @@ def authenticate_request( """ if refresh: self.token = None - authHeaderRaw = original.headers.get("Www-Authenticate") if not authHeaderRaw: logger.debug( @@ -122,7 +121,11 @@ def request_token(self, h: auth_utils.authHeader) -> bool: logger.debug(f"Scope: {h.scope}") params["scope"] = h.scope + # Set Basic Auth to receive token + headers["Authorization"] = "Basic %s" % self._basic_auth + authResponse = self.session.get(h.realm, headers=headers, params=params) # type: ignore + if authResponse.status_code != 200: logger.debug(f"Auth response was not successful: {authResponse.text}") return diff --git a/oras/version.py b/oras/version.py index 5985032..4f1beeb 100644 --- a/oras/version.py +++ b/oras/version.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright The ORAS Authors." __license__ = "Apache-2.0" -__version__ = "0.2.1" +__version__ = "0.2.2" AUTHOR = "Vanessa Sochat" EMAIL = "vsoch@users.noreply.github.com" NAME = "oras"