fix: 修正合并进来的 test_security.py 两处密钥路径漂移(漏 dev/,标准布局下必红 2 个用例)

This commit is contained in:
2026-09-12 12:09:55 +08:00
parent 441364437c
commit 2bb056e516
+2 -2
View File
@@ -45,7 +45,7 @@ def test_authenticate_valid_token() -> None:
def test_authenticate_visitor_token_returns_limited_anonymous_context() -> None:
now = datetime.now(UTC)
private_key = Path("config/jwt/jwt-private.pem").read_text(encoding="utf-8")
private_key = (DEV_KEY_DIR / "jwt-private.pem").read_text(encoding="utf-8")
token = jwt.encode(
{"sub": "2", "iss": "jr-auth", "aud": "jr-agent-platform", "iat": now,
"nbf": now, "exp": now + timedelta(minutes=5), "jti": "visitor-jti-1",
@@ -105,7 +105,7 @@ async def test_visitor_token_skips_identity_database_resolution(monkeypatch):
from app.api.dependencies.auth import _authenticator, build_request_context
now = datetime.now(UTC)
private_key = Path("config/jwt/jwt-private.pem").read_text(encoding="utf-8")
private_key = (DEV_KEY_DIR / "jwt-private.pem").read_text(encoding="utf-8")
token = jwt.encode(
{"sub": "2", "iss": "jr-local", "aud": "jr-agent-platform", "iat": now,
"nbf": now, "exp": now + timedelta(minutes=5), "jti": "visitor-jti-2",