diff --git a/.gitignore b/.gitignore index d66e7eb58..d19f21e69 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,9 @@ tracker_tasks.json # Schema metadata snapshot schema-metadata-snapshot.json +-e +# Environment files with sensitive data +.env.production +.env.staging +.env.local +.env.*.local diff --git a/infra/docker/infra.yml b/infra/docker/infra.yml index 5e5327d08..13602c7ca 100644 --- a/infra/docker/infra.yml +++ b/infra/docker/infra.yml @@ -8,7 +8,7 @@ services: environment: POSTGRES_DB: xiaoxia_saas POSTGRES_USER: xiaoxia - POSTGRES_PASSWORD: xiaoxia_password + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme_in_production} ports: - "5432:5432" volumes: diff --git a/packages/application/auth/jwt_handler.py b/packages/application/auth/jwt_handler.py index 7c0efef84..53766e71d 100644 --- a/packages/application/auth/jwt_handler.py +++ b/packages/application/auth/jwt_handler.py @@ -7,7 +7,7 @@ JWT 处理器委托层 使用方式: from packages.application.auth.jwt_handler import JWTHandler, get_jwt_handler - jwt_handler = JWTHandler(secret_key="your-secret-key") + jwt_handler = JWTHandler(secret_key="") token = jwt_handler.create_access_token(user_id="user123", workspace_id="ws456", role="admin") payload = jwt_handler.verify_access_token(token) """ diff --git a/scripts/smoke_public_auth_flow.py b/scripts/smoke_public_auth_flow.py index 0e6996c04..93470e5e2 100644 --- a/scripts/smoke_public_auth_flow.py +++ b/scripts/smoke_public_auth_flow.py @@ -8,6 +8,7 @@ login, /auth/me, and /workspaces. Uses only the Python standard library. from __future__ import annotations import argparse +import os import json import time import urllib.error @@ -41,7 +42,7 @@ def main() -> int: timestamp = int(time.time()) email = f"smoke-{timestamp}@example.com" username = f"smoke{timestamp}" - password = "AuditPass123!" + password = os.environ.get("SMOKE_TEST_PASSWORD", "changeme") register_status, register_body = request_json( "POST", diff --git a/scripts/smoke_public_boundary_flow.py b/scripts/smoke_public_boundary_flow.py index 577b7bb45..4d9b356bb 100644 --- a/scripts/smoke_public_boundary_flow.py +++ b/scripts/smoke_public_boundary_flow.py @@ -4,10 +4,11 @@ import io import time import uuid +import os import requests BASE_URL = "https://saas.xiaoxiajianji.com/api/v1" -PASSWORD = "SmokePass123!" +PASSWORD = os.environ.get("SMOKE_TEST_PASSWORD", "changeme") def _json_or_raise(name: str, response: requests.Response) -> dict: diff --git a/scripts/smoke_public_upload_flow.py b/scripts/smoke_public_upload_flow.py index 10aa7170e..8946f414a 100644 --- a/scripts/smoke_public_upload_flow.py +++ b/scripts/smoke_public_upload_flow.py @@ -10,10 +10,11 @@ import io import time import uuid +import os import requests BASE_URL = "https://saas.xiaoxiajianji.com/api/v1" -PASSWORD = "SmokePass123!" +PASSWORD = os.environ.get("SMOKE_TEST_PASSWORD", "changeme") def _json_or_raise(name: str, response: requests.Response) -> dict: