feat(taxii2): migrate connector to manager-supported mode (#6859) - #7340
feat(taxii2): migrate connector to manager-supported mode (#6859)#7340Hugo Dupras (jabesq) wants to merge 8 commits into
Conversation
|
The following packages appear to be unused:
|
|
🔴 Connector Linter errors detected
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the external-import/taxii2 connector to a manager-supported configuration model by introducing connectors-sdk/Pydantic-based settings, wiring those settings into the existing ConfigConnector, and regenerating the connector’s metadata (schema + docs) accordingly.
Changes:
- Introduces Pydantic settings models for all TAXII2 configuration variables and uses
to_helper_config()to build theOpenCTIConnectorHelperconfig. - Normalizes sample configuration files (
docker-compose.yml,config.yml.sample) and marks the connector asmanager_supported. - Adds unit tests for settings validation and for verifying the manager-supported wiring path.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| external-import/taxii2/tests/tests_connector/test_settings.py | Adds unit tests for settings validation, defaults, list parsing, and SecretStr handling. |
| external-import/taxii2/tests/tests_connector/init.py | Initializes the tests subpackage. |
| external-import/taxii2/tests/test-requirements.txt | Adds pytest + reuses connector runtime requirements for tests. |
| external-import/taxii2/tests/test_main.py | Adds integration-style unit tests to validate helper/config/connector wiring. |
| external-import/taxii2/tests/conftest.py | Adds sys.path setup so tests can import connector code from src/. |
| external-import/taxii2/src/requirements.txt | Adds pydantic and connectors-sdk; removes unused PyYAML. |
| external-import/taxii2/src/connector/settings.py | Introduces ConnectorSettings plus TAXII2-specific config model defaults and types. |
| external-import/taxii2/src/connector/connector.py | Switches helper initialization to use to_helper_config() output. |
| external-import/taxii2/src/connector/config_variables.py | Replaces legacy YAML/env parsing with validated ConnectorSettings and secret unwrapping. |
| external-import/taxii2/src/connector/init.py | Exposes ConnectorSettings from the connector package. |
| external-import/taxii2/src/config.yml.sample | Normalizes sample config layout and documents required vs defaulted values. |
| external-import/taxii2/src/init.py | Exposes ConnectorSettings at the src package level. |
| external-import/taxii2/docker-compose.yml | Normalizes docker-compose env var documentation for manager-supported usage. |
| external-import/taxii2/metadata/connector_manifest.json | Sets manager_supported: true. |
| external-import/taxii2/metadata/connector_config_schema.json | Adds generated JSON schema for connector configuration. |
| external-import/taxii2/metadata/CONNECTOR_CONFIG_DOC.md | Adds generated configuration documentation. |
Suppressed comments (1)
external-import/taxii2/docker-compose.yml:36
- The comment says
TAXII2_INTERVALis only used whenCONNECTOR_DURATION_PERIODis not set, butCONNECTOR_DURATION_PERIODhas a default (PT60M) in the new settings, so that fallback won't normally be reachable. This is misleading in the docker-compose example.
# - TAXII2_INTERVAL=1 # Default 1 (hour). Only used when CONNECTOR_DURATION_PERIOD is not set
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # v21: true # Default true, set to false for a TAXII 2.0 server | ||
| # collections: '*.*' # Default *.* | ||
| # initial_history: 24 # Default 24 (hours) | ||
| # interval: 1 # Default 1 (hour), only used when connector.duration_period is not set |
| # - TAXII2_USERNAME=ChangeMe # Username for basic authentication | ||
| # - TAXII2_PASSWORD=ChangeMe # Password for basic authentication | ||
| # - TAXII2_USE_TOKEN=false # Default false. Use bearer token authentication instead of basic auth | ||
| # - TAXII2_TOKEN=ChangeMe # Bearer token, used when TAXII2_USE_TOKEN is true |
Proposed changes
docker-compose.ymlandconfig.yml.sample(required vars uncommented asChangeMe, defaulted vars commented out; fix a quoted boolean)TAXII2_*variables, withSecretStrfor credentials andListFromStringfor comma-separated fieldsConfigConnectorin place — the helper is now built fromto_helper_config()manager_supported: truein the connector manifest__metadata__/connector_config_schema.jsonandCONNECTOR_CONFIG_DOC.mdconnector.ida unique UUIDv4 default (the SDK declares it required with no default)PyYAMLdependencyRelated issues
Checklist
Further comments
Structure-preserving ("lite") migration:
ConfigConnectorkeeps its name and file,and the entry point, client, converter, scheduling and logging are untouched. The
connector is manager-supported but not yet "verified".
CONNECTOR_UPDATE_EXISTING_DATAwas dropped — it was read into an attribute that wasnever used anywhere and is not part of the SDK connector config.
PyYAMLbecame deadonce the migration removed the last
yaml.loadcall; it is still installedtransitively via
pycti, so runtime behaviour is unchanged.Validation: isort, black,
flake8 --ignore=E,Wand the custom STIX-ID pylint checker(10.00/10) all pass; 13 unit tests pass. Every connector module still imports from a
venv built only from
src/requirements.txt. Regenerating the config schema producesno diff against the committed version.