http status code
This commit is contained in:
parent
ccf54d08fb
commit
67b40324b8
1 changed files with 14 additions and 9 deletions
23
Makefile
23
Makefile
|
|
@ -211,10 +211,14 @@ test-ci:
|
||||||
for i in $$(seq 1 60); do \
|
for i in $$(seq 1 60); do \
|
||||||
docker exec openrag-backend curl -s http://localhost:8000/.well-known/openid-configuration >/dev/null 2>&1 && break || sleep 2; \
|
docker exec openrag-backend curl -s http://localhost:8000/.well-known/openid-configuration >/dev/null 2>&1 && break || sleep 2; \
|
||||||
done; \
|
done; \
|
||||||
echo "Checking if OpenSearch security config was applied..."; \
|
echo "Waiting for OpenSearch security config to be fully applied..."; \
|
||||||
docker exec os ls -la /usr/share/opensearch/setup-security.sh 2>/dev/null || echo "setup-security.sh not found in container"; \
|
for i in $$(seq 1 60); do \
|
||||||
echo "Checking OpenSearch security config:"; \
|
if docker logs os 2>&1 | grep -q "Security configuration applied successfully"; then \
|
||||||
docker exec os curl -k -u admin:$${OPENSEARCH_PASSWORD} https://localhost:9200/_opendistro/_security/api/securityconfig 2>/dev/null | head -50; \
|
echo "✓ Security configuration applied"; \
|
||||||
|
break; \
|
||||||
|
fi; \
|
||||||
|
sleep 2; \
|
||||||
|
done; \
|
||||||
echo "Checking key files..."; \
|
echo "Checking key files..."; \
|
||||||
ls -la keys/; \
|
ls -la keys/; \
|
||||||
echo "Public key hash (host):"; \
|
echo "Public key hash (host):"; \
|
||||||
|
|
@ -231,11 +235,12 @@ test-ci:
|
||||||
JWT_AUTH_READY=false; \
|
JWT_AUTH_READY=false; \
|
||||||
for i in $$(seq 1 60); do \
|
for i in $$(seq 1 60); do \
|
||||||
if curl -k -s https://localhost:9200 -u admin:$${OPENSEARCH_PASSWORD} >/dev/null 2>&1; then \
|
if curl -k -s https://localhost:9200 -u admin:$${OPENSEARCH_PASSWORD} >/dev/null 2>&1; then \
|
||||||
RESPONSE=$$(curl -k -s -H "Authorization: Bearer $$TEST_TOKEN" https://localhost:9200/documents/_search -d '{"query":{"match_all":{}}}' 2>&1); \
|
HTTP_CODE=$$(curl -k -s -w "%{http_code}" -o /tmp/os_response.txt -H "Authorization: Bearer $$TEST_TOKEN" -H "Content-Type: application/json" https://localhost:9200/documents/_search -d '{"query":{"match_all":{}}}' 2>&1); \
|
||||||
echo "Attempt $$i response: $$RESPONSE"; \
|
RESPONSE=$$(cat /tmp/os_response.txt); \
|
||||||
if echo "$$RESPONSE" | grep -v "Unauthorized" >/dev/null; then \
|
echo "Attempt $$i: HTTP $$HTTP_CODE"; \
|
||||||
echo "✓ OpenSearch JWT check passed after $$((i*2)) seconds"; \
|
echo "Response: $$RESPONSE"; \
|
||||||
echo "Full response: $$RESPONSE"; \
|
if [ "$$HTTP_CODE" = "200" ]; then \
|
||||||
|
echo "✓ OpenSearch JWT auth working after $$((i*2)) seconds"; \
|
||||||
JWT_AUTH_READY=true; \
|
JWT_AUTH_READY=true; \
|
||||||
break; \
|
break; \
|
||||||
fi; \
|
fi; \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue