feat(export-file-txt): migrate connector to manager-supported mode (#7222) - #7322
feat(export-file-txt): migrate connector to manager-supported mode (#7222)#7322Helene Nguyen (helene-nguyen) wants to merge 10 commits into
Conversation
…ts (#7222) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🔴 Connector Linter errors detected
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the internal-export-file/export-file-txt connector to the connectors catalog / manager-supported configuration model by switching to connectors-sdk Pydantic settings and updating container/metadata artifacts accordingly, while keeping the connector’s processing logic intact.
Changes:
- Replaced legacy
config.yml/os.environloading withconnectors-sdk-basedConnectorSettings, passed toOpenCTIConnectorHelperviato_helper_config(). - Marked the connector as manager-supported and regenerated catalog metadata artifacts (schema + config doc).
- Simplified container startup by removing
entrypoint.shand usingCMDinDockerfile/Dockerfile_fips; normalized sample configs and compose env vars.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal-export-file/export-file-txt/src/settings.py | Adds connectors-sdk Pydantic settings with connector defaults for manager-supported deployments. |
| internal-export-file/export-file-txt/src/requirements.txt | Adds connectors-sdk (and explicit pydantic) dependency for the new settings model. |
| internal-export-file/export-file-txt/src/export-file-txt.py | Switches helper initialization to use ConnectorSettings().to_helper_config(). |
| internal-export-file/export-file-txt/src/config.yml.sample | Updates the sample config to align with manager-supported settings and removes obsolete fields. |
| internal-export-file/export-file-txt/src/init.py | Exposes ConnectorSettings at package level (consistent with other connectors using this pattern). |
| internal-export-file/export-file-txt/entrypoint.sh | Removed in favor of container CMD. |
| internal-export-file/export-file-txt/Dockerfile | Uses WORKDIR + CMD to start the connector directly. |
| internal-export-file/export-file-txt/Dockerfile_fips | Mirrors the non-FIPS Dockerfile startup change. |
| internal-export-file/export-file-txt/docker-compose.yml | Updates placeholders and removes obsolete environment variables. |
| internal-export-file/export-file-txt/metadata/connector_manifest.json | Sets manager_supported: true for catalog deployment. |
| internal-export-file/export-file-txt/metadata/connector_config_schema.json | Adds regenerated connector configuration schema for the platform/manager. |
| internal-export-file/export-file-txt/metadata/CONNECTOR_CONFIG_DOC.md | Adds regenerated configuration documentation derived from the schema. |
Suppressed comments (1)
internal-export-file/export-file-txt/src/settings.py:27
scopeis described as what the connector is "importing", but this is an internal export connector. This description is surfaced in the generated schema/docs, so it should match the connector behavior.
scope: ListFromString = Field(
default=["text/plain"],
description="The scope or type of data the connector is importing, either a MIME type or Stix Object (for information only).",
)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Pauline Eustachy (Powlinett)
left a comment
There was a problem hiding this comment.
LGTM (build.env doesn't need update as it already uses the right entrypoint file path)🌻
Proposed changes
internal-export-file/export-file-txtto manager-supported mode: replace theconfig.yml/os.environloading with a PydanticConnectorSettingsbuilt onconnectors-sdk(BaseConnectorSettings,BaseInternalExportFileConnectorConfig), passed toOpenCTIConnectorHelperviato_helper_config().id,name: ExportFileTxt,scope: ["text/plain"]) so the connector is deployable from the manager without mandatory name/scope input.manager_supported: truein__metadata__/connector_manifest.jsonand regenerateconnector_config_schema.json/CONNECTOR_CONFIG_DOC.md.entrypoint.shin favour of a directCMDinDockerfileandDockerfile_fips; normalizedocker-compose.ymlandconfig.yml.sample(removed the obsoleteconfidence_leveland the hardcodedconnector.type).The file structure, class names and processing logic are intentionally unchanged — this is a structure-preserving (lite) migration.
Related issues
Checklist
Further comments
CONNECTOR_NAMEandCONNECTOR_SCOPEmove from required to defaulted in the config schema. This is not breaking for existing deployments — explicitly set values still override the defaults — but it does change the generated schema consumed by the platform.Removing
entrypoint.shchanges how the image starts. Any deployment overriding the entrypoint will need adjusting; the standarddocker-compose.ymlis unaffected.Screenshots
Display on OpenCTI catalog

Usage when exporting
