Describe the bug
In some strange edge cases, the .jwks file that resides in ~/.medperf_config/.tokens can end up empty. When that happens, Authentication fails, as medperf tries to read this file as a JSON object and can't figure out how to parse empty files.
To Reproduce
- Create an empty
.jwks file in ~/.medperf_config/.tokens. Rename the previos one if needed
- Sign out of medperf.
- Try to sign back in. A
JSONDecodeError will be raised.
Expected behavior
While the expected behavior should be to completely avoid generating empty .jwks file, a good additional behavior is to try to read the file and if it fails remove the corrupted one an regenerate it.
Describe the bug
In some strange edge cases, the
.jwksfile that resides in~/.medperf_config/.tokenscan end up empty. When that happens, Authentication fails, as medperf tries to read this file as a JSON object and can't figure out how to parse empty files.To Reproduce
.jwksfile in~/.medperf_config/.tokens. Rename the previos one if neededJSONDecodeErrorwill be raised.Expected behavior
While the expected behavior should be to completely avoid generating empty
.jwksfile, a good additional behavior is to try to read the file and if it fails remove the corrupted one an regenerate it.