WIP: Add reactive caching for error tracking list_projects API
What does this MR do?
Adds reactive caching for the list_projects API.
The list_projects API receives api_host and token as POST parameters. These parameters are used to make an API call to Sentry without saving these values to DB.
Since the api_host and token are not saved into DB, reactive caching gets a little tricky. The cache normally uses the DB id as key. In this case, we need to use the api_host and token as additional qualifiers to the cache key.
This, however, has security implications. Storing a token in the cache may cause security issues.
I tried using the encrypted token and IV as qualifiers instead of the plaintext token. This does not work because any assignment to the token causes a new IV to be generated, which also results in a new encrypted value even if the plaintext value is the same. This means that the same POST params will cause a cache miss because the IV and encrypted value will be different each time.
Any suggestions on how to implement reactive caching are welcome.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer