[0;34m=== QA Test: Certificate Page Authentication ===[0m
Testing authentication fixes for certificate endpoints
Base URL: http://localhost:8080


[0;34m=== Phase 1: Certificate Page Authentication Tests ===[0m

[1;33mTest 1.1: Login and Cookie Verification[0m
[PASS] Login successful
  Details: HTTP 200
[PASS] auth_token cookie created
  Cookie details: #HttpOnly_localhost	FALSE	/	FALSE	1765079377	auth_token	eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo0LCJyb2xlIjoidXNlciIsImlzcyI6ImNoYXJvbiIsImV4cCI6MTc2NTA3OTM3N30.rIB24pLdoEMJ9OCbIowOvUHhPoFgWOh2dqXO97IMeTs
[INFO] Cookie flags (HttpOnly, Secure, SameSite)
  Details: Verify manually in browser DevTools

[1;33mTest 1.2: Certificate List (GET /api/v1/certificates)[0m
Response: {"error":"unauthorized"}
401
[PASS] Request includes auth_token cookie
[FAIL] Authentication failed - 401 Unauthorized
  Details: Cookie not being sent or not valid
Response body: {"error":"unauthorized"}
401

[1;33mTest 1.3: Certificate Upload (POST /api/v1/certificates)[0m
[INFO] Test certificate generated
  Details: /tmp/charon-test-certs
[FAIL] Upload authentication failed - 401 Unauthorized
  Details: Cookie not being sent

[1;33mTest 1.4: Certificate Delete (DELETE /api/v1/certificates/:id)[0m
[SKIP] Certificate delete test
  Details: Upload test did not create a certificate

[1;33mTest 1.5: Unauthorized Access[0m
[PASS] Unauthorized access properly rejected
  Details: HTTP 401

[0;34m=== Phase 2: Regression Testing Other Endpoints ===[0m

[1;33mRe-authenticating for regression tests...[0m

[1;33mTest 2.1: Proxy Hosts Page (GET /api/v1/proxy-hosts)[0m
[PASS] Proxy hosts list successful
  Details: HTTP 200

[1;33mTest 2.2: Backups Page (GET /api/v1/backups)[0m
[PASS] Backups list successful
  Details: HTTP 200

[1;33mTest 2.3: Settings Page (GET /api/v1/settings)[0m
[PASS] Settings list successful
  Details: HTTP 200

[1;33mTest 2.4: User Management (GET /api/v1/users)[0m
[WARN] Users request failed
  Details: HTTP 403

[0;34m=== Test Summary ===[0m


[0;34m=== Test Results Summary ===[0m

Total Tests: 13
[0;32mPassed: 7[0m
[0;31mFailed: 2[0m
[1;33mWarnings: 1[0m
Skipped: 1

Full test results saved to: /projects/Charon/test-results/qa-auth-test-results.log

[0;31mSome tests FAILED. Review the results above.[0m
