Skip to content

Improve caching: custom CachingLayer and encryption by default #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

levochkaa
Copy link
Contributor

We are trying to secure our feature flags, thats why we implemented remote eval and encryption, but then suddenly found, that caching on a client is done without encryption in plain JSON, which can be easily faked.

So I found in the sources that the SDK already has CachingLayer protocol, but for some reason it wasn't public. If it was I would probably just implement custom caching mechanism with encryption.
After reading the code (for the 232 time lol), I thought that implementing encrypted cache is pretty easy, so here is the PR, which proposes two changes:

  1. A way to set a custom CachingManager/Layer
  2. Encrypted cache if encryptionKey is provided

This change will result in a Failed get features from cached encrypted features for the first start after update for an old user, but it seems ok for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant