Skip to content

Keys used for generating tokens are not refreshed in services  #238

Open
@doumdi

Description

Describe the bug
Keys are stored in Redis to generate tokens. They are read when each service starts. However, if TeraServer changes the keys, which might happen in test mode when we completely flush the DB and regenerate default values, then the services are not updated with the new keys and calls to API fail with wrong tokens.

To Reproduce
Steps to reproduce the behavior:

  1. Launch TeraServer in test mode with --enable_tests=1
  2. Launch other services in test mode
  3. Call the /api/tests/database/reset API to flush an regenerate the default DB
  4. Create a new participant and get its static token
  5. Use the new token to call an endpoint on the service (will be generated with the wrong key from the new DB)

Expected behavior
Service must be aware of changes in redis keys and update them in ServiceAccessManager.

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions