test(all): add connector_config_schema.json validation tests (#6342)#7085
Open
Powlinett wants to merge 4 commits into
Open
test(all): add connector_config_schema.json validation tests (#6342)#7085Powlinett wants to merge 4 commits into
Powlinett wants to merge 4 commits into
Conversation
Powlinett
force-pushed
the
copilot-test-6342-connector-config-schema-tests
branch
6 times, most recently
from
July 24, 2026 09:45
1f131a2 to
86b6897
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
…ush, ransomlook, recorded-future
Powlinett
force-pushed
the
copilot-test-6342-connector-config-schema-tests
branch
from
July 24, 2026 10:36
7e4b933 to
6b12e9c
Compare
Powlinett
marked this pull request as ready for review
July 24, 2026 10:38
Contributor
There was a problem hiding this comment.
Pull request overview
Adds repository-level validation for connector_config_schema.json files and aligns a set of connectors’ generated schemas with the expected conventions (notably CONNECTOR_TYPE as a JSON Schema const, CONNECTOR_SCOPE as an array, and duration formatting).
Changes:
- Add
tests/tests_metadata/test_connector_config_schema.pyto validate JSON Schema compliance and connector-type-specific invariants across all existing connector config schemas. - Normalize multiple connectors’ Pydantic settings models so generated schemas emit
CONNECTOR_TYPEasconstandCONNECTOR_SCOPEas anarray(and update generated schemas/docs accordingly). - Remove stale hand-written schema/docs files for several non-manager-supported connectors and add
jsonschemato test dependencies.
Reviewed changes
Copilot reviewed 63 out of 63 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tests_metadata/test_connector_manifest.py | Refactor manifest test to use helper loader. |
| tests/tests_metadata/test_connector_config_schema.py | New test suite validating config schemas. |
| tests/test-requirements.txt | Add jsonschema dependency for tests. |
| stream/splunk-soar-push/src/models/configs/connector_configs.py | Make connector type a Literal for const schema emission. |
| stream/splunk-soar-push/src/models/configs/config_loader.py | Override schema for CONNECTOR_SCOPE to array convention. |
| stream/splunk-soar-push/metadata/connector_config_schema.json | Update scope to array and add CONNECTOR_TYPE.const. |
| stream/misp-intel/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| stream/misp-intel/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/virustotal/src/virustotal/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/virustotal/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/virustotal-downloader/src/connector/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/virustotal-downloader/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/osint-industries/metadata/connector_config_schema.json | Remove stale hand-written schema file. |
| internal-enrichment/osint-industries/metadata/CONNECTOR_CONFIG_DOC.md | Remove stale generated config doc. |
| internal-enrichment/ipinfo/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/ipinfo/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/hygiene/src/connector/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/hygiene/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/google-dns/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/google-dns/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| internal-enrichment/abuseipdb/src/connector/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| internal-enrichment/abuseipdb/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/vulnerability-lookup/src/connector/settings.py | Change scope to list-friendly type and default. |
| external-import/vulnerability-lookup/metadata/connector_config_schema.json | Emit scope as array with items/default list. |
| external-import/vulnerability-lookup/metadata/CONNECTOR_CONFIG_DOC.md | Update docs to reflect scope as array. |
| external-import/usta/metadata/connector_config_schema.json | Remove stale hand-written schema file. |
| external-import/usta/metadata/CONNECTOR_CONFIG_DOC.md | Remove stale generated config doc. |
| external-import/trukno/metadata/connector_config_schema.json | Remove stale hand-written schema file. |
| external-import/trukno/metadata/CONNECTOR_CONFIG_DOC.md | Remove stale generated config doc. |
| external-import/threatfox/src/models/configs/connector_configs.py | Make connector type a Literal. |
| external-import/threatfox/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/sparta/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/sparta/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/sekoia/src/connector/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/sekoia/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/recorded-future/src/models/configs/connector_configs.py | Switch duration to timedelta; make type a Literal. |
| external-import/recorded-future/metadata/connector_config_schema.json | Add duration format: duration, update default, add const. |
| external-import/ransomwarelive/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/ransomwarelive/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/ransomlook/src/connector/settings.py | Adjust pydantic extra handling to affect schema output. |
| external-import/ransomlook/metadata/connector_config_schema.json | Change additionalProperties to true. |
| external-import/mitre/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/mitre/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/mandiant/src/connector/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/mandiant/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/google-ti-feeds/connector/src/octi/configs/connector_config.py | Override schema for CONNECTOR_SCOPE to array convention. |
| external-import/google-ti-feeds/metadata/connector_config_schema.json | Emit scope as array with items/default list; adjust descriptions. |
| external-import/ft3/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/ft3/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/feedly/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/feedly/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/email-intel-microsoft/src/base_connector/enums.py | Remove critical level; add warn alias. |
| external-import/email-intel-microsoft/metadata/connector_config_schema.json | Update log level enum (drop critical, add warn). |
| external-import/email-intel-microsoft/metadata/CONNECTOR_CONFIG_DOC.md | Update docs to match log level enum. |
| external-import/email-intel-imap/src/base_connector/enums.py | Remove critical level; add warn alias. |
| external-import/email-intel-imap/metadata/connector_config_schema.json | Update log level enum (drop critical, add warn). |
| external-import/email-intel-imap/metadata/CONNECTOR_CONFIG_DOC.md | Update docs to match log level enum. |
| external-import/cve/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/cve/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
| external-import/ctm360-cyna-feed/metadata/connector_config_schema.json | Remove stale hand-written schema file. |
| external-import/ctm360-cyberblindspot-feed/metadata/connector_config_schema.json | Remove stale hand-written schema file. |
| external-import/cisa-known-exploited-vulnerabilities/src/models/configs/connector_configs.py | Make connector type a Literal; remove redundant validator. |
| external-import/cisa-known-exploited-vulnerabilities/metadata/connector_config_schema.json | Add CONNECTOR_TYPE.const to schema. |
Comment on lines
+81
to
+84
| assert schema.get("type") == "object" | ||
| assert isinstance(schema.get("properties"), dict) | ||
| assert isinstance(schema.get("required"), list) | ||
| assert schema.get("additionalProperties") is True |
Comment on lines
+99
to
+101
| Note: The connectors-sdk currently strips CONNECTOR_ID from generated schemas (filter_schema). | ||
| It should **not** be filtered, as it is an existing property for all connectors (required for pycti). | ||
| Unwanted fields should be filtered out on OpenCTi / XTM Hub side, not connectors-sdk. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
test_connector_config_schema.pywith 7 parametrized tests validating allconnector_config_schema.jsonfiles against a meta-schema and connector-type-specific conventions (CONNECTOR_TYPE const, CONNECTOR_SCOPE array, CONNECTOR_AUTO boolean, CONNECTOR_LIVE_STREAM_* fields, CONNECTOR_DURATION_PERIOD with format duration)type: strinstead oftype: Literal["..."]in their pydantic models soCONNECTOR_TYPEis emitted asconstin the JSON schemaconnector_config_schema.jsonfiles for non-manager-supported connectors (trukno, usta, ctm360-cyberblindspot-feed, ctm360-cyna-feed, osint-industries)test_connector_manifest.pyfor consistencyRelated issues
Checklist
Further comments
Test results: 451 passed, 2 skipped (internal-export-file/internal-import-file have no schemas yet), 7 xfailed (connectors not yet using connectors-sdk BaseSettings).