Skip to content
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

[Zvelo] Fix type error #3410

Merged
merged 2 commits into from
Feb 12, 2025
Merged

[Zvelo] Fix type error #3410

merged 2 commits into from
Feb 12, 2025

Conversation

helene-nguyen
Copy link
Member

@helene-nguyen helene-nguyen commented Feb 12, 2025

Proposed changes

  • Fix Type Error

Related issues

Checklist

  • I consider the submitted work as finished
  • 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

Error due to the typo between "c" and "C" leading to the use of callable method rather than Callable type

def known_converter_error(
    func: Callable[["ConverterToStix", ...], stix2.v21._STIXBase21),
) -> Callable[["ConverterToStix", ...], stix2.v21._STIXBase21]:

Test by raising a ConverterError

image

{"timestamp": "2025-02-12T06:40:12.681908Z", "level": "ERROR", "name": "Zvelo CTI", "message": "[CONNECTOR] An error occurred while converting {'ip_info': [{'ip': '162.241.124.142'}], 'url': 'https://yaseui.net/Ik98ufh9FIV8FUV', 'discovered_date': '2025-02-12T05:54:58Z', 'brand': '1&1 ionos', 'confidence_level': 100, 'last_active_date': '2025-02-12T06:36:05.057148Z', 'status': 'active', 'last_verified_date': '2025-02-12T06:36:05.057148Z'} to stix, skipping entity.", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\helen\\IdeaProjects\\connectors\\external-import\\zvelo\\src\\zvelo_connector\\connector.py\", line 82, in _collect_intelligence\n stix_objects.extend(converter_method(entity))\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\helen\\IdeaProjects\\connectors\\external-import\\zvelo\\src\\zvelo_connector\\converter_to_stix.py\", line 30, in wrapper\n return func(self, *args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\helen\\IdeaProjects\\connectors\\external-import\\zvelo\\src\\zvelo_connector\\converter_to_stix.py\", line 304, in convert_phish_to_stix\n raise ConverterError(\"error\")\nzvelo_connector.converter_to_stix.ConverterError: error", "attributes": {"error": "error"}}

image

In the exemple, it is well catched by decorator

@helene-nguyen helene-nguyen added the filigran team use to identify PR from the Filigran team label Feb 12, 2025
@helene-nguyen helene-nguyen self-assigned this Feb 12, 2025
@helene-nguyen helene-nguyen linked an issue Feb 12, 2025 that may be closed by this pull request
Copy link
Contributor

@flavienSindou flavienSindou left a comment

Choose a reason for hiding this comment

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

Thank you for correcting this typo !

@helene-nguyen helene-nguyen merged commit 70fde6f into master Feb 12, 2025
4 checks passed
@helene-nguyen helene-nguyen deleted the bug/3409-zvelo branch February 12, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Zvelo] Issue on connector run due to code error
2 participants