| from src.security import redact | |
| def test_redact_hf_token(): | |
| text = "HF_TOKEN=hf_abcdefghijklmnopqrstuvwxyz123456" | |
| assert "hf_" not in redact(text) | |
| assert "[REDACTED]" in redact(text) | |
| def test_redact_bearer(): | |
| text = "Authorization: Bearer abc.def.ghi" | |
| assert "abc.def.ghi" not in redact(text) | |