better secrets admin
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import pickle
|
||||
from pathlib import Path
|
||||
|
||||
from cryptography.fernet import Fernet
|
||||
from secrets_config import load_secrets
|
||||
|
||||
# =====================================================
|
||||
# SECRET KEY (only your program has this)
|
||||
# =====================================================
|
||||
# Generate once using: Fernet.generate_key()
|
||||
_SECRET_KEY = b'YFK7QCyTzhyLO4vqrnRxvDAI5uu8mXEYrInEjbRoQgs='
|
||||
# The key is generated once and stored outside Git in instance/secrets.yaml.
|
||||
_SECRET_KEY = load_secrets(Path(__file__).parent / "instance")["fernet"]["key"].encode("ascii")
|
||||
|
||||
fernet = Fernet(_SECRET_KEY)
|
||||
|
||||
@@ -56,4 +59,4 @@ print("Type Before :- ",type(bytes_data))
|
||||
|
||||
print(string_data)
|
||||
|
||||
print("Type After :- ",type(string_data))
|
||||
print("Type After :- ",type(string_data))
|
||||
|
||||
Reference in New Issue
Block a user