Updated to new secret manager
This commit is contained in:
1 parent
2179def694
commit
39ca022c1e
3 files changed
+22
-17
No files matched your search
+11
-3
@@ -1,8 +1,16 @@
|
||||
from .db import get_db, create_connection_pool, close_connection_pool, start_healthcheck_thread
|
||||
import logging
|
||||
|
||||
from .db import (
|
||||
close_connection_pool,
|
||||
create_connection_pool,
|
||||
get_db,
|
||||
start_healthcheck_thread,
|
||||
)
|
||||
|
||||
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
||||
__all__ = [
|
||||
"get_db",
|
||||
"create_connection_pool",
|
||||
"close_connection_pool",
|
||||
"create_connection_pool",
|
||||
"get_db",
|
||||
"start_healthcheck_thread",
|
||||
]
|
||||
+10
-9
@@ -1,16 +1,17 @@
|
||||
from mysql.connector import pooling, Error
|
||||
from mysql.connector.pooling import MySQLConnectionPool, MySQLConnection
|
||||
import threading
|
||||
from secret_manager import return_credentials
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
from simple_logger_handler import setup_logger
|
||||
from typing import Generator
|
||||
from collections.abc import Generator
|
||||
|
||||
db_username = return_credentials("/etc/secrets/db_username")
|
||||
db_password = return_credentials("/etc/secrets/db_password")
|
||||
from mysql.connector import Error, pooling
|
||||
from mysql.connector.pooling import MySQLConnection, MySQLConnectionPool
|
||||
from secret_manager import get_secret
|
||||
|
||||
logger = setup_logger(__name__)
|
||||
db_username = get_secret("/etc/secrets/db_username")
|
||||
db_password = get_secret("/etc/secrets/db_password")
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
MAX_RETRIES = 10
|
||||
RETRY_DELAY = 5
|
||||
|
||||
+1
-5
@@ -5,11 +5,7 @@ description = "Shared database module"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
authors = [{ name = "Florian Gänsejunge" }]
|
||||
dependencies = [
|
||||
"simple-logger-handler",
|
||||
"mysql-connector-python==9.4.0",
|
||||
"lib-secret-manager"
|
||||
]
|
||||
dependencies = ["mysql-connector-python==9.4.0","lib-secret-manager"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=61", "wheel"]
|
||||
|
||||
Reference in new issue
Block a user