Max Fröhlich
Max Fröhlich
I think for now I was able to realise to do the DI part via a class that implments `__call__` and using an instance of this in the Depends call....
Hi @rmk135, I think I'm still facing the problem on how to marry this. I have a simpler show case now just with FastAPI's Bearers classes Some container: ```python class...
As a workarround I can use it like this: ```python @inject async def workarround( request: Request, di_bearer=Provide[Container.bearer] ) -> HTTPBasicCredentials: return await di_bearer(request) @app.get("/with_di_workarround") def with_di_workarround(user: HTTPBasicCredentials = Depends(workarround)): return...
As long as I don't type the di_bearer in the signature, otherwise FastAPI goes mad :) ```python async def workarround( request: Request, di_bearer:HttpBasic=Provide[Container.bearer]): ... # di_bearer:HttpBasic -> boom ```
ok the problem with the workarround is also that it breaks the open api endpoin :/ ```python def test_openapi(client: TestClient): resp = client.get("/openapi.json") resp.raise_for_status() assert resp.status_code == 200 ``` results...
ok forgot the `Depends` ```python @inject async def workarround( request: Request, di_bearer: HTTPBasic = Depends(Provide[Container.bearer]) ) -> HTTPBasicCredentials: return await di_bearer(request) ```
So the only question left is if there is a nice way as the `workarround` function ?
Yeah also assumed that this is kind of the case. Thank you for pointing out where this check is happening
Hi, really looking forward to that feature :) I saw that a `service.instance.id` will be considered a label, doesn't this have the potential to be a high cardinality value? Also...
How to you generate the url for your file? if you use file.url({store: "yourStoreName"}) the auth token should be appended to the url as far as I know