Manage secrets outside of server_config.json#4633
Conversation
0a56fa5 to
58f71ca
Compare
bruntib
left a comment
There was a problem hiding this comment.
Please, fix the lint test, otherwise looks good to me.
Discookie
left a comment
There was a problem hiding this comment.
Can these secrets only be a string, or can they be arbitrary JSON data?
It seems that currently the secrets.json can store arbitrary data, while the environment variable cannot.
Not sure if loading arbitrary data is intentional, but it would be useful to offload eg. the entire dictionary-based auth dictionary into the secrets, instead of each individual password.
If it's not intentional, it should be checked against, when loading the secrets.json.
|
(Similarly, there should be an appropriate error message on a nonexistent environment variable.) |
Co-authored-by: bruntib <12861163+bruntib@users.noreply.github.com>
It was initially designed for strings, but as you mentioned, it can be a useful feature so I think we can keep this as is.
Currently, the server prints the thrown exception message: I think this explains that env variable |
fcdb6d5 to
3131c59
Compare
3131c59 to
bc8ac1f
Compare
Discookie
left a comment
There was a problem hiding this comment.
It'd be nice to have an example about secrets.json storing JSON structures in the docs, but otherwise LGTM.
Also extended the docs with an example dictionary secret. |
* Manage secrets outside of server_config.json * Also read secrets from environmental variables. * Fix minor styling issue in resolve_variables Co-authored-by: bruntib <12861163+bruntib@users.noreply.github.com> * Fix lint test * Extended docs with an example dictionary secret --------- Co-authored-by: bruntib <12861163+bruntib@users.noreply.github.com>
In this PR, I added an option to store secrets outside of
server_config.json.To use this feature, we can replace sensitive data with
$SECRET:NAME_OF_SECRET$, thenNAME_OF_SECRETwill be read from a separatesecrets.jsonfile when we initially loadserver_config.json.This change is also backward compatible (e.g., secrets can still be stored in
server_config.json).See the updated documentation in
docs/web/server_config.mdfor more info.