System/user
and persistent data between Rebol sessions
#87
Oldes
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
It should be noted, that the persistent data file is encrypted, but one may use |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's two standard approaches to this:
I wonder if it might be more secure to build this into a database or OS settings adapter instead of bespoke? Or alternatively as a generic encrypted configuration format instead of something tied to the concept of a "user"? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
By default the Rebol session has no user defined. In many cases it is useful to have per-user persistent data, which may be used by various scripts. Instead of keeping various secrets like access tokens or passwords in plain file, one may use built in
safe
scheme. The easiest way is to setup an user:If the user with such a name does not exists yet, you will be asked for a password which will be used to encrypt the persistent data file (stored in the
system/options/home
directory).When the user is initialised, one may store any value in the created
.safe
file. For example to store an user's email:Such a value may be accessed using:
Or using included helper function
user's
.Values are not automatically saved.. one must use
update
action on thedata
port, or logout the user setting it tonone
.Once logged in again, the value is again available:
The persistent data file may be used to store complex settings, like this config code in my Google API module
Beta Was this translation helpful? Give feedback.
All reactions