-
Notifications
You must be signed in to change notification settings - Fork 534
[domaintools] Update connector to be "manager_supported" #5344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
3c787ac to
68a0c0a
Compare
5bf48c0 to
6f3d4e2
Compare
jabesq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, I will push the changes to fix it
| ) | ||
| scope: ListFromString = Field( | ||
| description="The scope of the connector.", | ||
| default=["Domain-Name,Ipv4-Addr"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: It should be changed as follow, otherwise it will set an invalid scope
| default=["Domain-Name,Ipv4-Addr"], | |
| default=["Domain-Name", "Ipv4-Addr"], |
5f4bcb4 to
bf7035c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the domaintools connector to support the "manager_supported" pattern by integrating with the connectors-sdk framework. The changes introduce a settings module using Pydantic for configuration validation, refactor the connector initialization to use dependency injection, and add comprehensive unit tests.
Key changes:
- Introduces
settings.pywith Pydantic-based configuration models extendingBaseConnectorSettings - Refactors connector initialization to accept config and helper as constructor parameters
- Adds comprehensive unit tests for settings validation and connector instantiation
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/connector/settings.py | Defines configuration models using Pydantic and connectors-sdk base classes |
| src/connector/connector.py | Refactors constructor to accept config/helper parameters and removes manual config parsing |
| src/connector/builder.py | Updates to use OrganizationAuthor model from connectors-sdk |
| src/main.py | Implements new entry point with settings instantiation and error handling |
| src/requirements.txt | Adds pydantic and connectors-sdk dependencies |
| tests/tests_connector/test_settings.py | Adds unit tests for settings validation |
| tests/test_main.py | Adds integration tests for connector instantiation |
| tests/conftest.py | Configures pytest to include src directory in path |
| tests/test-requirements.txt | Specifies pytest as test dependency |
| src/config.yml.sample | Updates configuration template with commented defaults |
| docker-compose.yml | Updates environment variables, comments optional settings |
| metadata/connector_config_schema.json | Adds JSON schema for connector configuration |
| metadata/CONNECTOR_CONFIG_DOC.md | Adds documentation for configuration parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| validators~=0.35.0 | ||
| validators~=0.35.0 | ||
| pydantic >=2.8.2, <3 | ||
| connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@master#subdirectory=connectors-sdk |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing from a git branch (master) can lead to unpredictable builds as the dependency may change without notice. Consider pinning to a specific commit hash or tagged release version for reproducible builds.
| connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@master#subdirectory=connectors-sdk | |
| connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@6.9.5#subdirectory=connectors-sdk |
| class FakeConnectorSettings(ConnectorSettings): | ||
| """ | ||
| Subclass of `ConnectorSettings` (implementation of `BaseConnectorSettings`) for testing purpose. | ||
| It overrides `BaseConnectorSettings._load_config_dict` to return a fake but valid config dict. |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring states 'fake but valid config dict' but the test function is specifically testing invalid inputs. The docstring should be corrected to say 'fake and invalid config dict' to accurately reflect the test's purpose.
| It overrides `BaseConnectorSettings._load_config_dict` to return a fake but valid config dict. | |
| It overrides `BaseConnectorSettings._load_config_dict` to return a fake and invalid config dict. |
| if expiration_date != "": | ||
| expiration_date = datetime.strptime(expiration_date, "%Y-%m-%d") | ||
|
|
||
| if creation_date >= expiration_date: |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison should check if creation_date is strictly after expiration_date (>) rather than greater-or-equal (>=). If both dates are equal, they represent the same point in time and should be valid, not requiring the warning and date removal.
| if creation_date >= expiration_date: | |
| if creation_date > expiration_date: |
Proposed changes
settings.pyconnector.pymain.pyor__main__.pyRelated issues
Checklist
Further comments
The code needs to be reviewed by two people: one must fix any issue, the other one review the final commits.