@@ -165,11 +165,18 @@ setup_python_environment() {
165165log " === Starting Vault Secrets Storage ==="
166166log " Received parameters:"
167167log " connectionId: $connectionId "
168+ log " vaultUuid: $vaultUuid "
168169log " llmPlatform: $llmPlatform "
169170log " llmModel: $llmModel "
170171log " deploymentEnvironment: $deploymentEnvironment "
171172log " Vault Address: $VAULT_ADDR "
172173
174+ # Validate required vaultUuid parameter
175+ if [ -z " $vaultUuid " ]; then
176+ log " ERROR: vaultUuid is required but not provided"
177+ exit 1
178+ fi
179+
173180# Redirect stderr to stdout so cron-manager can capture all logs
174181exec 2>&1
175182
@@ -197,24 +204,13 @@ get_model_name() {
197204 echo " $llmModel " | sed ' s/\[//g' | sed ' s/\]//g' | sed ' s/"//g' | cut -d' ,' -f1 | xargs
198205}
199206
200- # Function to build vault path
207+ # Function to build vault path (uses vaultUuid as stable path terminal)
201208build_vault_path () {
202209 local secret_type=$1 # "llm" or "embeddings"
203210 local platform=$( get_platform_name)
204211
205- # Use appropriate model based on secret type
206- local model
207- if [ " $secret_type " = " embeddings" ]; then
208- model=" $embeddingModel "
209- else
210- model=$( get_model_name)
211- fi
212-
213- if [ " $deploymentEnvironment " = " testing" ]; then
214- echo " secret/$secret_type /connections/$platform /$deploymentEnvironment /$connectionId "
215- else
216- echo " secret/$secret_type /connections/$platform /$deploymentEnvironment /$model "
217- fi
212+ # UUID-based path: no environment in path, swap is DB-only
213+ echo " secret/$secret_type /connections/$platform /$vaultUuid "
218214}
219215
220216# Function to store LLM secrets
@@ -275,15 +271,13 @@ store_aws_llm_secrets() {
275271 --arg conn_id " $connectionId " \
276272 --arg access_key " $decrypted_access_key " \
277273 --arg secret_key " $decrypted_secret_key " \
278- --arg env " $deploymentEnvironment " \
279274 --arg model " $model " \
280275 ' {data: {
281276 connection_id: $conn_id,
282277 access_key: $access_key,
283278 secret_key: $secret_key,
284- environment: $env,
285279 model: $model,
286- tags: "aws,bedrock,\($env),\($ model)"
280+ tags: "aws,bedrock,\($model)"
287281 }}' )
288282
289283 log " Storing secrets at path: $vault_path "
@@ -337,17 +331,15 @@ store_azure_llm_secrets() {
337331 --arg endpoint " $targetUrl " \
338332 --arg api_key " $decrypted_api_key " \
339333 --arg deploy_name " $deploymentName " \
340- --arg env " $deploymentEnvironment " \
341334 --arg model " $model " \
342335 ' {data: {
343336 connection_id: $conn_id,
344337 endpoint: $endpoint,
345338 api_key: $api_key,
346339 deployment_name: $deploy_name,
347- environment: $env,
348340 model: $model,
349341 api_version: "2024-05-01-preview",
350- tags: "azure,\($env),\($ model)"
342+ tags: "azure,\($model)"
351343 }}' )
352344
353345 log " Storing secrets at path: $vault_path "
@@ -405,15 +397,13 @@ store_aws_embedding_secrets() {
405397 --arg conn_id " $connectionId " \
406398 --arg access_key " $decrypted_embedding_access_key " \
407399 --arg secret_key " $decrypted_embedding_secret_key " \
408- --arg env " $deploymentEnvironment " \
409400 --arg model " $embeddingModel " \
410401 ' {data: {
411402 connection_id: $conn_id,
412403 access_key: $access_key,
413404 secret_key: $secret_key,
414- environment: $env,
415405 model: $model,
416- tags: "aws,bedrock,embedding,\($env),\($ model)"
406+ tags: "aws,bedrock,embedding,\($model)"
417407 }}' )
418408
419409 log " Storing secrets at path: $vault_path "
@@ -466,17 +456,15 @@ store_azure_embedding_secrets() {
466456 --arg endpoint " $embeddingTargetUri " \
467457 --arg api_key " $decrypted_embedding_api_key " \
468458 --arg deploy_name " $embeddingDeploymentName " \
469- --arg env " $deploymentEnvironment " \
470459 --arg model " $embeddingModel " \
471460 ' {data: {
472461 connection_id: $conn_id,
473462 endpoint: $endpoint,
474463 api_key: $api_key,
475464 deployment_name: $deploy_name,
476- environment: $env,
477465 model: $model,
478466 api_version: "2024-12-01-preview",
479- tags: "azure,embedding,\($env),\($ model)"
467+ tags: "azure,embedding,\($model)"
480468 }}' )
481469
482470 log " Storing secrets at path: $vault_path "
0 commit comments