Skip to content

Commit ff66660

Browse files
committed
Formatting
Signed-off-by: Rasmus Faber-Espensen <rfaber@gmail.com>
1 parent ee3bbea commit ff66660

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

oras/auth/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def _get_auth_from_creds_store(self, binary: str, hostname: str) -> str | None:
7777
logger.warning(f"Credential helper '{binary}' not found in PATH")
7878
return None
7979
except subprocess.CalledProcessError as exc:
80-
logger.warning(f"Credential helper '{binary}' failed: {exc.stderr.decode().strip()}")
80+
logger.warning(
81+
f"Credential helper '{binary}' failed: {exc.stderr.decode().strip()}"
82+
)
8183
return None
8284
payload = json.loads(proc.stdout)
8385
return auth_utils.get_basic_auth(payload["Username"], payload["Secret"])

oras/auth/ecr.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@ class EcrAuth(TokenAuth):
1717
"""
1818
Auth backend for AWS ECR (Elastic Container Registry) using token-based authentication.
1919
"""
20-
AWS_ECR_PATTERN = re.compile(r"(?P<account_id>\d{12})\.dkr\.ecr\.(?P<region>[^.]+)\.amazonaws\.com")
21-
AWS_ECR_REALM_PATTERN = re.compile(r"https://(?P<account_id>\d{12})\.dkr\.ecr\.(?P<region>[^.]+)\.amazonaws\.com/")
20+
21+
AWS_ECR_PATTERN = re.compile(
22+
r"(?P<account_id>\d{12})\.dkr\.ecr\.(?P<region>[^.]+)\.amazonaws\.com"
23+
)
24+
AWS_ECR_REALM_PATTERN = re.compile(
25+
r"https://(?P<account_id>\d{12})\.dkr\.ecr\.(?P<region>[^.]+)\.amazonaws\.com/"
26+
)
2227

2328
def __init__(self):
2429
super().__init__()
2530
self._tokens = {}
2631

27-
def load_configs(self, container: container_type, configs: Optional[list] = None) -> None:
32+
def load_configs(
33+
self, container: container_type, configs: Optional[list] = None
34+
) -> None:
2835
if not self.AWS_ECR_PATTERN.fullmatch(container.registry):
2936
super().load_configs(container, configs)
3037

0 commit comments

Comments
 (0)