Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
e6d2aad
added initial setup for the vector indexer
nuwangeek Oct 3, 2025
2868fe8
initial llm orchestration service update with context generation
nuwangeek Oct 3, 2025
931ccf0
added new endpoints
nuwangeek Oct 7, 2025
9a7cf79
vector indexer with contextual retrieval
nuwangeek Oct 12, 2025
964e54e
Merge pull request #40 from rootcodelabs/wip
nuwangeek Oct 12, 2025
3926fd7
fixed merge conflicts
nuwangeek Oct 12, 2025
844747f
fixed requested changes
nuwangeek Oct 12, 2025
1cc14a2
fixed issue
nuwangeek Oct 12, 2025
58c808e
initial diff identifier setup
nuwangeek Oct 14, 2025
c17aeb3
uncommment docker compose file
nuwangeek Oct 14, 2025
6449751
added test endpoint for orchestrate service
nuwangeek Oct 14, 2025
d93ebfb
fixed ruff linting issue
nuwangeek Oct 14, 2025
5f1b190
Rag 103 budget related schema changes (#41)
erangi-ar Oct 14, 2025
10987ca
Rag 93 update connection status (#47)
erangi-ar Oct 14, 2025
57601a9
Rag 99 production llm connections logic (#46)
erangi-ar Oct 14, 2025
bbf9dde
Rag 119 endpoint to update used budget (#42)
erangi-ar Oct 14, 2025
e74ec2e
Rag 113 warning and termination banners (#43)
erangi-ar Oct 14, 2025
acfd222
rag-105-reset-used-budget-cron-job (#44)
erangi-ar Oct 14, 2025
26f3d4e
Rag 101 budget check functionality (#45)
erangi-ar Oct 14, 2025
513e11e
Merge branch 'integration-temp' into RAG-33
nuwangeek Oct 14, 2025
e363e28
Merge pull request #48 from rootcodelabs/RAG-33
nuwangeek Oct 14, 2025
5f73e68
Merge pull request #49 from rootcodelabs/RAG-128
nuwangeek Oct 14, 2025
8653b48
gui running on 3003 issue fixed
Oct 14, 2025
6305ba2
gui running on 3003 issue fixed (#50)
erangi-ar Oct 14, 2025
c423bf6
added get-configuration.sqpl and updated llmconnections.ts
nuwangeek Oct 14, 2025
e7b8033
Merge branch 'integration-temp' of https://github.com/rootcodelabs/RA…
nuwangeek Oct 14, 2025
4f9dbc5
Add SQL query to retrieve configuration values
Oct 15, 2025
b9d133f
Hashicorp key saving (#51)
erangi-ar Oct 15, 2025
b09e103
Remove REACT_APP_NOTIFICATION_NODE_URL variable
erangi-ar Oct 15, 2025
89018bc
added initil diff identifier functionality
nuwangeek Oct 15, 2025
dd64439
Merge branch 'integration-temp' of https://github.com/rootcodelabs/RA…
nuwangeek Oct 15, 2025
d989ced
test phase1
nuwangeek Oct 15, 2025
c519a2e
Refactor inference and connection handling in YAML and TypeScript files
Oct 16, 2025
f9fa6ac
Merge branch 'integration-temp' of https://github.com/rootcodelabs/RA…
Oct 16, 2025
cedc413
fixes (#52)
erangi-ar Oct 16, 2025
e5b52b2
Add entry point script for Vector Indexer with command line interface
Oct 16, 2025
982ab10
fix (#53)
erangi-ar Oct 16, 2025
2092f4c
diff fixes
nuwangeek Oct 16, 2025
81e3aaa
fixed issue
nuwangeek Oct 16, 2025
8e22d48
Merge branch 'wip' into hashicorp-key-saving
erangi-ar Oct 16, 2025
d7b6d8e
uncomment llm orchestration service in docker compose file
nuwangeek Oct 16, 2025
987bfd4
Merge pull request #55 from rootcodelabs/integration-temp
nuwangeek Oct 16, 2025
4d14f8a
fix merge conflict after taking pull from integration-temp branch
nuwangeek Oct 16, 2025
31d6155
complete vector indexer
nuwangeek Oct 18, 2025
4814e81
Merge branch 'wip' into integration-temp
erangi-ar Oct 20, 2025
6300ed0
Add YAML configurations and scripts for managing vault secrets
Oct 20, 2025
b5266f6
Merge branch 'hashicorp-key-saving' of https://github.com/rootcodelab…
Oct 20, 2025
cd3a0c8
Add vault secret management functions and endpoints for LLM connections
Oct 20, 2025
cd49f7d
Add Test Production LLM page with messaging functionality and styles
Oct 20, 2025
6330738
fixed issue
nuwangeek Oct 21, 2025
b8c36eb
fixed merge conflicts
nuwangeek Oct 21, 2025
ebb54a7
fixed issue
nuwangeek Oct 21, 2025
e9fff3f
Merge branch 'integration-temp' of https://github.com/rootcodelabs/RA…
nuwangeek Oct 21, 2025
8c0bc61
fixed issue
nuwangeek Oct 21, 2025
88ee82e
fixed merge conflicts
nuwangeek Oct 21, 2025
bd31498
Merge pull request #56 from rootcodelabs/RAG-32
nuwangeek Oct 21, 2025
00eb138
Merge pull request #58 from rootcodelabs/integration-temp
nuwangeek Oct 21, 2025
c5146bd
updated with requested chnages
nuwangeek Oct 21, 2025
0c5d650
Merge pull request #59 from rootcodelabs/RAG-32
nuwangeek Oct 21, 2025
dd76c72
fixed test ui endpoint request responses schema issue
nuwangeek Oct 22, 2025
2765095
fixed dvc path issue
nuwangeek Oct 22, 2025
d892b1b
fixed merge conflicts with test-prod-llm-ui
nuwangeek Oct 22, 2025
11bd4b3
Merge pull request #60 from rootcodelabs/integration-temp
nuwangeek Oct 22, 2025
019afa8
Merge pull request #61 from rootcodelabs/test-prod-llm-ui
nuwangeek Oct 22, 2025
88a6d3d
added dspy optimization
nuwangeek Oct 23, 2025
ad0ac28
Merge pull request #62 from rootcodelabs/dspy-optimization
nuwangeek Oct 23, 2025
5e0c52e
filters fixed
Oct 23, 2025
50ef120
refactor: restructure llm_connections table for improved configuratio…
Oct 23, 2025
e4e1f48
feat: enhance LLM connection handling with AWS and Azure embedding cr…
Oct 24, 2025
c69c447
fixed issues
nuwangeek Oct 26, 2025
922c224
refactor: remove redundant Azure and AWS credential assignments in va…
Oct 27, 2025
e5d934f
Merge branch 'pre-demo-fixes' of https://github.com/rootcodelabs/RAG-…
Oct 27, 2025
3c1b41d
merge wip
Oct 27, 2025
946e230
fixed issue
nuwangeek Oct 28, 2025
445114e
intial vault setup script
nuwangeek Oct 30, 2025
39392b9
complete vault authentication handling
nuwangeek Nov 4, 2025
cfb52a2
Merge pull request #67 from rootcodelabs/wip
nuwangeek Nov 4, 2025
a4193da
review requested change fix
nuwangeek Nov 4, 2025
72aca44
fixed issues according to the pr review
nuwangeek Nov 4, 2025
9d4da9c
fixed issues in docker compose file relevent to pr review
nuwangeek Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 179 additions & 4 deletions DSL/CronManager/script/delete_secrets_from_vault.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,182 @@
#!/bin/bash

echo "cookie"
echo $cookie
# Vault Secrets Deletion Script
# This script deletes LLM and embedding credentials from HashiCorp Vault

echo "llmPlatform"
echo $llmPlatform
set -e # Exit on any error

# Configuration
VAULT_ADDR="${VAULT_ADDR:-http://vault:8200}"
VAULT_TOKEN_FILE="/agent/out/token"

# Logging function
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
}

log "=== Starting Vault Secrets Deletion ==="

# Debug: Print received parameters
log "Received parameters:"
log " connectionId: $connectionId"
log " llmPlatform: $llmPlatform"
log " llmModel: $llmModel"
log " embeddingModel: $embeddingModel"
log " embeddingPlatform: $embeddingPlatform"
log " deploymentEnvironment: $deploymentEnvironment"

# Read vault token
if [ ! -f "$VAULT_TOKEN_FILE" ]; then
log "ERROR: Vault token file not found at $VAULT_TOKEN_FILE"
exit 1
fi

VAULT_TOKEN=$(cat "$VAULT_TOKEN_FILE")
if [ -z "$VAULT_TOKEN" ]; then
log "ERROR: Vault token is empty"
exit 1
fi

log "Vault token loaded successfully"

# Function to determine platform name
get_platform_name() {
local platform=$1
case "$platform" in
"aws") echo "aws_bedrock" ;;
"azure") echo "azure_openai" ;;
*)
log "ERROR: Unsupported platform: $platform"
exit 1
;;
esac
}

# Function to get model name (first element from array)
get_model_name() {
local model_array=$1
# Remove brackets and quotes, get first element
echo "$model_array" | sed 's/\[//g' | sed 's/\]//g' | sed 's/"//g' | cut -d',' -f1 | xargs
}

# Function to build vault path
build_vault_path() {
local secret_type=$1 # "llm" or "embeddings"
local platform_name=$2
local model_name=$3

if [ "$deploymentEnvironment" = "test" ]; then
echo "secret/$secret_type/connections/$platform_name/$deploymentEnvironment/$connectionId"
else
echo "secret/$secret_type/connections/$platform_name/$deploymentEnvironment/$model_name"
fi
}

# Function to delete vault secret (both data and metadata)
delete_vault_secret() {
local vault_path=$1
local secret_description=$2

log "Deleting $secret_description at path: $vault_path"

# Convert path for KV v2 API (secret/path -> secret/data/path and secret/metadata/path)
local data_path=$(echo "$vault_path" | sed 's|^secret/|secret/data/|')
local metadata_path=$(echo "$vault_path" | sed 's|^secret/|secret/metadata/|')

log "Data API URL: $VAULT_ADDR/v1/$data_path"
log "Metadata API URL: $VAULT_ADDR/v1/$metadata_path"

local success=true

# Delete secret data
log "Deleting secret data..."
local data_response=$(curl -s -w "HTTPSTATUS:%{http_code}" \
-X DELETE \
-H "X-Vault-Token: $VAULT_TOKEN" \
"$VAULT_ADDR/v1/$data_path")

local data_http_code=$(echo "$data_response" | grep -o "HTTPSTATUS:[0-9]*" | cut -d: -f2)
local data_body=$(echo "$data_response" | sed -E 's/HTTPSTATUS:[0-9]*$//')

if [[ "$data_http_code" -ge 200 && "$data_http_code" -lt 300 ]] || [[ "$data_http_code" == "404" ]]; then
log "Secret data deleted successfully (HTTP $data_http_code)"
else
log "WARNING: Failed to delete secret data (HTTP $data_http_code)"
log "Data response: $data_body"
success=false
fi

# Delete secret metadata
log "Deleting secret metadata..."
local metadata_response=$(curl -s -w "HTTPSTATUS:%{http_code}" \
-X DELETE \
-H "X-Vault-Token: $VAULT_TOKEN" \
"$VAULT_ADDR/v1/$metadata_path")

local metadata_http_code=$(echo "$metadata_response" | grep -o "HTTPSTATUS:[0-9]*" | cut -d: -f2)
local metadata_body=$(echo "$metadata_response" | sed -E 's/HTTPSTATUS:[0-9]*$//')

if [[ "$metadata_http_code" -ge 200 && "$metadata_http_code" -lt 300 ]] || [[ "$metadata_http_code" == "404" ]]; then
log "Secret metadata deleted successfully (HTTP $metadata_http_code)"
else
log "WARNING: Failed to delete secret metadata (HTTP $metadata_http_code)"
log "Metadata response: $metadata_body"
success=false
fi

if [ "$success" = true ]; then
log "$secret_description deletion completed successfully"
else
log "WARNING: $secret_description deletion completed with some failures"
fi

return 0 # Continue even if some deletions fail
}

# Function to delete LLM secrets
delete_llm_secrets() {
if [ -z "$llmPlatform" ] || [ -z "$llmModel" ]; then
log "No LLM platform or model specified, skipping LLM secrets deletion"
return 0
fi

local platform_name=$(get_platform_name "$llmPlatform")
local model_name=$(get_model_name "$llmModel")
local vault_path=$(build_vault_path "llm" "$platform_name" "$model_name")

delete_vault_secret "$vault_path" "LLM secrets"
}

# Function to delete embedding secrets
delete_embedding_secrets() {
if [ -z "$embeddingPlatform" ] || [ -z "$embeddingModel" ]; then
log "No embedding platform or model specified, skipping embedding secrets deletion"
return 0
fi

local platform_name=$(get_platform_name "$embeddingPlatform")
local vault_path=$(build_vault_path "embeddings" "$platform_name" "$embeddingModel")

delete_vault_secret "$vault_path" "Embedding secrets"
}

# Main execution
if [ -n "$llmPlatform" ]; then
log "LLM Platform: $(get_platform_name "$llmPlatform")"
fi

if [ -n "$llmModel" ]; then
log "LLM Model: $(get_model_name "$llmModel")"
fi

if [ -n "$embeddingPlatform" ]; then
log "Embedding Platform: $(get_platform_name "$embeddingPlatform")"
fi

# Delete LLM secrets
delete_llm_secrets

# Delete embedding secrets
delete_embedding_secrets

log "=== Vault secrets deletion completed ==="
Loading
Loading