Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

chore(deps): trim Python schema format test dependencies (#2297)

Michael D'Angeloe3ec9b6c6e7e
diff --git a/plugins/codex-security/requirements-test.txt b/plugins/codex-security/requirements-test.txt
index 4bdd69740..e005b00f3 100644
--- a/plugins/codex-security/requirements-test.txt
+++ b/plugins/codex-security/requirements-test.txt
@@ -1,7 +1,10 @@
# Development test and lint dependencies; install from the repository root.
-jsonschema[format-nongpl]==4.26.0
+jsonschema==4.26.0
packaging==26.3
pytest==9.2.0
pytest-xdist==3.8.0
PyYAML==6.0.3
+# jsonschema uses these to check timestamps in artifacts and URIs in schemas.
+rfc3339-validator==0.1.4
+rfc3986-validator==0.1.1
ruff==0.17.3
diff --git a/plugins/codex-security/tests/test_scan_contract_examples.py b/plugins/codex-security/tests/test_scan_contract_examples.py
index 347b3d751..0871e54ae 100644
--- a/plugins/codex-security/tests/test_scan_contract_examples.py
+++ b/plugins/codex-security/tests/test_scan_contract_examples.py
@@ -7,7 +7,7 @@ import unittest
from pathlib import Path
from typing import Any
-from jsonschema import Draft202012Validator, FormatChecker, ValidationError
+from jsonschema import Draft202012Validator, FormatChecker, SchemaError, ValidationError
from referencing import Registry, Resource
from workbench_test_support import saved_coverage
@@ -54,6 +54,10 @@ class ScanContractExamplesTest(unittest.TestCase):
with self.subTest(schema=schema_path.name):
Draft202012Validator.check_schema(read_object(schema_path))
+ def test_schema_rejects_invalid_reference(self) -> None:
+ with self.assertRaisesRegex(SchemaError, "is not a 'uri-reference'"):
+ Draft202012Validator.check_schema({"$ref": "invalid reference"})
+
def test_standard_draft_requires_review_state(self) -> None:
finding = {
"ruleId": "cross-site-scripting.response",