From 98687f485124ab2a830f80f02db60e26d2392d78 Mon Sep 17 00:00:00 2001 From: Matthew Alan Gray Date: Thu, 1 Aug 2024 13:53:36 -0500 Subject: [PATCH] Aligning python API settings with recent changes --- src/python/AgentHubAPI/app/dependencies.py | 2 +- src/python/AgentHubAPI/app/main.py | 2 +- src/python/DataSourceHubAPI/app/dependencies.py | 2 +- src/python/DataSourceHubAPI/app/main.py | 2 +- src/python/PromptHubAPI/app/dependencies.py | 2 +- src/python/PromptHubAPI/app/main.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/python/AgentHubAPI/app/dependencies.py b/src/python/AgentHubAPI/app/dependencies.py index 6153e2452a..a324577965 100644 --- a/src/python/AgentHubAPI/app/dependencies.py +++ b/src/python/AgentHubAPI/app/dependencies.py @@ -45,7 +45,7 @@ def validate_api_key_header(x_api_key: str = Depends(APIKeyHeader(name='X-API-Ke Returns True of the X-API-Key value from the request header matches the expected value. Otherwise, returns False. """ - result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:APIKey') + result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:APIKey') if not result: logging.error('Invalid API key. You must provide a valid API key in the X-API-KEY header.') diff --git a/src/python/AgentHubAPI/app/main.py b/src/python/AgentHubAPI/app/main.py index 9971fc54a8..0f8a67364d 100644 --- a/src/python/AgentHubAPI/app/main.py +++ b/src/python/AgentHubAPI/app/main.py @@ -13,7 +13,7 @@ # Open a connection to the app configuration config = get_config() # Start collecting telemetry -Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:AppInsightsConnectionString') +Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:AppInsightsConnectionString') app = FastAPI( title=f'FoundationaLLM {API_NAME}', diff --git a/src/python/DataSourceHubAPI/app/dependencies.py b/src/python/DataSourceHubAPI/app/dependencies.py index 760784c8b2..dbc24b75dd 100644 --- a/src/python/DataSourceHubAPI/app/dependencies.py +++ b/src/python/DataSourceHubAPI/app/dependencies.py @@ -46,7 +46,7 @@ def validate_api_key_header(x_api_key: str = Depends(APIKeyHeader(name='X-API-Ke Otherwise, returns False. """ - result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:APIKey') + result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:APIKey') if not result: logging.error('Invalid API key. You must provide a valid API key in the X-API-KEY header.') diff --git a/src/python/DataSourceHubAPI/app/main.py b/src/python/DataSourceHubAPI/app/main.py index 3ba1e21e3f..94cab943ee 100644 --- a/src/python/DataSourceHubAPI/app/main.py +++ b/src/python/DataSourceHubAPI/app/main.py @@ -13,7 +13,7 @@ # Open a connection to the app configuration config = get_config() # Start collecting telemetry -Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:AppInsightsConnectionString') +Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:AppInsightsConnectionString') app = FastAPI( title=f'FoundationaLLM {API_NAME}', diff --git a/src/python/PromptHubAPI/app/dependencies.py b/src/python/PromptHubAPI/app/dependencies.py index e8875ba35f..372b1dcc57 100644 --- a/src/python/PromptHubAPI/app/dependencies.py +++ b/src/python/PromptHubAPI/app/dependencies.py @@ -46,7 +46,7 @@ def validate_api_key_header(x_api_key: str = Depends(APIKeyHeader(name='X-API-Ke Otherwise, returns False. """ - result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:APIKey') + result = x_api_key == get_config().get_value(f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:APIKey') if not result: logging.error('Invalid API key. You must provide a valid API key in the X-API-KEY header.') diff --git a/src/python/PromptHubAPI/app/main.py b/src/python/PromptHubAPI/app/main.py index 9ddec05426..6ad19842e4 100644 --- a/src/python/PromptHubAPI/app/main.py +++ b/src/python/PromptHubAPI/app/main.py @@ -13,7 +13,7 @@ # Open a connection to the app configuration config = get_config() # Start collecting telemetry -Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:AppInsightsConnectionString') +Telemetry.configure_monitoring(config, f'FoundationaLLM:APIEndpoints:{API_NAME}:Essentials:AppInsightsConnectionString') app = FastAPI( title=f'FoundationaLLM {API_NAME}',