9201ef759e
Harness Compat / harness compat (push) Failing after 0s
CI / test on 3.12 (standard) (push) Has been cancelled
CI / test on 3.13 (standard) (push) Has been cancelled
CI / test on 3.14 (standard) (push) Has been cancelled
CI / test on 3.10 (all-extras) (push) Has been cancelled
CI / test on 3.11 (all-extras) (push) Has been cancelled
CI / test on 3.12 (all-extras) (push) Has been cancelled
CI / test on 3.14 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.10 (pydantic-evals) (push) Has been cancelled
CI / test on 3.11 (pydantic-evals) (push) Has been cancelled
CI / test on 3.12 (pydantic-evals) (push) Has been cancelled
CI / deploy-docs-preview (push) Has been cancelled
CI / build release artifacts (push) Has been cancelled
CI / publish to PyPI (push) Has been cancelled
CI / Send tweet (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / mypy (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / test on 3.10 (standard) (push) Has been cancelled
CI / test on 3.11 (standard) (push) Has been cancelled
CI / test on 3.13 (all-extras) (push) Has been cancelled
CI / test on 3.14 (all-extras) (push) Has been cancelled
CI / test on 3.10 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.11 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.12 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.13 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.13 (pydantic-evals) (push) Has been cancelled
CI / test on 3.14 (pydantic-evals) (push) Has been cancelled
CI / test on 3.10 (lowest-versions) (push) Has been cancelled
CI / test on 3.11 (lowest-versions) (push) Has been cancelled
CI / test on 3.12 (lowest-versions) (push) Has been cancelled
CI / test on 3.13 (lowest-versions) (push) Has been cancelled
CI / test on 3.14 (lowest-versions) (push) Has been cancelled
CI / test examples on 3.11 (push) Has been cancelled
CI / test examples on 3.12 (push) Has been cancelled
CI / test examples on 3.13 (push) Has been cancelled
CI / test examples on 3.14 (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / check (push) Has been cancelled
CI / deploy-docs (push) Has been cancelled
29 lines
896 B
Python
29 lines
896 B
Python
"""One-time script to apply serializer redaction to an existing cassette."""
|
|
|
|
import sys
|
|
sys.path.insert(0, 'tests')
|
|
|
|
from json_body_serializer import deserialize, serialize
|
|
|
|
cassette_path = sys.argv[1] if len(sys.argv) > 1 else (
|
|
'tests/models/cassettes/test_multimodal_tool_returns/'
|
|
'test_multimodal_tool_return_matrix[direct-uploaded_file-image-bedrock_nova].yaml'
|
|
)
|
|
|
|
with open(cassette_path, encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# Round-trip through deserialize/serialize to apply redaction
|
|
cassette_dict = deserialize(content)
|
|
redacted = serialize(cassette_dict)
|
|
|
|
with open(cassette_path, 'w', encoding='utf-8') as f:
|
|
f.write(redacted)
|
|
|
|
# Verify
|
|
if 'SCRUBBED' in redacted and 'ASIAVEMKNXYDQ6ZF4HY7' not in redacted:
|
|
print(f'Successfully redacted credentials in {cassette_path}')
|
|
else:
|
|
print('WARNING: Redaction may not have worked correctly')
|
|
sys.exit(1)
|