plainx-sentry 0.8.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {% if sentry_public_key|default("") -%}
2
2
  <script src="https://js.sentry-cdn.com/{{ sentry_public_key }}.min.js" crossorigin="anonymous"></script>
3
- {{ sentry_init|json_script("sentry_init") }}
4
- <script>
3
+ {{ sentry_init|json_script("sentry_init", csp_nonce) }}
4
+ <script nonce="{{ csp_nonce }}">
5
5
  var sentryInit = JSON.parse(document.getElementById("sentry_init").textContent);
6
6
  Sentry.onLoad(function() {
7
7
  Sentry.init(sentryInit);
@@ -23,16 +23,10 @@ class SentryJSExtension(InclusionTagExtension):
23
23
  "environment": settings.SENTRY_ENVIRONMENT,
24
24
  "sendDefaultPii": bool(settings.SENTRY_PII_ENABLED),
25
25
  },
26
+ "csp_nonce": context["request"].csp_nonce,
26
27
  }
27
28
 
28
- if "request" in context:
29
- # Get the authenticated user from the request
30
- user = get_request_user(context["request"])
31
- else:
32
- # Get user directly if no request (like in server error context)
33
- user = context.get("user", None)
34
-
35
- if user:
29
+ if user := get_request_user(context["request"]):
36
30
  sentry_context["sentry_init"]["initialScope"] = {"user": {"id": user.id}}
37
31
  if settings.SENTRY_PII_ENABLED:
38
32
  if email := getattr(user, "email", None):
@@ -1,8 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plainx-sentry
3
- Version: 0.8.0
3
+ Version: 0.10.0
4
4
  Author-email: Dave Gaeddert <dave.gaeddert@gmail.com>
5
5
  Requires-Python: >=3.11
6
+ Requires-Dist: plain-auth>=0.16.0
7
+ Requires-Dist: plain-sessions>=0.27.0
6
8
  Requires-Dist: sentry-sdk[opentelemetry]>=2.24.0
7
9
  Description-Content-Type: text/markdown
8
10
 
@@ -0,0 +1,9 @@
1
+ plainx/sentry/CHANGELOG.md,sha256=kE1atfmZkThPdQ5fS7yylRMc_REJXel9zLjrDNgiGoc,373
2
+ plainx/sentry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ plainx/sentry/config.py,sha256=mtA9uyFtXgGqaUI-wraG06klKA5fNzTKunS2DNm1KK8,1573
4
+ plainx/sentry/default_settings.py,sha256=DNX6OQ0-BqfjyWuszW7JnZhiDn0tGtS3Fa2W7VbTIF8,564
5
+ plainx/sentry/templates.py,sha256=HW3WJqdkh3SXCuon6i2Kj6Ip9lASr0lDeSi_V8KCuZ0,1864
6
+ plainx/sentry/templates/sentry/js.html,sha256=0Uwe7izKwqTEuZ6h8BLVcFRi3d7zM_Xov17rG4h91o0,526
7
+ plainx_sentry-0.10.0.dist-info/METADATA,sha256=P2pPygW19vdZ2XzR8-1jFV9O4x9sjUPu-QoGFsB0GqY,1515
8
+ plainx_sentry-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ plainx_sentry-0.10.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- plainx/sentry/CHANGELOG.md,sha256=kE1atfmZkThPdQ5fS7yylRMc_REJXel9zLjrDNgiGoc,373
2
- plainx/sentry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- plainx/sentry/config.py,sha256=mtA9uyFtXgGqaUI-wraG06klKA5fNzTKunS2DNm1KK8,1573
4
- plainx/sentry/default_settings.py,sha256=DNX6OQ0-BqfjyWuszW7JnZhiDn0tGtS3Fa2W7VbTIF8,564
5
- plainx/sentry/templates.py,sha256=5dR1CwYfftnkzBan46sNHaHGu-ydQzrAhV9n_L9bb5k,2053
6
- plainx/sentry/templates/sentry/js.html,sha256=aOjWAwuUaecGbC-5yZWP1aaGyYAcM-GK0dru-4VOYoE,491
7
- plainx_sentry-0.8.0.dist-info/METADATA,sha256=oCOW9dxdvS4ESNc9ME0rc2vVgr8243z5mnQKvvb-1qE,1442
8
- plainx_sentry-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- plainx_sentry-0.8.0.dist-info/RECORD,,