Local Storage
A browser local storage provider. Synchronizes the given context model with the browser local storage. The provider blocks the rendering of any child components until the the model has been synchronized with the browser.
The context model is stored in the browser's local storage as unencrypted stringified json (see encryption example below).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
1 2 3 4 5 6 7 8 |
|
Encrypting Local Storage Data¶
The data stored in the browser can easily be encrypted by sub-classing DynamicContextModel. The following example uses Fernet symmetric encryption.
Use Fernet.generate_key() to create keys. The key remains on the server, only encrypted data is sent to the browser.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
The same pattern can be applied to any desired encryption method.
Last update: November 28, 2024
Authors: