[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
101ee54022
commit
38333d6a6c
2 changed files with 3 additions and 4 deletions
|
|
@ -62,8 +62,7 @@ _QUERY_OPAQUE_TOKEN = re.compile(
|
|||
# International (+CC ...) or NANP-formatted phone numbers. Requires separators or a
|
||||
# leading ``+`` so bare numeric research terms are not redacted.
|
||||
_QUERY_PHONE = re.compile(
|
||||
r"(?<!\w)\+\d[\d\s().-]{7,17}\d(?!\w)"
|
||||
r"|(?<!\w)\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}(?!\w)"
|
||||
r"(?<!\w)\+\d[\d\s().-]{7,17}\d(?!\w)|(?<!\w)\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}(?!\w)"
|
||||
)
|
||||
_QUERY_IPV4 = re.compile(r"(?<![\w.])(?:\d{1,3}\.){3}\d{1,3}(?![\w.])")
|
||||
_QUERY_LABELED_PRIVATE_ID = re.compile(
|
||||
|
|
|
|||
|
|
@ -75,12 +75,12 @@ def _make_payload(**overrides) -> CreateResearchRun:
|
|||
|
||||
|
||||
def test_sanitize_config_rejects_nested_inference_credential():
|
||||
payload = _make_payload(inferenceRequest={"model": {"api_key": "sk-should-not-persist"}})
|
||||
payload = _make_payload(inferenceRequest = {"model": {"api_key": "sk-should-not-persist"}})
|
||||
with pytest.raises(Exception):
|
||||
_sanitize_config(payload, {"modelId": "m"})
|
||||
|
||||
|
||||
def test_sanitize_config_rejects_nested_rag_scope_secret():
|
||||
payload = _make_payload(ragScope={"kb_id": {"token": "rag-secret"}})
|
||||
payload = _make_payload(ragScope = {"kb_id": {"token": "rag-secret"}})
|
||||
with pytest.raises(Exception):
|
||||
_sanitize_config(payload, {"modelId": "m"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue