-
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathurls.py
More file actions
113 lines (110 loc) · 4.11 KB
/
urls.py
File metadata and controls
113 lines (110 loc) · 4.11 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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/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",
),
path(
"radius/group/",
api_views.radius_group_list,
name="radius_group_list",
),
path(
"radius/group/<uuid:pk>/",
api_views.radius_group_detail,
name="radius_group_detail",
),
path(
"users/user/<str:user_pk>/radius-group/",
api_views.radius_user_group_list,
name="radius_user_group_list",
),
path(
"users/user/<str:user_pk>/radius-group/<uuid:pk>/",
api_views.radius_user_group_detail,
name="radius_user_group_detail",
),
]
else:
return []