Skip to content

Commit 206b262

Browse files
committed
implement review feedback
Signed-off-by: tarilabs <[email protected]>
1 parent 7092f16 commit 206b262

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

oras/auth/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class AuthenticationException(Exception):
1414
pass
1515

1616

17-
def get_auth_backend(name="token", session=None, prefix="https", **kwargs):
17+
def get_auth_backend(name="token", session=None, insecure=False, **kwargs):
1818
backend = auth_backends.get(name)
1919
if not backend:
2020
raise ValueError(f"Authentication backend {backend} is not known.")
2121
backend = backend(**kwargs)
2222
backend.session = session or requests.Session()
23-
backend.prefix = prefix
23+
backend.prefix = "http" if insecure else "https"
2424
return backend

oras/provider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(
7878
self.session.cookies.set_policy(DefaultCookiePolicy(allowed_domains=[]))
7979

8080
# Get custom backend, pass on session to share
81-
self.auth = oras.auth.get_auth_backend(auth_backend, self.session, self.prefix)
81+
self.auth = oras.auth.get_auth_backend(auth_backend, self.session, insecure)
8282

8383
def __repr__(self) -> str:
8484
return str(self)

0 commit comments

Comments
 (0)