mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
hot fix #1
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test script for MyClub Directory Service
|
||||
# This tests the directory registration functionality
|
||||
|
||||
echo "🏃 Testing MyClub Directory Service..."
|
||||
|
||||
# Test 1: Check if backend is running
|
||||
echo "📍 Test 1: Health check"
|
||||
HEALTH=$(curl -s http://localhost:8080/api/v1/health)
|
||||
if [[ $HEALTH == *"status"* ]]; then
|
||||
echo "✅ Backend is running"
|
||||
else
|
||||
echo "❌ Backend is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 2: Test directory info endpoint (should require auth)
|
||||
echo "📍 Test 2: Directory info endpoint (should be protected)"
|
||||
INFO=$(curl -s http://localhost:8080/api/v1/admin/directory/info)
|
||||
if [[ $INFO == *"Authorization"* ]]; then
|
||||
echo "✅ Directory endpoint is properly protected"
|
||||
else
|
||||
echo "❌ Directory endpoint is not protected"
|
||||
fi
|
||||
|
||||
# Test 3: Test directory registration endpoint (should require auth)
|
||||
echo "📍 Test 3: Directory registration endpoint (should be protected)"
|
||||
REGISTER=$(curl -s -X POST http://localhost:8080/api/v1/admin/directory/register \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"test":"data"}')
|
||||
if [[ $REGISTER == *"unauthorized"* ]] || [[ $REGISTER == *"Authorization"* ]]; then
|
||||
echo "✅ Directory registration endpoint is properly protected"
|
||||
else
|
||||
echo "❌ Directory registration endpoint is not protected"
|
||||
fi
|
||||
|
||||
# Test 4: Test mobile app directory service (fallback)
|
||||
echo "📍 Test 4: Mobile app directory service fallback"
|
||||
cd /home/tdvorak/Desktop/PROG+HTML/Fotbal/fotbal-club/app
|
||||
if [ -f "src/services/directory.ts" ]; then
|
||||
if grep -q "CENTRAL_DIRECTORY_URL" src/services/directory.ts; then
|
||||
echo "✅ Mobile app directory service is configured"
|
||||
echo "📱 Central Directory URL: $(grep -o 'https://[^"]*' src/services/directory.ts | head -1)"
|
||||
else
|
||||
echo "❌ Mobile app directory service is not configured"
|
||||
fi
|
||||
else
|
||||
echo "❌ Mobile app directory service file not found"
|
||||
fi
|
||||
|
||||
# Test 5: Check environment variables
|
||||
echo "📍 Test 5: Environment variables"
|
||||
cd /home/tdvorak/Desktop/PROG+HTML/Fotbal/fotbal-club
|
||||
if grep -q "DIRECTORY_INGEST_URL" .env; then
|
||||
echo "✅ Directory ingest URL is configured"
|
||||
echo "🌐 Directory URL: $(grep DIRECTORY_INGEST_URL .env)"
|
||||
else
|
||||
echo "❌ Directory ingest URL is not configured"
|
||||
fi
|
||||
|
||||
if grep -q "DIRECTORY_INGEST_TOKEN" .env; then
|
||||
echo "✅ Directory ingest token is configured"
|
||||
else
|
||||
echo "❌ Directory ingest token is not configured"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "🎯 Summary:"
|
||||
echo " - Backend directory endpoints are implemented and protected"
|
||||
echo " - Mobile app directory service is configured for central directory"
|
||||
echo " - Environment variables are set for cross-domain communication"
|
||||
echo " - Ready for central directory deployment at error.sportcreative.eu"
|
||||
echo ""
|
||||
echo "📋 Next Steps:"
|
||||
echo " 1. Deploy central directory service to error.sportcreative.eu"
|
||||
echo " 2. Test cross-domain registration with real domain"
|
||||
echo " 3. Verify mobile app can discover clubs from central directory"
|
||||
Reference in New Issue
Block a user