tdfs4ds.serve.model_keys¶
tdfs4ds.serve.model_keys
¶
The model API keys typed in the app, kept by the gateway (0.3.8.2).
In the Docker deployment every person has an app process of their own, so a key typed on the
Parameters page would live and die with that process. The gateway keeps it instead: encrypted
(AES-256-GCM) in the credentials volume, and hands it to every worker it starts. The key of the
file is derived from TDFS4DS_SERVE_SECRET; without a configured secret nothing is written
(a random per-process secret could not decrypt the file after a restart).
Only the two model keys are kept, never a database password.
ModelKeyStore
¶
Encrypted file with the model keys. Thread safe; never raises on a bad or missing file.
dir
instance-attribute
¶
dir = directory or os.environ.get('TDFS4DS_SERVE_CREDENTIALS_DIR') or os.path.join(os.environ.get('TDFS4DS_SERVE_DATA_DIR') or '/data', 'credentials')
available
property
¶
True when a stable secret is configured, so what is written can be read back.
update
¶
Merge changes (a non-empty value replaces) and write the file. True when written.