Skip to content

Latest commit

 

History

History
102 lines (62 loc) · 7.27 KB

File metadata and controls

102 lines (62 loc) · 7.27 KB
graph LR
    Email_Validation_Utilities["Email Validation & Utilities"]
    ContentBase["ContentBase"]
    PlainTextContent["PlainTextContent"]
    AmpHtmlContent["AmpHtmlContent"]
    HtmlContent["HtmlContent"]
    ApiKeyValidator["ApiKeyValidator"]
    ApiKeyException["ApiKeyException"]
    PlainTextContent -- "inherits from" --> ContentBase
    AmpHtmlContent -- "inherits from" --> ContentBase
    HtmlContent -- "inherits from" --> ContentBase
    ContentBase -- "uses" --> ApiKeyValidator
    PlainTextContent -- "uses" --> ApiKeyValidator
    AmpHtmlContent -- "uses" --> ApiKeyValidator
    HtmlContent -- "uses" --> ApiKeyValidator
    ApiKeyValidator -- "raises" --> ApiKeyException
Loading

CodeBoardingDemoContact

Component Details

This system provides robust email content validation, primarily focusing on preventing the accidental inclusion of SendGrid API keys within email messages. It defines a base structure for various email content types (plain text, HTML, AMP HTML) and integrates a dedicated API key validation mechanism. The system ensures that all content, regardless of its type, is scanned for sensitive information before being processed, and raises a specific exception if an API key is detected, thereby enhancing security.

Email Validation & Utilities

Provides utility functions for validating email message components, particularly to prevent sensitive information like API keys from being included in email content, and defines related exceptions.

Related Classes/Methods:

ContentBase

Provides the foundational structure and properties for various email content types, including MIME type and content value. It also integrates with the API key validation mechanism.

Related Classes/Methods:

PlainTextContent

Represents plain text email content, inheriting from the ContentBase. It ensures that plain text content is validated for API keys before being set.

Related Classes/Methods:

AmpHtmlContent

Represents AMP HTML email content, inheriting from the ContentBase. It validates AMP HTML content for API keys.

Related Classes/Methods:

HtmlContent

Represents standard HTML email content, inheriting from the ContentBase. It validates HTML content for API keys.

Related Classes/Methods:

ApiKeyValidator

Responsible for scanning email content (both dictionary and string formats) to detect and prevent the accidental inclusion of SendGrid API keys, raising an exception if found.

Related Classes/Methods:

ApiKeyException

Defines the specific exception raised when a SendGrid API key is detected within the email content during validation.

Related Classes/Methods: