django_ses/utils.py
def _get_cert_url(self):
        """
        Get the signing certificate URL.
        Only accept urls that match the domains set in the
        AWS_SNS_EVENT_CERT_TRUSTED_DOMAINS setting. Sub-domains
        are allowed. i.e. if amazonaws.com is in the trusted domains
        then sns.us-east-1.amazonaws.com will match.
        """
        cert_url = self._data.get("SigningCertURL")
        if not cert_url:
            logger.warning('No signing certificate URL: "%s"', cert_url)
            return None

        if not cert_url.startswith("https://"):
            logger.warning('Untrusted certificate URL: "%s"', cert_url)
            return None

        url_obj = urlparse(cert_url)
        for trusted_domain in settings.EVENT_CERT_DOMAINS:
            parts = trusted_domain.split(".")
            if url_obj.netloc.split(".")[-len(parts) :] == parts:
                return cert_url

        return None

        Get the signing certificate URL.
        Only accept urls that match the domains set in the
        AWS_SNS_EVENT_CERT_TRUSTED_DOMAINS setting. Sub-domains
        are allowed. i.e. if amazonaws.com is in the trusted domains
        then sns.us-east-1.amazonaws.com will match.
        
Get the signing certificate URL.
Only accept urls that match the domains set in the
AWS_SNS_EVENT_CERT_TRUSTED_DOMAINS setting. Sub-domains
are allowed.
Get the signing certificate URL . Only accept urls that match the domains set in the AWS_SNS_EVENT_CERT_TRUSTED_DOMAINS setting . Sub - domains are allowed .
def _get_cert_url(self):
        cert_url = self._data.get("SigningCertURL")
        if not cert_url:
            logger.warning('No signing certificate URL: "%s"', cert_url)
            return None
        if not cert_url.startswith("https://"):
            logger.warning('Untrusted certificate URL: "%s"', cert_url)
            return None
        url_obj = urlparse(cert_url)
        for trusted_domain in settings.EVENT_CERT_DOMAINS:
            parts = trusted_domain.split(".")
            if url_obj.netloc.split(".")[-len(parts) :] == parts:
                return cert_url
        return None
def _get_cert_url ( self ) : cert_url = self . _data . get ( "SigningCertURL" ) if not cert_url : logger . warning ( 'No signing certificate URL: "%s"' , cert_url ) return None if not cert_url . startswith ( "https://" ) : logger . warning ( 'Untrusted certificate URL: "%s"' , cert_url ) return None url_obj = urlparse ( cert_url ) for trusted_domain in settings . EVENT_CERT_DOMAINS : parts = trusted_domain . split ( "." ) if url_obj . netloc . split ( "." ) [ - len ( parts ) : ] == parts : return cert_url return None
Get the signing certificate URL.
Get the signing certificate URL .
"""
        Get the signing certificate URL.
        Only accept urls that match the domains set in the
        AWS_SNS_EVENT_CERT_TRUSTED_DOMAINS setting. Sub-domains
        are allowed. i.e. if amazonaws.com is in the trusted domains
        then sns.us-east-1.amazonaws.com will match.
        """
self