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

Fixed Sometimes Failing PyPI potentially_compromised_email_domain #268

Conversation

Claire-Thib
Copy link
Contributor

@Claire-Thib Claire-Thib commented Jul 19, 2023

In response to this issue, fixed the sometimes failing PyPI rule potentially_compromised_email_domain.

The rule sometimes fails because the email address stored in package_info can be None and there is no check that the email_address is None before doing any parsing. Added a simple None check before returning email addresses for npm and python. Added a test for a None or null email

https://datadoghq.atlassian.net/browse/SINT-1432

@zmallen zmallen self-assigned this Jul 20, 2023
@zmallen zmallen self-requested a review July 20, 2023 16:35

@pytest.mark.parametrize("package_info, detector",
[(empty_author_pypi, pypi_detector), (empty_author_npm, npm_detector)])
def test_email_domain_none(self, package_info, detector):
Copy link
Contributor

Choose a reason for hiding this comment

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

excellent, thank you!

Copy link
Contributor

@christophetd christophetd left a comment

Choose a reason for hiding this comment

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

LGTM

@christophetd christophetd merged commit 934eef9 into DataDog:main Jul 24, 2023
9 checks passed
@christophetd christophetd mentioned this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants