Skip to content

Commit

Permalink
(minor) update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricvanrompay-datadog committed Apr 19, 2024
1 parent 4a161d3 commit 892b4e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ def __init__(self, ecosystem: str):
def detect(self, package_info, path: Optional[str] = None, name: Optional[str] = None,
version: Optional[str] = None) -> tuple[bool, str]:
"""
Uses a package's information from PyPI's JSON API to determine
if the package's email domain might have been compromised
Uses a package's information to determine
if the maintainer's email domain might have been compromised
Args:
package_info (dict): dictionary representation of PyPI's JSON
output
Raises:
Exception: "Email for {package_info['info']['name']} does not exist."
package_info (dict): package info from the package repository
Returns:
bool: True if email domain is compromised
bool: True if email domain may be compromised
str: Message explaining the issue
"""

emails = self.get_email_addresses(package_info)
Expand Down
13 changes: 5 additions & 8 deletions guarddog/analyzer/metadata/unclaimed_maintainer_email_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ def __init__(self, ecosystem: str):
def detect(self, package_info, path: Optional[str] = None, name: Optional[str] = None,
version: Optional[str] = None) -> tuple[bool, str]:
"""
Uses a package's information from PyPI's JSON API to determine
if the package's email domain might have been compromised
Uses a package's information to determine
if the maintainer's email domain is unclaimed and thus exposed to hijacking
Args:
package_info (dict): dictionary representation of PyPI's JSON
output
Raises:
Exception: "Email for {package_info['info']['name']} does not exist."
package_info (dict): package info from the package repository
Returns:
bool: True if email domain is compromised
bool: True if email domain is unclaimed
str: Message explaining the issue
"""

emails = self.get_email_addresses(package_info)
Expand Down

0 comments on commit 892b4e4

Please sign in to comment.