Skip to content

feat(export-report-pdf): migrate connector to manager-supported mode (#7221) - #7337

Open
Hugo Dupras (jabesq) wants to merge 8 commits into
masterfrom
feat/7221-manager-supported-export-report-pdf
Open

feat(export-report-pdf): migrate connector to manager-supported mode (#7221)#7337
Hugo Dupras (jabesq) wants to merge 8 commits into
masterfrom
feat/7221-manager-supported-export-report-pdf

Conversation

@jabesq

Copy link
Copy Markdown
Member

Proposed changes

  • Normalize docker-compose.yml, config.yml.sample and src/requirements.txt (required vars uncommented as ChangeMe, defaulted vars commented out)
  • Add Pydantic settings mirroring the connector's existing configuration 1:1
  • Wire the settings into the existing code in place — the helper is now built from to_helper_config()
  • Set manager_supported: true in the connector manifest
  • Generate __metadata__/connector_config_schema.json and CONNECTOR_CONFIG_DOC.md
  • Give connector.id a unique UUIDv4 default (the SDK declares it required with no default)
  • Add unit tests covering settings validation and the manager-supported wiring
  • Repoint connector.py and tests/test_main.py at the renamed settings module

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

Structure-preserving ("lite") migration: the file layout, class names, scheduling
mechanism and logging are unchanged. Configuration now flows through validated
Pydantic settings, which is what makes the connector manager-supported — it is not
yet "verified"; that broader pass is tracked separately.

Validation: isort, black, flake8 --ignore=E,W and the custom STIX-ID pylint checker
(10.00/10) all pass; 15 unit tests pass. Regenerating the config schema produces no
diff against the committed version.

@jabesq Hugo Dupras (jabesq) added the filigran team Item from the Filigran team. label Aug 21, 2026
Copilot AI lite review requested due to automatic review settings August 21, 2026 13:34
@github-actions

Copy link
Copy Markdown

⚠️ Unused dependencies detected

The following packages appear to be unused:

  • pygal in internal-export-file/export-report-pdf/src/requirements.txt
  • wheel in internal-export-file/export-report-pdf/src/requirements.txt

How to fix: (1) if the package is used but under a different import name (e.g. PyYAMLyaml), add a mapping line to .github/deptry-package-map.txt. (2) if truly unused, remove it from the connector's requirements.txt.

@github-actions

Copy link
Copy Markdown

🔴 Connector Linter errors detected

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the internal-export-file/export-report-pdf connector to connectors-sdk/Pydantic-based settings so it can run in connector-manager–supported mode, while keeping the existing connector logic largely intact.

Changes:

  • Introduces ConnectorSettings (connectors-sdk BaseConnectorSettings) and wires OpenCTIConnectorHelper creation via to_helper_config().
  • Refactors the connector to read configuration from namespaced settings (config.export_report_pdf.*) and removes the legacy ConnectorConfig.
  • Adds/updates unit tests and generates manager-oriented metadata (connector_config_schema.json, CONNECTOR_CONFIG_DOC.md), and marks the connector as manager_supported.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal-export-file/export-report-pdf/src/export_report_pdf/settings.py Adds Pydantic/connectors-sdk settings models for connector + connector-specific config.
internal-export-file/export-report-pdf/src/main.py Builds helper config via ConnectorSettings.to_helper_config().
internal-export-file/export-report-pdf/src/export_report_pdf/connector.py Switches config access to config.export_report_pdf.* and updates typing.
internal-export-file/export-report-pdf/src/export_report_pdf/config.py Removes legacy YAML/env parsing config class.
internal-export-file/export-report-pdf/src/requirements.txt Adds connectors-sdk + pydantic requirements.
internal-export-file/export-report-pdf/src/config.yml.sample Normalizes sample config with required vs defaulted values.
internal-export-file/export-report-pdf/src/init.py Re-exports ConnectorSettings.
internal-export-file/export-report-pdf/tests/test_main.py Adds wiring tests for settings → helper → connector instantiation.
internal-export-file/export-report-pdf/tests/export_report_pdf/test_config.py Adds settings validation/defaulting tests.
internal-export-file/export-report-pdf/tests/export_report_pdf/test_connector.py Updates tests to use ConnectorSettings and new config layout.
internal-export-file/export-report-pdf/tests/export_report_pdf/conftest.py Updates config fixture to align with new settings expectations.
internal-export-file/export-report-pdf/metadata/connector_manifest.json Sets manager_supported: true.
internal-export-file/export-report-pdf/metadata/connector_config_schema.json Adds generated JSON schema for manager-supported env vars.
internal-export-file/export-report-pdf/metadata/CONNECTOR_CONFIG_DOC.md Adds generated configuration documentation.
internal-export-file/export-report-pdf/README.md Points configuration documentation to generated metadata doc.
Suppressed comments (3)

internal-export-file/export-report-pdf/tests/export_report_pdf/test_config.py:79

  • This _load_config_dict override returns a validated ConnectorSettings instance from handler(...), not a dict. Updating the return annotation avoids confusion when reading these tests and aligns with the connectors-sdk validator signature.
        @classmethod
        def _load_config_dict(cls, _, handler) -> dict[str, Any]:
            return handler(

internal-export-file/export-report-pdf/tests/export_report_pdf/test_config.py:209

  • The _load_config_dict override returns a validated settings instance (via handler(...)), not a dict. The current return type annotation is misleading and should be updated to match what the function actually returns.
    class FakeConnectorSettings(ConnectorSettings):
        @classmethod
        def _load_config_dict(cls, _, handler) -> dict[str, Any]:
            return handler(settings_dict)

internal-export-file/export-report-pdf/tests/export_report_pdf/test_config.py:148

  • The _load_config_dict validator override returns the validated settings model from handler(settings_dict). The declared return type dict[str, Any] is inaccurate here and should reflect that a settings instance is returned.
    class FakeConnectorSettings(ConnectorSettings):
        @classmethod
        def _load_config_dict(cls, _, handler) -> dict[str, Any]:
            return handler(settings_dict)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +32 to +34
@classmethod
def _load_config_dict(cls, _, handler) -> dict[str, Any]:
return handler(
@@ -0,0 +1,24 @@
# Connector Configurations

Below is an exhaustive enumeration of all configurable parameters available, each accompanied by detailed explanations of their purposes, default behaviors, and usage guidelines to help you understand and utilize them effectively.
Comment on lines +40 to +42
@classmethod
def _load_config_dict(cls, _, handler) -> dict[str, Any]:
return handler(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(export-report-pdf): migrate connector to the catalog

3 participants