[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	1765079854	auth_token	eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo0LCJyb2xlIjoidXNlciIsImlzcyI6ImNoYXJvbiIsImV4cCI6MTc2NTA3OTg1NH0.bxTPHdemyIVHgoMAYdpRle2p-Ib39t_XtD3fl52cftY
[INFO] Cookie flags (HttpOnly, Secure, SameSite)
  Details: Verify manually in browser DevTools

[1;33mTest 1.2: Certificate List (GET /api/v1/certificates)[0m
Response: [{"id":1,"uuid":"5ae73c68-98e6-4c07-8635-d560c86d3cbf","name":"Bazarr B","domain":"bazarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:00Z","status":"valid","provider":"letsencrypt"},{"id":2,"uuid":"f1adae60-d139-470a-974a-135f41afcd53","name":"boxarr.hatfieldhosted.com","domain":"boxarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:36:59Z","status":"valid","provider":"letsencrypt"},{"id":3,"uuid":"9b0d8ef9-5c5d-4fed-9c5e-5f2d15390257","name":"DockWatch","domain":"dockwatch.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:36:59Z","status":"valid","provider":"letsencrypt"},{"id":4,"uuid":"0c019411-7c08-41e6-96c4-f8aa053bf8ca","name":"FileFlows","domain":"fileflows.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:09Z","status":"valid","provider":"letsencrypt"},{"id":5,"uuid":"3e625a5b-83b2-49dd-bf55-81c81981b83e","name":"HomePage","domain":"homepage.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:00Z","status":"valid","provider":"letsencrypt"},{"id":6,"uuid":"f0f69669-f1c8-4406-9b76-30fd77c8a4bf","name":"Mealie","domain":"mealie.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:10Z","status":"valid","provider":"letsencrypt"},{"id":7,"uuid":"69288ac6-7153-4ee7-9c38-cba3a1afdfd9","name":"NZBGet","domain":"nzbget.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:09Z","status":"valid","provider":"letsencrypt"},{"id":8,"uuid":"7ed8810b-7cfe-4b71-816a-197e5e2e1fa7","name":"peekaping.hatfieldhosted.com","domain":"peekaping.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:36:59Z","status":"valid","provider":"letsencrypt"},{"id":9,"uuid":"d11360b9-4b97-4b04-9746-06dc380ffc0a","name":"Plex","domain":"plex.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:36:59Z","status":"valid","provider":"letsencrypt"},{"id":10,"uuid":"45321f32-cf52-4f14-8c19-581a9acf003c","name":"Profilarr","domain":"profilarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:09Z","status":"valid","provider":"letsencrypt"},{"id":11,"uuid":"b3d1e6b1-bcfc-4010-81da-1b95d2b5667f","name":"Prowlarr","domain":"prowlarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:00Z","status":"valid","provider":"letsencrypt"},{"id":12,"uuid":"4fb1ed5e-4cee-481b-9c23-0f54147efcad","name":"Radarr","domain":"radarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:00Z","status":"valid","provider":"letsencrypt"},{"id":13,"uuid":"7d99d933-799c-49aa-af30-5489056a7d39","name":"Seerr","domain":"seerr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:10Z","status":"valid","provider":"letsencrypt"},{"id":14,"uuid":"4cb870bd-088c-4814-9d46-0fe68b35fe6b","name":"Sonarr","domain":"sonarr.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:36:59Z","status":"valid","provider":"letsencrypt"},{"id":15,"uuid":"c6d6b2f6-a3d0-46a5-a977-3918844e771f","name":"Tautulli","domain":"tautulli.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T18:37:10Z","status":"valid","provider":"letsencrypt"},{"id":17,"uuid":"cfd8e1be-0fea-446d-b9fc-0b4ce7965838","name":"TubeSync","domain":"tubesync.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-02-27T23:44:26Z","status":"valid","provider":"letsencrypt"},{"id":18,"uuid":"29cc5a5d-efa5-4276-9a33-4fb83c46d8b7","name":"integration.local","domain":"integration.local","issuer":"letsencrypt","expires_at":"2025-12-02T09:20:13Z","status":"expired","provider":"letsencrypt"},{"id":19,"uuid":"54eebf88-3f41-421b-8286-885de0c43b34","name":"charon-debug.hatfieldhosted.com","domain":"charon-debug.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-03-04T21:26:40Z","status":"valid","provider":"letsencrypt"},{"id":20,"uuid":"26684bc4-06fb-469f-ae92-6ffdc3d571b8","name":"Charon","domain":"charon.hatfieldhosted.com","issuer":"letsencrypt","expires_at":"2026-03-04T21:29:01Z","status":"valid","provider":"letsencrypt"}]
200
[PASS] Request includes auth_token cookie
[PASS] Certificate list request successful
  Details: HTTP 200
[WARN] Response is not a JSON array

[1;33mTest 1.3: Certificate Upload (POST /api/v1/certificates)[0m
[INFO] Test certificate generated
  Details: /tmp/charon-test-certs
[PASS] Certificate upload successful
  Details: HTTP 201
[INFO] Certificate created with ID: 21

[1;33mTest 1.4: Certificate Delete (DELETE /api/v1/certificates/:id)[0m
[PASS] Certificate delete successful
  Details: HTTP 200

[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: 15
[0;32mPassed: 10[0m
[0;31mFailed: 0
0[0m
[1;33mWarnings: 2[0m
Skipped: 0
0

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

/projects/Charon/scripts/qa-test-auth-certificates.sh: line 284: [: 0
0: integer expression expected
[0;32mAll critical tests PASSED![0m
