Skip to content

Commit 5214ff6

Browse files
committed
tests: replace literal /Users/tima paths with APS_SDK_PATH env var
Wave 2C of privacy/security cleanup. Tests reading mutual-auth vectors from the SDK source repo used a literal absolute path. Reads now go through APS_SDK_PATH environment variable, defaulting to ~/agent-passport-system for local dev.
1 parent 6ba6206 commit 5214ff6

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/test_mutual_auth.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
DAY = 24 * HOUR
2525
VERSIONS = ["1.2", "1.1", "1.0"]
2626

27+
# Path to the SDK source repo containing cross-language conformance vectors.
28+
# Override with APS_SDK_PATH env var if the SDK lives elsewhere.
29+
APS_SDK_PATH = os.environ.get(
30+
'APS_SDK_PATH',
31+
os.path.expanduser('~/agent-passport-system'),
32+
)
33+
2734

2835
def _mk_cert(role, subject_pk, issuer_pk, issuer_sk,
2936
versions=None, binding=None, grade=None, caps=None):
@@ -315,7 +322,7 @@ def test_grade_insufficient():
315322
def test_conformance_vec01_certificate_minimal():
316323
"""Read the TypeScript-generated vec01 and check Python produces the same canonical bytes."""
317324
# Path to TS SDK conformance vectors
318-
ts_sdk_path = "/Users/tima/agent-passport-system/src/conformance/mutual-auth-vectors/vec01-certificate-canonical.json"
325+
ts_sdk_path = f"{APS_SDK_PATH}/src/conformance/mutual-auth-vectors/vec01-certificate-canonical.json"
319326
if not os.path.exists(ts_sdk_path):
320327
pytest.skip("TS conformance vectors not present locally")
321328
with open(ts_sdk_path) as f:
@@ -335,7 +342,7 @@ def test_conformance_vec01_certificate_minimal():
335342

336343

337344
def test_conformance_vec02_certificate_all_fields():
338-
ts_sdk_path = "/Users/tima/agent-passport-system/src/conformance/mutual-auth-vectors/vec02-certificate-all-fields.json"
345+
ts_sdk_path = f"{APS_SDK_PATH}/src/conformance/mutual-auth-vectors/vec02-certificate-all-fields.json"
339346
if not os.path.exists(ts_sdk_path):
340347
pytest.skip("TS conformance vectors not present locally")
341348
with open(ts_sdk_path) as f:
@@ -351,7 +358,7 @@ def test_conformance_vec02_certificate_all_fields():
351358

352359

353360
def test_conformance_vec05_session_id_derivation():
354-
ts_sdk_path = "/Users/tima/agent-passport-system/src/conformance/mutual-auth-vectors/vec05-session-derivation.json"
361+
ts_sdk_path = f"{APS_SDK_PATH}/src/conformance/mutual-auth-vectors/vec05-session-derivation.json"
355362
if not os.path.exists(ts_sdk_path):
356363
pytest.skip("TS conformance vectors not present locally")
357364
with open(ts_sdk_path) as f:

0 commit comments

Comments
 (0)