6 Commits

Author SHA1 Message Date
Mondo Diaz
15954b58f7 Fix empty string handling for test password env var 2026-01-27 19:30:08 +00:00
Mondo Diaz
4fc8ca66e7 Use CI variable for dev admin password
- Remove hardcoded adminPassword from values-dev.yaml
- Pass DEV_ADMIN_PASSWORD via --set in deploy_feature
- Use same variable in integration_test_feature

Requires DEV_ADMIN_PASSWORD to be set in GitLab CI/CD variables.
2026-01-27 19:22:32 +00:00
Mondo Diaz
aeb805e975 Make auth tests use configurable admin password
- Add get_admin_password() and get_admin_username() helpers to conftest.py
- Update test_auth_api.py to use helpers instead of hardcoded credentials
- Allows tests to work with different passwords in feature/stage/prod envs

The ORCHARD_TEST_PASSWORD environment variable is set by CI jobs to match
the deployed environment's admin password.
2026-01-27 19:15:18 +00:00
Mondo Diaz
0dd1eb6d59 Add debug output for integration test environment variables
Print ORCHARD_TEST_URL and ORCHARD_TEST_PASSWORD to diagnose
why tests are failing with 401 - the password variable may not
be reaching the pytest execution.
2026-01-27 19:04:40 +00:00
Mondo Diaz
0cf349ddb3 Simplify stage CI jobs to use CI variable for admin password
- Replace in-cluster k8s jobs with standard CI runner execution
- Use STAGE_ADMIN_PASSWORD CI variable instead of Secrets Manager
- Simplify reset_stage_template (no longer needs kubectl/IRSA)
- integration_test_stage now uses standard integration_test_template

Requires setting STAGE_ADMIN_PASSWORD CI variable in GitLab settings.
2026-01-27 18:39:20 +00:00
Mondo Diaz
1f3e19d3a5 Add configurable admin password via environment variable
- Add ORCHARD_ADMIN_PASSWORD env var to set initial admin password
- When set, admin user created without forced password change
- Add AWS Secrets Manager support for stage/prod deployments
- Add .env file support for local docker development
- Add Helm chart auth config (adminPassword, existingSecret, secretsManager)

Environments configured:
- Local: .env file or defaults to changeme123
- Feature/dev: orchardtest123 (hardcoded in values-dev.yaml)
- Stage: AWS Secrets Manager (orchard-stage-creds)
- Prod: AWS Secrets Manager (orch-prod-creds)
2026-01-27 17:53:56 +00:00

View File

@@ -68,12 +68,13 @@ def get_admin_password() -> str:
Returns the password from ORCHARD_TEST_PASSWORD environment variable,
or 'changeme123' as the default for local development.
"""
return os.environ.get("ORCHARD_TEST_PASSWORD", "changeme123")
# Use 'or' to handle empty string (when CI variable is undefined)
return os.environ.get("ORCHARD_TEST_PASSWORD") or "changeme123"
def get_admin_username() -> str:
"""Get the admin username for test authentication."""
return os.environ.get("ORCHARD_TEST_USERNAME", "admin")
return os.environ.get("ORCHARD_TEST_USERNAME") or "admin"
# Re-export factory functions for backward compatibility
@@ -248,9 +249,9 @@ def integration_client():
import httpx
# Connect to the running orchard-server container or deployed environment
base_url = os.environ.get("ORCHARD_TEST_URL", "http://localhost:8080")
username = os.environ.get("ORCHARD_TEST_USERNAME", "admin")
password = os.environ.get("ORCHARD_TEST_PASSWORD", "changeme123")
base_url = os.environ.get("ORCHARD_TEST_URL") or "http://localhost:8080"
username = get_admin_username()
password = get_admin_password()
with httpx.Client(base_url=base_url, timeout=30.0) as client:
# Login as admin to enable write operations