Skip to content

Commit

Permalink
Fix: HTTPBearerExtractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Igoranze committed Oct 22, 2024
1 parent d6910e7 commit 9a16eb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion orchestrator/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
client_kwargs={"verify": HTTPX_SSL_CONTEXT},
)

http_bearer_extractor = HttpBearerExtractor(auto_error=False)


async def authenticate(
request: Request,
http_auth_credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(HttpBearerExtractor())] = None,
http_auth_credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(http_bearer_extractor)] = None,
) -> OIDCUserModel | None:
token = http_auth_credentials.credentials if http_auth_credentials else None
return await request.app.auth_manager.authentication.authenticate(request, token)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies = [
"typer==0.12.5",
"uvicorn[standard]~=0.32.0",
"nwa-stdlib~=1.7.3",
# "oauth2-lib~=2.1.0",
# "oauth2-lib~=2.2.0",
"oauth2-lib @ git+https://github.com/workfloworchestrator/oauth2-lib.git@auth-b-shown",
"tabulate==0.9.0",
"strawberry-graphql==0.232.2",
Expand Down

0 comments on commit 9a16eb6

Please sign in to comment.