Skip to main content

A middleware to ensure only Sentry can access source maps

Project description

django-sentry-secure-source-map

CI PyPI PyPI - Python Version

A middleware to ensure only Sentry can access source maps.

When enabled, only requests from Sentry will be able to access source maps (any URL starting with STATIC_URL and ending .map).

For more information, see Secure Access to Source Maps

Installation

pip install django-sentry-secure-source-map

Then add sentry_secure_source_map.SentrySecureSourceMapMiddleware to your MIDDLEWARE in settings.py. Ideally, it should be placed as high as possible, before tools like whitenoise.

Next, you need to configure the token. Retrieve your project's "Security Token" from the settings page, and set it as SENTRY_SECURITY_TOKEN.

SENTRY_SECURITY_TOKEN = "abcde12345"

If the token isn't set, the middleware does nothing.

"Enable JavaScript source fetching" must be enabled in Sentry.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sentry-secure-source-map-0.1.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page