Closed kyleaoman closed 10 months ago
Looks like I need to set an environment variable JWT_SECRET_KEY
(or perhaps create a .env file). For now export JWT_SECRET_KEY=""
has at least led to successfully starting up an api server.
I don't understand yet whether the api server needs itself to send requests to the authentication server - if not then perhaps it should be possible to start up the server without providing a jwt_secret_key
.
From what I can tell this should not be required on the server side, I'll try and come up with a sensible patch.
Have updated the docs and .env.example
to reflect this - should be fixed in #44
The secret key is needed to create (and then decode) the JSON web tokens to check user auth status, so will be needed.
I'm following along the instructions to get started and have run into a bug (?). Initialising the
Settings
object defined insrc/api/config.py
requires ajwt_secret_key
argument, otherwise pydantic raises aValidationError
. However, we there's an attempted initialisation with no arguments in the code (https://github.com/UCL-ARC/dirac-swift-api/blob/55feb15aa0ea3fedfbfd45f55dbe659a203042fb/src/api/routers/auth.py#L29C22-L29C22)Upshot is that when I try to run
src/api/main.py
I get aValidationError
:The test suite passes and presumably the
Settings()
call comes up there, so perhaps there's some setup step that isn't documented and that I'm missing?