-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_auth_direct.py
More file actions
59 lines (53 loc) · 2 KB
/
Copy pathtest_auth_direct.py
File metadata and controls
59 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
"""
Direct test of auth service login endpoint
"""
import requests
import json
def test_auth_direct():
"""Test auth service directly"""
print("Testing auth service directly...")
# Test health endpoint
try:
response = requests.get("http://localhost:8082/health", timeout=5)
print(f"Health check: {response.status_code} - {response.text}")
except Exception as e:
print(f"Health check failed: {e}")
return False
# Test login with various credentials
login_attempts = [
{"email": "admin", "password": "password"},
{"email": "admin", "password": "admin"},
{"email": "admin", "password": "admin123"},
{"email": "admin@helixflow.com", "password": "password"},
{"email": "demo", "password": "password"},
{"email": "demo", "password": "demo"},
{"email": "demo@helixflow.com", "password": "password"},
{"email": "testuser", "password": "password"},
{"email": "testuser", "password": "test"},
{"email": "test@example.com", "password": "password"},
]
for attempt in login_attempts:
print(f"\nTrying {attempt['email']} with password '{attempt['password']}'")
try:
response = requests.post(
"http://localhost:8082/login",
json=attempt,
timeout=5
)
print(f" Status: {response.status_code}")
if response.status_code == 200:
print(f" ✅ SUCCESS: {response.text}")
return True
elif response.status_code == 401:
print(f" ❌ Authentication failed")
else:
print(f" ⚠️ Unexpected response: {response.text}")
except Exception as e:
print(f" ❌ Error: {e}")
return False
if __name__ == "__main__":
if test_auth_direct():
print("\n🎉 Authentication working!")
else:
print("\n❌ Authentication failed for all attempts")