feat: align DDS with common permission and vector flow

This commit is contained in:
devmrko
2026-06-29 23:50:42 +09:00
parent ad9a2b7dd4
commit 2e4bcef44f
21 changed files with 1207 additions and 25 deletions

View File

@@ -6,6 +6,18 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
APP_DIR="${DDS_BACKOFFICE_APP_DIR:-/home/opc/apps/dds-backoffice}"
PORT="${DDS_BACKOFFICE_PORT:-8083}"
if [[ -f /home/opc/apps/vpd-backoffice/.env ]]; then
set -a
. /home/opc/apps/vpd-backoffice/.env
set +a
fi
cd "$ROOT"
mvn -DskipTests package
mvn install:install-file \
-Dfile="$ROOT/target/vpd-permission-backoffice-0.1.0-SNAPSHOT.jar.original" \
-DpomFile="$ROOT/pom.xml"
cd "$ROOT/dds-backoffice"
mvn -DskipTests package
JAR="$ROOT/dds-backoffice/target/dds-permission-backoffice-0.1.0-SNAPSHOT.jar"
@@ -95,11 +107,41 @@ install -o opc -g opc -m 0644 "$JAR" "$APP_DIR/app.jar"
"$APP_DIR/start.sh"
for _ in {1..30}; do
if "$APP_DIR/status.sh" | grep -q '^running ' && curl -fsS -o /dev/null "http://127.0.0.1:${PORT}/health"; then
if "$APP_DIR/status.sh" | grep -q '^running ' && curl -fsS -o /dev/null "http://127.0.0.1:${PORT}/login"; then
break
fi
sleep 1
done
"$APP_DIR/status.sh"
curl -sS -o /tmp/dds-backoffice-health.json -w 'health=%{http_code}\n' "http://127.0.0.1:${PORT}/health"
curl -sS -o /tmp/dds-backoffice-login.html -w 'login=%{http_code}\n' "http://127.0.0.1:${PORT}/login"
for path in / /users /groups /roles /permissions /effective-matrix /vpd-policies /vector-knowledge /dds; do
curl -sS --connect-timeout 3 --max-time 20 -u "${BACKOFFICE_ADMIN_USER:-}:${BACKOFFICE_ADMIN_PASSWORD:-}" \
-o "/tmp/dds-backoffice-check-${path#/}.html" \
-w "${path}=%{http_code}\n" "http://127.0.0.1:${PORT}${path}" || true
done
SMOKE_COOKIE="/tmp/dds-backoffice-smoke.cookies"
SMOKE_PAGE="/tmp/dds-backoffice-smoke-page.html"
SMOKE_RESULT="/tmp/dds-backoffice-smoke-result.html"
if curl -sS --connect-timeout 3 --max-time 20 -c "$SMOKE_COOKIE" \
-u "${BACKOFFICE_ADMIN_USER:-}:${BACKOFFICE_ADMIN_PASSWORD:-}" \
-o "$SMOKE_PAGE" "http://127.0.0.1:${PORT}/vector-knowledge"; then
CSRF_TOKEN="$(sed -n 's/.*name="_csrf" value="\([^"]*\)".*/\1/p' "$SMOKE_PAGE" | head -1)"
if [[ -n "$CSRF_TOKEN" ]]; then
for smoke_user in both none; do
curl -sS --connect-timeout 3 --max-time 30 -b "$SMOKE_COOKIE" -c "$SMOKE_COOKIE" \
-u "${BACKOFFICE_ADMIN_USER:-}:${BACKOFFICE_ADMIN_PASSWORD:-}" \
-H "X-CSRF-TOKEN: $CSRF_TOKEN" \
-H 'HX-Request: true' \
--data-urlencode "_csrf=$CSRF_TOKEN" \
--data-urlencode "userKey=$smoke_user" \
--data-urlencode 'query=Oracle VPD ORDS 권한 태그 검색' \
--data-urlencode 'limit=10' \
--data-urlencode 'embeddingMode=DEMO' \
-o "${SMOKE_RESULT}.${smoke_user}" "http://127.0.0.1:${PORT}/vector-knowledge/search" || true
echo "vector-search-user=${smoke_user}"
rg -n "DDS 권한으로 검색했습니다|DATA GRANT를 통과|ORA-00942|데이터베이스 오류" \
"${SMOKE_RESULT}.${smoke_user}" | head -20 || true
done
fi
fi
echo "DDS backoffice deployed at ${APP_DIR} (loopback port ${PORT})"