From d0fb8af3c8cc29e026090fc3868a9a77195d50bc Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 7 Oct 2025 13:49:06 -0400 Subject: [PATCH] poll to ensure securityconfig is applied --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c4f85c68..48c11486 100644 --- a/Makefile +++ b/Makefile @@ -211,9 +211,18 @@ test-ci: for i in $$(seq 1 60); do \ curl -s http://localhost:8000/.well-known/openid-configuration >/dev/null 2>&1 && break || sleep 2; \ done; \ - echo "Waiting for OpenSearch..."; \ + echo "Waiting for OpenSearch with JWT auth to work..."; \ for i in $$(seq 1 60); do \ - curl -k -s https://localhost:9200 -u admin:$${OPENSEARCH_PASSWORD} >/dev/null 2>&1 && break || sleep 2; \ + if curl -k -s https://localhost:9200 -u admin:$${OPENSEARCH_PASSWORD} >/dev/null 2>&1; then \ + TOKEN=$$(curl -s http://localhost:8000/auth/me | grep -o '"token":"[^"]*"' | cut -d'"' -f4 || echo ""); \ + if [ -n "$$TOKEN" ]; then \ + if curl -k -s -H "Authorization: Bearer $$TOKEN" https://localhost:9200/documents/_search -d '{"query":{"match_all":{}}}' 2>&1 | grep -v "Unauthorized" >/dev/null; then \ + echo "OpenSearch JWT auth working"; \ + break; \ + fi; \ + fi; \ + fi; \ + sleep 2; \ done; \ echo "Waiting for Langflow..."; \ for i in $$(seq 1 60); do \