Skip to content

Commit 49b2b76

Browse files
committed
Make it possible to disable HTTPS verification
This is needed for development on a local server.
1 parent 890e9d3 commit 49b2b76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

code_submitter/auth.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,19 @@ async def validate(self, username: str, password: str) -> ValidationResult:
9191

9292

9393
class NemesisBackend(BasicAuthBackend):
94-
def __init__(self, _target: Optional[Starlette] = None, *, url: str) -> None:
94+
def __init__(
95+
self,
96+
_target: Optional[Starlette] = None,
97+
*,
98+
url: str,
99+
verify: bool = True,
100+
) -> None:
95101
# Munge types to cope with httpx not supporting strict_optional but
96102
# actually being fine with given `None`. Note we expect only to pass
97103
# this value in tests, so need to cope with it being `None` most of the
98104
# time anyway.
99105
app = cast(Starlette, _target)
100-
self.client = httpx.AsyncClient(base_url=url, app=app)
106+
self.client = httpx.AsyncClient(base_url=url, app=app, verify=verify)
101107

102108
async def load_user(self, username: str, password: str) -> NemesisUserInfo:
103109
async with self.client as client:

0 commit comments

Comments
 (0)