• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / eb3c159f-b9db-447e-9f07-80d64871396a

12 May 2025 01:52PM CUT coverage: 85.235%. Remained the same
eb3c159f-b9db-447e-9f07-80d64871396a

push

circleci

groovecoder
build(deps): bump django from 4.2.20 to 4.2.21

Bumps [django](https://github.com/django/django) from 4.2.20 to 4.2.21.
- [Commits](https://github.com/django/django/compare/4.2.20...4.2.21)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 4.2.21
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

2461 of 3599 branches covered (68.38%)

Branch coverage included in aggregate %.

17316 of 19604 relevant lines covered (88.33%)

9.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/privaterelay/debug.py
1
import re
1✔
2

3
from django.http.request import HttpRequest
1✔
4
from django.views.debug import SafeExceptionReporterFilter
1✔
5

6

7
class RelaySaferExceptionReporterFilter(SafeExceptionReporterFilter):
1✔
8
    """
9
    Hide all settings EXCEPT ones explicitly allowed by SAFE_PREFIXES or SAFE_NAMES.
10
    """
11

12
    # By default, Django disables the filter if DEBUG=True.
13
    # Django correctly assumes "If DEBUG is True then your site is not safe anyway."
14
    # (https://github.com/django/django/blob/1520d18/django/views/debug.py#L175)
15
    # But, we sometimes temporarily set DEBUG=True in our dev environment to help debug.
16
    # And even in that case, we want as much additional safety as we can get.
17
    def is_active(self, request: HttpRequest | None) -> bool:
1✔
18
        return True
×
19

20
    # Allow variable values that start with these prefixes
21
    SAFE_PREFIXES: list = []
1✔
22

23
    # Allow variable values named in this list
24
    SAFE_NAMES = [
1✔
25
        "BUNDLE_PLAN_ID_US",
26
        "BUNDLE_PROD_ID",
27
        "RELAY_CHANNEL",
28
        "RELAY_CHANNEL_NAME",
29
        "RELAY_FROM_ADDRESS",
30
        "SUBPLAT3_BUNDLE_PRODUCT_KEY",
31
        "SUBPLAT3_PHONES_PRODUCT_KEY",
32
        "SUBPLAT3_PREMIUM_PRODUCT_KEY",
33
    ]
34

35
    # Match everything EXCEPT safe names and safe prefixes
36
    hidden_settings = re.compile(
1✔
37
        r"^(?!("
38
        + "|".join(f"{re.escape(name)}" for name in SAFE_NAMES)
39
        + "|"
40
        + "|".join(f"{re.escape(prefix)}.*" for prefix in SAFE_PREFIXES)
41
        + r")$).+",
42
        re.IGNORECASE,
43
    )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc