-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
29 lines (18 loc) · 848 Bytes
/
config.py
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
import os
import config
from component import my_crypt
project_root_path = os.getcwd() # 项目根目录
DEVOPS_PLATFORM_PROJECT_CRYPTO_KEY_STR = "devops_platform_project_crypto_key"
devops_platform_project_crypto_key = os.environ.get(DEVOPS_PLATFORM_PROJECT_CRYPTO_KEY_STR)
app_conf = {}
def init():
with open(os.path.join(project_root_path, "configs", "application.yml")) as f:
config.app_conf = my_crypt.decrypt_enc_part(f.read())
print("app_conf: ", app_conf)
endpoint_list_data = None
access_control__group_struct_has_auth_term = {}
access_control__group_struct_has_static_page = {}
def get_decrypt_value(original_data_str):
return my_crypt.decrypt_enc_part(original_data_str)
def get_encrypt_value(original_data_str):
return my_crypt.do_encrypt_value(devops_platform_project_crypto_key, original_data_str)