File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414The 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+ - fix 'authentication with ECR' to be an extra as intended (0.2.35)
1718 - Add support for authentication with ECR registries (0.2.34)
1819 - Add support for Docker credsStore and credHelpers
1920 - fix 'get_manifest()' method with adding 'load_configs()' calling (0.2.33)
Original file line number Diff line number Diff line change 44
55import re
66
7- import boto3
87import requests
98
109import oras .auth .utils as auth_utils
@@ -54,6 +53,13 @@ def authenticate_request(
5453 logger .warning (f"realm: { h .realm } did not match expected pattern." )
5554 return super ().request_token (h )
5655 region = m .group ("region" )
56+ try :
57+ import boto3
58+ except ImportError as e :
59+ msg = """the `boto3` dependency is required to support authentication to this registry.
60+ Make sure to install the required extra "ecr", e.g.: pip install oras[ecr].
61+ """
62+ raise ImportError (msg ) from e
5763 ecr = boto3 .client ("ecr" , region_name = region )
5864 auth = ecr .get_authorization_token ()["authorizationData" ][0 ]
5965 token = auth .get ("authorizationToken" , "" )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def inner(*args, **kwargs):
5252 return res
5353 except oras .auth .AuthenticationException as e :
5454 raise e
55- except requests .exceptions .SSLError :
55+ except ( requests .exceptions .SSLError , ImportError ) :
5656 raise
5757 except Exception as e :
5858 sleep = timeout + 3 ** attempt
Original file line number Diff line number Diff line change 22__copyright__ = "Copyright The ORAS Authors."
33__license__ = "Apache-2.0"
44
5- __version__ = "0.2.34 "
5+ __version__ = "0.2.35 "
66AUTHOR = "Vanessa Sochat"
77EMAIL = "vsoch@users.noreply.github.com"
88NAME = "oras"
You can’t perform that action at this time.
0 commit comments