-
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathurls.py
More file actions
96 lines (93 loc) · 3.54 KB
/
urls.py
File metadata and controls
96 lines (93 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from django.urls import path
from .. import settings as app_settings
from . import views
def get_api_urls(api_views=None):
if not api_views:
api_views = views
if app_settings.RADIUS_API:
return [
path("freeradius/authorize/", api_views.authorize, name="authorize"),
path("freeradius/postauth/", api_views.postauth, name="postauth"),
path("freeradius/accounting/", api_views.accounting, name="accounting"),
# registration differentiated by organization
path(
"radius/organization/<slug:slug>/account/",
api_views.register,
name="rest_register",
),
# password reset
path(
"radius/organization/<slug:slug>/account/password/reset/confirm/",
api_views.password_reset_confirm,
name="rest_password_reset_confirm",
),
path(
"radius/organization/<slug:slug>/account/password/reset/",
api_views.password_reset,
name="rest_password_reset",
),
path(
"radius/organization/<slug:slug>/account/password/change/",
api_views.password_change,
name="rest_password_change",
),
# obtaining the user token is also different for every org
path(
"radius/organization/<slug:slug>/account/token/",
api_views.obtain_auth_token,
name="user_auth_token",
),
path(
"radius/organization/<slug:slug>/account/token/validate/",
api_views.validate_auth_token,
name="validate_auth_token",
),
path(
"radius/organization/<slug:slug>/account/session/",
api_views.user_accounting,
name="user_accounting",
),
path(
"radius/organization/<slug:slug>/account/usage/",
api_views.user_radius_usage,
name="user_radius_usage",
),
# generate new sms phone token
path(
"radius/organization/<slug:slug>/account/phone/token/",
api_views.create_phone_token,
name="phone_token_create",
),
path(
"radius/organization/<slug:slug>/account/phone/token/active/",
api_views.get_phone_token_status,
name="phone_token_status",
),
path(
"radius/organization/<slug:slug>/account/phone/verify/",
api_views.validate_phone_token,
name="phone_token_validate",
),
# allow changing phone number
path(
"radius/organization/<slug:slug>/account/phone/change/",
api_views.change_phone_number,
name="phone_number_change",
),
path("radius/batch/", api_views.batch, name="batch"),
path(
"radius/batch/<uuid:pk>/", api_views.batch_detail, name="batch_detail"
),
path(
"radius/organization/<slug:slug>/batch/<uuid:pk>/pdf/",
api_views.download_rad_batch_pdf,
name="download_rad_batch_pdf",
),
path(
"radius/sessions/",
api_views.radius_accounting,
name="radius_accounting_list",
),
]
else:
return []