Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sample.federal_policy.yaml
__pycache__/
.DS_Store
.generated/

# Virtru DSP Bundle
virtru-dsp-bundle-*.tar.gz
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ services:
restart: always
volumes:
- ./dsp-keys:/dsp-keys:z
- ./.generated/tagging-pdp-workflows.yaml:/config/tagging-pdp-workflows.yaml:ro,z
environment:
DSP_DB_HOST: localhost
DSP_DB_PORT: 35433
Expand Down
4 changes: 2 additions & 2 deletions dsp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ services:
realm: 'opentdf'
tokenendpoint: *tokenEndpoint
taggingpdp:
configFilePath: "dsp.yaml"
configFilePath: "/config/tagging-pdp-workflows.yaml"
tikaServerUrl: "http://localhost:9998"
sharepoint:
encryptedSearchKeyPath: dsp-keys/encrypted-search.key
Expand Down Expand Up @@ -120,4 +120,4 @@ server:
# Sets whether credentials are included in the CORS request
allowcredentials: true
# Sets the maximum age (in seconds) of a specific CORS preflight request
maxage: 3600
maxage: 3600
72 changes: 71 additions & 1 deletion setup_and_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ fi
# Script must run from DSP-standalone/
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
GENERATED_DIR="$SCRIPT_DIR/.generated"
GENERATED_TAGGING_PDP_WORKFLOW="$GENERATED_DIR/tagging-pdp-workflows.yaml"
log_ok "Working directory: $SCRIPT_DIR"

# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -223,6 +225,69 @@ validate_tools() {
fi
}

resolve_tagging_pdp_workflow_source() {
local bundle_dir="${1:-}"
local default_bundle_dir="$SCRIPT_DIR/virtru-dsp-bundle"
local candidate=""
local prompt_path=""

if [[ -n "$bundle_dir" && -f "$bundle_dir/kubernetes/tagging-pdp-workflows.yaml" ]]; then
candidate="$bundle_dir/kubernetes/tagging-pdp-workflows.yaml"
log_info "Using tagging PDP workflow from bundle: $candidate"
TAGGING_PDP_WORKFLOW_SOURCE="$candidate"
return 0
fi

if [[ -f "$default_bundle_dir/kubernetes/tagging-pdp-workflows.yaml" ]]; then
candidate="$default_bundle_dir/kubernetes/tagging-pdp-workflows.yaml"
log_info "Using tagging PDP workflow from unpacked bundle: $candidate"
TAGGING_PDP_WORKFLOW_SOURCE="$candidate"
return 0
fi

echo
log_warn "tagging-pdp-workflows.yaml was not found in the bundle at ./kubernetes/tagging-pdp-workflows.yaml."
while true; do
read -rp " Enter the path to your tagging PDP workflow YAML: " prompt_path
Comment thread
cassandrabailey293 marked this conversation as resolved.
prompt_path="${prompt_path/#\~/$HOME}"
if [[ -z "$prompt_path" ]]; then
echo " Path cannot be empty."
continue
fi
if [[ ! -f "$prompt_path" ]]; then
echo " File not found: $prompt_path"
continue
fi
TAGGING_PDP_WORKFLOW_SOURCE="$prompt_path"
return 0
done
}

stage_tagging_pdp_workflow() {
local source_path="$1"

mkdir -p "$GENERATED_DIR"
if grep -q '^taggingpdpWorkflows:$' "$source_path" && grep -q '^ config\.yaml:$' "$source_path"; then
awk '
Comment on lines +269 to +271
/^ config\.yaml:$/ { emit=1; next }
emit {
if ($0 ~ /^ /) {
sub(/^ /, "")
print
} else if ($0 ~ /^$/) {
print ""
} else {
exit
}
}
' "$source_path" > "$GENERATED_TAGGING_PDP_WORKFLOW"
log_info "Extracted inner tagging PDP workflow from bundle wrapper format"
else
cp "$source_path" "$GENERATED_TAGGING_PDP_WORKFLOW"
fi
log_ok "Staged tagging PDP workflow: $GENERATED_TAGGING_PDP_WORKFLOW"
}

# ---------------------------------------------------------------------------
# Prerequisites — delegate to OS-specific script
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -550,7 +615,8 @@ print('Updated $DAEMON_JSON')
echo " The proprietary DSP image must be loaded from a Virtru bundle."
echo " Expected layout inside the bundle:"
echo " virtru-dsp-bundle/"
echo " └── dsp (the DSP CLI binary)"
echo " ├── dsp (the DSP CLI binary)"
echo " └── kubernetes/tagging-pdp-workflows.yaml"
echo

# If the prereqs script already unpacked the bundle, use it automatically
Expand Down Expand Up @@ -613,6 +679,10 @@ if [[ "$VALIDATE_ONLY" == false ]]; then
DSP_IMAGE="localhost:5000/virtru/data-security-platform:${DSP_TAG}"
log_ok "DSP image: $DSP_IMAGE"

log_section "Resolving tagging PDP workflow"
resolve_tagging_pdp_workflow_source "${BUNDLE_DIR:-}"
stage_tagging_pdp_workflow "$TAGGING_PDP_WORKFLOW_SOURCE"

log_section "Starting Docker Compose stack"

# On Linux, strip the 'sharepoint' block from dsp.yaml before the build —
Expand Down
Loading