Files
query-orchestration/cmd/auth_related/permit_test/permit.opa.testing/put-policy-data.sh
T

15 lines
375 B
Bash
Raw Normal View History

#!/bin/bash
set -e
echo "Waiting for OPA to be ready..."
until curl -f http://localhost:8181/v1/data > /dev/null 2>&1; do
echo "OPA not ready yet, waiting..."
sleep 2
done
echo "Loading policy data into OPA..."
curl -X PUT http://localhost:8181/v1/data/static \
-H "Content-Type: application/json" \
-d @policy-data.json
echo "Policy data loaded successfully!"