feature: adicionando suporte a 1password (#7)
* feature: obter secrets de 1password * chore: organizando CI workflow
This commit is contained in:
27
app/utils.py
Normal file
27
app/utils.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import os
|
||||
|
||||
import onepasswordconnectsdk
|
||||
from onepasswordconnectsdk.client import Client, new_client_from_environment
|
||||
|
||||
|
||||
def get_op_config():
|
||||
op_client: Client = new_client_from_environment()
|
||||
|
||||
OP_DJANGO_SETTINGS_VARS = [
|
||||
'database.host',
|
||||
'database.port',
|
||||
'database.name',
|
||||
'database.user',
|
||||
'database.password',
|
||||
'settings.ALLOWED_HOSTS',
|
||||
'settings.DEBUG',
|
||||
'settings.SCOPE',
|
||||
'settings.SENTRY_DSN',
|
||||
'settings.SECRET_KEY',
|
||||
]
|
||||
|
||||
op_config_get = {}
|
||||
for var in OP_DJANGO_SETTINGS_VARS:
|
||||
op_config_get[var] = {"opitem": "mines", "opfield": var}
|
||||
|
||||
return onepasswordconnectsdk.load_dict(op_client, op_config_get)
|
||||
Reference in New Issue
Block a user