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

mozilla / fx-private-relay / 3e4e7d2b-92c2-41cb-82a1-5841a7a440f1

pending completion
3e4e7d2b-92c2-41cb-82a1-5841a7a440f1

push

circleci

John Whitlock
Remove extra @ sign from subdomain banner

1686 of 2560 branches covered (65.86%)

Branch coverage included in aggregate %.

5436 of 7367 relevant lines covered (73.79%)

18.66 hits per line

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

83.33
/api/urls.py
1
from django.conf import settings
1✔
2
from django.urls import include, path, register_converter
1✔
3

4
from rest_framework import routers
1✔
5

6
from privaterelay.utils import enable_if_setting
1✔
7
from .views import (
1✔
8
    DomainAddressViewSet,
9
    RelayAddressViewSet,
10
    ProfileViewSet,
11
    UserViewSet,
12
    FlagViewSet,
13
    report_webcompat_issue,
14
    runtime_data,
15
    schema_view,
16
)
17

18

19
class SwaggerFormatConverter:
1✔
20
    regex = r"\.(json|yaml)"
1✔
21

22
    def to_python(self, value):
1✔
23
        return value
1✔
24

25
    def to_url(self, value):
1✔
26
        return value
×
27

28

29
register_converter(SwaggerFormatConverter, "swagger_format")
1✔
30

31

32
api_router = routers.DefaultRouter()
1✔
33
api_router.register(r"domainaddresses", DomainAddressViewSet, "domainaddress")
1✔
34
api_router.register(r"relayaddresses", RelayAddressViewSet, "relayaddress")
1✔
35
api_router.register(r"profiles", ProfileViewSet, "profiles")
1✔
36
api_router.register(r"users", UserViewSet, "user")
1✔
37
api_router.register(r"flags", FlagViewSet, "flag")
1✔
38

39

40
urlpatterns = [
1✔
41
    path(
42
        "v1/runtime_data",
43
        runtime_data,
44
        name="runtime_data_deprecate_after_updating_clients",
45
    ),
46
    path("v1/runtime_data/", runtime_data, name="runtime_data"),
47
    path(
48
        "v1/report_webcompat_issue",
49
        report_webcompat_issue,
50
        name="report_webcompat_issue_deprecate_after_updating_clients",
51
    ),
52
    path(
53
        "v1/report_webcompat_issue/",
54
        report_webcompat_issue,
55
        name="report_webcompat_issue",
56
    ),
57
    path(
58
        "v1/swagger<swagger_format:format>/",
59
        enable_if_setting("API_DOCS_ENABLED")(schema_view.without_ui(cache_timeout=0)),
60
        name="schema-json",
61
    ),
62
    path(
63
        "v1/docs/",
64
        enable_if_setting("API_DOCS_ENABLED")(
65
            schema_view.with_ui("swagger", cache_timeout=0)
66
        ),
67
        name="schema-swagger-ui",
68
    ),
69
]
70

71
if settings.PHONES_ENABLED:
1!
72
    from .views.phones import (
1✔
73
        outbound_call,
74
        list_messages,
75
        outbound_sms,
76
        RealPhoneViewSet,
77
        RelayNumberViewSet,
78
        InboundContactViewSet,
79
        inbound_call,
80
        inbound_sms,
81
        vCard,
82
        sms_status,
83
        voice_status,
84
        resend_welcome_sms,
85
    )
86

87
if settings.PHONES_ENABLED:
1!
88
    api_router.register(r"realphone", RealPhoneViewSet, "real_phone")
1✔
89
    api_router.register(r"relaynumber", RelayNumberViewSet, "relay_number")
1✔
90
    api_router.register(r"inboundcontact", InboundContactViewSet, "inbound_contact")
1✔
91
    urlpatterns += [
1✔
92
        # TODO: Update Twilio webhooks to versions with trailing slashes,
93
        #       then remove versions without trailing slashes (Django's
94
        #       APPEND_SLASH option will then make those redirect).
95
        path(
96
            "v1/inbound_sms",
97
            inbound_sms,
98
            name="inbound_sms_deprecate_after_updating_clients",
99
        ),
100
        path("v1/inbound_sms/", inbound_sms, name="inbound_sms"),
101
        path(
102
            "v1/inbound_call",
103
            inbound_call,
104
            name="inbound_call_deprecate_after_updating_clients",
105
        ),
106
        path("v1/inbound_call/", inbound_call, name="inbound_call"),
107
        path(
108
            "v1/voice_status",
109
            voice_status,
110
            name="voice_status_deprecate_after_updating_clients",
111
        ),
112
        path("v1/voice_status/", voice_status, name="voice_status"),
113
        path("v1/call/", outbound_call, name="outbound_call"),
114
        path("v1/messages/", list_messages, name="list_messages"),
115
        path("v1/message/", outbound_sms, name="outbound_sms"),
116
        path(
117
            "v1/sms_status",
118
            sms_status,
119
            name="sms_status_deprecate_after_updating_clients",
120
        ),
121
        path("v1/sms_status/", sms_status, name="sms_status"),
122
        path(
123
            "v1/vCard/<lookup_key>",
124
            vCard,
125
            name="vCard_deprecate_after_updating_clients",
126
        ),
127
        path("v1/vCard/<lookup_key>/", vCard, name="vCard"),
128
        path(
129
            "v1/realphone/resend_welcome_sms",
130
            resend_welcome_sms,
131
            name="resend_welcome_sms_deprecate_after_updating_clients",
132
        ),
133
        path(
134
            "v1/realphone/resend_welcome_sms/",
135
            resend_welcome_sms,
136
            name="resend_welcome_sms",
137
        ),
138
    ]
139

140

141
if settings.PHONES_ENABLED and settings.IQ_ENABLED:
1!
142
    from .views.phones import inbound_sms_iq
×
143

144
    urlpatterns += [
×
145
        path(
146
            "v1/inbound_sms_iq/",
147
            enable_if_setting("IQ_ENABLED")(inbound_sms_iq),
148
            name="inbound_sms",
149
        ),
150
    ]
151

152

153
urlpatterns += [
1✔
154
    path("v1/", include(api_router.urls)),
155
]
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