Is it possible to override Bearer Security Scheme header in specific route?
No response
async def check_access_token(
self,
request: Request,
access_token: Annotated[str, Parameter(header="Authorization")],
async_client: Annotated[AsyncClient, Depends(Component.HTTP)],
settings: Annotated[Settings, Depends(Component.SHARED)],
) -> Response[AuthStatusDto]:
pass
something like that doesn't work, swagger doesn't send specific header, but when I use global security option - everything is ok.
That's a Litestar code with some DI features, I'm looking to override how the security works for a route (I have access_token variable from Authorization header at the route level, and I have global Security Schema that works with Authorization header, but the route level Authorization header doesn't override global)
1. Go to Swagger docs
2. Try to pass Authorization header via endpoint header form
3. Send a request
4. See error
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
No response
2.12.1
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too