diff --git a/wavefront/server/apps/floware/floware/config.ini b/wavefront/server/apps/floware/floware/config.ini index e39a1658..cba4dede 100644 --- a/wavefront/server/apps/floware/floware/config.ini +++ b/wavefront/server/apps/floware/floware/config.ini @@ -1,8 +1,3 @@ -[app_config] -client_id = ${CLIENT_ID} -client_secret = ${CLIENT_SECRET} -product_id = ${PRODUCT_ID} - [env_config] app_env = ${APP_ENV} app_name = ${APP_NAME:floware} diff --git a/wavefront/server/modules/agents_module/pyproject.toml b/wavefront/server/modules/agents_module/pyproject.toml index e073842b..9fd8b0a5 100644 --- a/wavefront/server/modules/agents_module/pyproject.toml +++ b/wavefront/server/modules/agents_module/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ "flo-utils", "tools-module", "api-services-module", + "llm-inference-config-module", "flo-ai==1.1.6", "celery[redis]>=5.4.0,<6.0.0", ] @@ -23,6 +24,7 @@ flo-utils = { workspace = true } flo-cloud = { workspace = true } tools-module = {workspace = true} api-services-module = {workspace = true} +llm-inference-config-module = {workspace = true} [tool.pytest.ini_options] asyncio_mode = "auto" diff --git a/wavefront/server/modules/auth_module/auth_module/auth_container.py b/wavefront/server/modules/auth_module/auth_module/auth_container.py index d18c0d0b..0dc9b971 100644 --- a/wavefront/server/modules/auth_module/auth_module/auth_container.py +++ b/wavefront/server/modules/auth_module/auth_module/auth_container.py @@ -1,4 +1,3 @@ -from auth_module.services.client_token_service import ClientTokenService from auth_module.services.outlook_service import OutlookService from auth_module.services.superset_service import SupersetService from auth_module.services.token_service import TokenService @@ -57,13 +56,6 @@ class AuthContainer(containers.DeclarativeContainer): audience=config.jwt_token.audience, ) - client_token_service = providers.Singleton( - ClientTokenService, - private_key_pem=config.app_config.client_secret, - client_id=config.app_config.client_id, - product_id=config.app_config.product_id, - ) - if is_feature_enabled(SUPERSET_FLAG): superset_service = providers.Singleton( SupersetService, diff --git a/wavefront/server/modules/auth_module/auth_module/services/client_token_service.py b/wavefront/server/modules/auth_module/auth_module/services/client_token_service.py deleted file mode 100644 index a6595c3c..00000000 --- a/wavefront/server/modules/auth_module/auth_module/services/client_token_service.py +++ /dev/null @@ -1,44 +0,0 @@ -import base64 -import json -import time - -from cryptography.hazmat.primitives import hashes -from cryptography.hazmat.primitives import serialization -from cryptography.hazmat.primitives.asymmetric import padding - -TOKEN_EXPIRY = 5 * 60 # 5 minutes in seconds - - -class ClientTokenService: - def __init__(self, private_key_pem: str, client_id: str, product_id: str): - self.client_id = client_id - self.product_id = product_id - # Look for alternate way to load private key - private_key_pem = base64.b64decode(private_key_pem).decode('utf-8') - self.private_key = serialization.load_pem_private_key( - private_key_pem.encode(), password=None - ) - - def generate_token(self) -> str: - payload = { - 'client_id': self.client_id, - 'product_id': self.product_id, - 'timestamp': int(time.time()), - 'exp': int(time.time() + TOKEN_EXPIRY), - } - - payload_str = json.dumps(payload, sort_keys=True) - payload_bytes = payload_str.encode() - - signature = self.private_key.sign( - payload_bytes, - padding.PSS( - mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH - ), - hashes.SHA256(), - ) - - signature_b64 = base64.urlsafe_b64encode(signature).decode().rstrip('=') - payload_b64 = base64.urlsafe_b64encode(payload_bytes).decode().rstrip('=') - - return f'{payload_b64}.{signature_b64}' diff --git a/wavefront/server/packages/flo_cloud/pyproject.toml b/wavefront/server/packages/flo_cloud/pyproject.toml index f739329d..34c09d3f 100644 --- a/wavefront/server/packages/flo_cloud/pyproject.toml +++ b/wavefront/server/packages/flo_cloud/pyproject.toml @@ -20,6 +20,7 @@ dependencies = [ "google-cloud-pubsub>=2.28.0", "redshift-connector>=2.1.7", "mssql-python", + "psycopg2-binary>=2.9.10,<3.0.0", ] [tool.pytest.ini_options] diff --git a/wavefront/server/uv.lock b/wavefront/server/uv.lock index 6106d888..93f054ca 100644 --- a/wavefront/server/uv.lock +++ b/wavefront/server/uv.lock @@ -77,6 +77,7 @@ dependencies = [ { name = "flo-ai" }, { name = "flo-cloud" }, { name = "flo-utils" }, + { name = "llm-inference-config-module" }, { name = "tools-module" }, ] @@ -88,6 +89,7 @@ requires-dist = [ { name = "flo-ai", specifier = "==1.1.6" }, { name = "flo-cloud", editable = "packages/flo_cloud" }, { name = "flo-utils", editable = "packages/flo_utils" }, + { name = "llm-inference-config-module", editable = "modules/llm_inference_config_module" }, { name = "tools-module", editable = "modules/tools_module" }, ] @@ -1510,6 +1512,7 @@ dependencies = [ { name = "google-cloud-pubsub" }, { name = "google-cloud-storage" }, { name = "mssql-python" }, + { name = "psycopg2-binary" }, { name = "redshift-connector" }, ] @@ -1526,6 +1529,7 @@ requires-dist = [ { name = "google-cloud-pubsub", specifier = ">=2.28.0" }, { name = "google-cloud-storage", specifier = "<3.0.0" }, { name = "mssql-python" }, + { name = "psycopg2-binary", specifier = ">=2.9.10,<3.0.0" }, { name = "redshift-connector", specifier = ">=2.1.7" }, ]