🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

django-sns-view

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-sns-view

A Django view that can be subscribed to Amazon SNS

1.0.1
PyPI
Maintainers
1

Django SNS View

A drop in configurable django view that is used to subscribe and process AWS SNS messages.

Installation

pip install django-sns-view

Default Django Settings

SNS_CERT_DOMAIN_REGEX = r"sns.[a-z0-9\-]+.amazonaws.com$" # Regex to match on cert domain
SNS_VERIFY_CERTIFICATE = True # Whether to verify signature against certificate

SNSEndpoint Attributes

message_type_header = 'HTTP_X_AMZ_SNS_MESSAGE_TYPE'
topic_type_header = 'HTTP_X_AMZ_SNS_TOPIC_ARN'
allowed_message_types = ['Notification', 'SubscriptionConfirmation', 'UnsubscribeConfirmation']
cert_domain_settings_key = 'SNS_CERT_DOMAIN_REGEX'
sns_verify_settings_key = 'SNS_VERIFY_CERTIFICATE'
topic_settings_key = '' # If you would like to subscribe this endpoint to only certain topics, create a setting containing a list of topics that are allowed.

Usage

from django_sns_view.views import SNSEndpoint

class MySNSView(SNSEndpoint):
    # Can override SNSEndpoint attributes outlined above

    def handle_message(self, message, payload):
        # Process the message

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts