django-restit 4.1.89__py3-none-any.whl → 4.2.1__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.
- account/rpc/oauth.py +2 -1
- auditlog/middleware.py +4 -1
- {django_restit-4.1.89.dist-info → django_restit-4.2.1.dist-info}/METADATA +1 -1
- {django_restit-4.1.89.dist-info → django_restit-4.2.1.dist-info}/RECORD +11 -11
- metrics/rpc.py +2 -1
- rest/__init__.py +1 -1
- rest/urls.py +2 -0
- rest/views.py +2 -1
- taskqueue/worker.py +3 -1
- {django_restit-4.1.89.dist-info → django_restit-4.2.1.dist-info}/LICENSE.md +0 -0
- {django_restit-4.1.89.dist-info → django_restit-4.2.1.dist-info}/WHEEL +0 -0
account/rpc/oauth.py
CHANGED
@@ -9,6 +9,7 @@ from account.oauth import google
|
|
9
9
|
from account.models import Member
|
10
10
|
from objict import objict
|
11
11
|
from datetime import datetime, timedelta
|
12
|
+
REST_PREFIX = settings.get("REST_PREFIX", "api/")
|
12
13
|
|
13
14
|
|
14
15
|
@rd.url('oauth/google/login')
|
@@ -30,7 +31,7 @@ def oauth_google_login(request):
|
|
30
31
|
params = urlencode({'error': error})
|
31
32
|
return redirect(f"{app_url}?{params}")
|
32
33
|
|
33
|
-
redirect_uri = f"{settings.BASE_URL_SECURE}
|
34
|
+
redirect_uri = f"{settings.BASE_URL_SECURE}{REST_PREFIX}account/oauth/google/login"
|
34
35
|
auth_data = google.getAccessToken(code, redirect_uri)
|
35
36
|
if auth_data is None or auth_data.access_token is None:
|
36
37
|
params = urlencode({'error': "failed to get access token from google"})
|
auditlog/middleware.py
CHANGED
@@ -4,6 +4,9 @@ from .models import PersistentLog
|
|
4
4
|
DEBUG_REST_ALL = settings.get("DEBUG_REST_ALL", False)
|
5
5
|
DEBUG_REST_END_POINTS = settings.get("DEBUG_REST_END_POINTS", [])
|
6
6
|
IGNORE_REST_END_POINTS = settings.get("IGNORE_REST_END_POINTS", [])
|
7
|
+
LOG_REST_PREFIX = settings.get("REST_PREFIX", "api/")
|
8
|
+
if not LOG_REST_PREFIX.startswith("/"):
|
9
|
+
LOG_REST_PREFIX = f"/{LOG_REST_PREFIX}"
|
7
10
|
|
8
11
|
|
9
12
|
def checkRestDebug(request):
|
@@ -37,7 +40,7 @@ class LogRequest(object):
|
|
37
40
|
def process_request(self, request):
|
38
41
|
# LogRequest.last_request = request
|
39
42
|
request.rest_debug = False
|
40
|
-
if request.path.startswith("/rpc/"):
|
43
|
+
if request.path.startswith(LOG_REST_PREFIX) or request.path.startswith("/rpc/"):
|
41
44
|
request.rest_debug = checkRestDebug(request)
|
42
45
|
if request.rest_debug:
|
43
46
|
request.DATA.log()
|
@@ -37,7 +37,7 @@ account/rpc/device.py,sha256=fbbZFp3cUdhVXvD7gVFOqFWj4hKS3bjZKD_aF5fQxd8,2852
|
|
37
37
|
account/rpc/group.py,sha256=Y_Ii-vlDx09neMd95AmC7xBwDf3wdFgXjB-kIG2jMdE,3472
|
38
38
|
account/rpc/member.py,sha256=oKdXSGhQ7AOPTwisZ5RvHhQ1SdZoXWlBQY0lIlDXJY0,1150
|
39
39
|
account/rpc/notify.py,sha256=Q2YWejP36egeF060Hih5uX4Psv_B8NWlLLPi7iDYlIw,3344
|
40
|
-
account/rpc/oauth.py,sha256
|
40
|
+
account/rpc/oauth.py,sha256=qhXgrGrmg966_WTg7c4ZuldgWZEaub0dI3u102vX0wg,2669
|
41
41
|
account/rpc/settings.py,sha256=EvPuwW63Gp_Va0ANIPAZ894tnS_JCctQ0FzqYRdKUNM,271
|
42
42
|
account/settings.py,sha256=XEvZdcA6p_iUpDq9NmICK8rxzIQ8NViKfrpyuYgSV4o,53
|
43
43
|
account/templates/email/base.html,sha256=GnqUkoOYLDmaL370E1M-Q0PKJ60VH0MzkcjUyg9DdyY,9709
|
@@ -52,7 +52,7 @@ auditlog/README,sha256=q4DXhdz5CuMyuxYISHXzhlHnIkRJlojwOMchLzW2qOI,520
|
|
52
52
|
auditlog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
53
|
auditlog/admin.py,sha256=-q7fstdFjNeDFfbwdrxVqy0WGKxMpBwrsM7AyG1p80g,1006
|
54
54
|
auditlog/decorators.py,sha256=ZoIv0fhZjxtMEV15NcKijW4xPF5UEScPna60zB3TxZo,6553
|
55
|
-
auditlog/middleware.py,sha256=
|
55
|
+
auditlog/middleware.py,sha256=jQiuedadlu8NU0Fi7ExfPx6X1aQquXfSxMECMprO_tg,1511
|
56
56
|
auditlog/migrations/0001_initial.py,sha256=X171gKQZIaTO9FGNG1yKTjGSZS0ZjZj5gvimF9-_kks,3309
|
57
57
|
auditlog/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
58
|
auditlog/models.py,sha256=6CyWMRNvqCYoyiXE9_qk41EJFjutwo6nfoP9KKYWiYw,16294
|
@@ -332,7 +332,7 @@ metrics/models.py,sha256=lD9nVzfwdav70ENulqJ8rE8Ui8EWlzdVp05rg8bAlMA,13444
|
|
332
332
|
metrics/periodic.py,sha256=VmL0YG05D6k5fcNsF4QqPEU-BBPbZXjbOrp3b8EHZ-U,651
|
333
333
|
metrics/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
334
334
|
metrics/providers/aws.py,sha256=RDM5RLeFADHexm4cHaJdAm3K6iz1NwMSNcV9GYuGtjY,7432
|
335
|
-
metrics/rpc.py,sha256=
|
335
|
+
metrics/rpc.py,sha256=B-A2jbIvq85Li-nlR4P8ZnjMaydn_nAnGvw4AO-6oxE,17674
|
336
336
|
metrics/settings.py,sha256=wwHA9Z7BAHNeu3tFVn8Fh5j46KR-eGx0E8r5dzCFlAU,132
|
337
337
|
metrics/tq.py,sha256=pl9RG4vXViX2hhSTOENZwXsAXD-5luXkBQjgzj4bwtk,799
|
338
338
|
metrics/utils.py,sha256=w6H2v8zjlOZ5uqZsJOQvZoN-2Kyv1h8PN76gMGow7AE,11995
|
@@ -351,7 +351,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
351
351
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
352
352
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
353
353
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
354
|
-
rest/__init__.py,sha256=
|
354
|
+
rest/__init__.py,sha256=wpNMb8Fg1zzY8J9BnZ6LahQtnmjZyKaJ68HvfSAUWuE,120
|
355
355
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
356
356
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
357
357
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -415,8 +415,8 @@ rest/templates/rest_html.html,sha256=wGZV3j_tB9rzzJlsMxidUQ5ex_uRPyU_s8GCmHLXiqk
|
|
415
415
|
rest/ua.py,sha256=0wwOtJPWCiCxUKzWKyMApRbSaiuAxCCk0Pe3OwzYBhE,185398
|
416
416
|
rest/uberdict.py,sha256=ivDpzfchQqX8dM2_TtuyMW7NNO-j7zDmxkdKixQxvU4,17064
|
417
417
|
rest/url_docs.py,sha256=O8O_CQso3fB-7o-huidIT1BRGv5R6lDW-yKHnsGyAPk,11881
|
418
|
-
rest/urls.py,sha256=
|
419
|
-
rest/views.py,sha256=
|
418
|
+
rest/urls.py,sha256=QUx1F8eKpNnTibLg4L9KaaU3qQRkXcElcDClSeO_H48,1869
|
419
|
+
rest/views.py,sha256=WUjHQMCzw2f4Te2X4Kh40ksfoVAAlrWC2pbt8nhcIYA,1115
|
420
420
|
sessionlog/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
421
421
|
sessionlog/README.md,sha256=vQEVJ_8u3Vv19VwPfscjCiHFu61ZSrEM-KIuBpUXhws,62
|
422
422
|
sessionlog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -441,7 +441,7 @@ taskqueue/transports/http.py,sha256=WFRLOfto_ODYzRUtYqeJq2GyV63pLfAWbvnRZTzaLIY,
|
|
441
441
|
taskqueue/transports/s3.py,sha256=fMosL893u1iQdo6Y1djwb7KEoNo6TTsDPJl13OJdJP8,1913
|
442
442
|
taskqueue/transports/sftp.py,sha256=jT1_krjTHA7DCAukD85aGYRCg9m0cEH9EWzOC-wJGdk,1891
|
443
443
|
taskqueue/transports/sms.py,sha256=H1-LIGEMfbUNqJD9amRcsvKUSwtz9yBj1QNfB7EHjHE,142
|
444
|
-
taskqueue/worker.py,sha256=
|
444
|
+
taskqueue/worker.py,sha256=MeG--B_OyiHniNEsk2LNgysAUh780iP0NdtdEO55ZKM,16050
|
445
445
|
telephony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
446
446
|
telephony/admin.py,sha256=iOdsBfFFbBisdqKSZ36bIrh_z5sU0Wx_PkaFi8wd1iA,243
|
447
447
|
telephony/decorators.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -483,7 +483,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
483
483
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
484
484
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
485
485
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
486
|
-
django_restit-4.1.
|
487
|
-
django_restit-4.1.
|
488
|
-
django_restit-4.1.
|
489
|
-
django_restit-4.1.
|
486
|
+
django_restit-4.2.1.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
487
|
+
django_restit-4.2.1.dist-info/METADATA,sha256=brsAi3INkr3zkG4WQlHVp0MAngEWecz5RaKB1UVco3k,7572
|
488
|
+
django_restit-4.2.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
489
|
+
django_restit-4.2.1.dist-info/RECORD,,
|
metrics/rpc.py
CHANGED
@@ -17,6 +17,7 @@ import time
|
|
17
17
|
Capture simple analytics counters.
|
18
18
|
"""
|
19
19
|
LOCATION_METRICS = settings.LOCATION_METRICS
|
20
|
+
REST_PREFIX = settings.get("REST_PREFIX", "api/")
|
20
21
|
|
21
22
|
|
22
23
|
@rd.urlPOST('metric')
|
@@ -293,7 +294,7 @@ def rest_on_ec2_restit_stats(request, pk=None):
|
|
293
294
|
host = f"{name}.{hostname}"
|
294
295
|
else:
|
295
296
|
host = f"{name}.{hostname}"
|
296
|
-
resp = net.REQUEST("GET", host, "/
|
297
|
+
resp = net.REQUEST("GET", host, f"/{REST_PREFIX}versions", params=dict(detailed=1))
|
297
298
|
if resp.status:
|
298
299
|
resp.data.id = host
|
299
300
|
resp.data.hostname = host
|
rest/__init__.py
CHANGED
rest/urls.py
CHANGED
@@ -27,6 +27,8 @@ def load_app(app, root_module=None):
|
|
27
27
|
module = loadModule(f"{app}.rpc")
|
28
28
|
if module is None:
|
29
29
|
module = loadModule(f"{app}.rurl")
|
30
|
+
if module is None:
|
31
|
+
module = loadModule(f"{app}.rapi")
|
30
32
|
except ImportError as err:
|
31
33
|
print("**** failed to load {0}.rpc! ****".format(app))
|
32
34
|
print("**** missing dependencies ****")
|
rest/views.py
CHANGED
@@ -5,13 +5,14 @@ else:
|
|
5
5
|
from .serializers.response import * # noqa: F401, F403
|
6
6
|
from . import url_docs
|
7
7
|
from django.shortcuts import render
|
8
|
+
REST_PREFIX = settings.get("REST_PREFIX", "api/")
|
8
9
|
|
9
10
|
|
10
11
|
def showDocs(request):
|
11
12
|
from . import urls
|
12
13
|
apis, graphs = url_docs.getRestApis(urls.urlpatterns)
|
13
14
|
for api in apis:
|
14
|
-
api["url"] = "
|
15
|
+
api["url"] = "{REST_PREFIX}{0}".format(api["url"])
|
15
16
|
return render(request, "rest_docs.html", {"apis": apis, "graphs":graphs})
|
16
17
|
|
17
18
|
|
taskqueue/worker.py
CHANGED
@@ -204,7 +204,9 @@ class WorkManager(object):
|
|
204
204
|
task.completed()
|
205
205
|
elif task.state == 1:
|
206
206
|
# slowly backoff retries
|
207
|
-
task.
|
207
|
+
if task.attempts >= 5:
|
208
|
+
task.failed("max attempts")
|
209
|
+
task.retry_later(from_now_secs=task.attempts * task.attempts * 60)
|
208
210
|
|
209
211
|
def _on_hookrequest(self, task):
|
210
212
|
# we need to copy the data and remove the url
|
File without changes
|
File without changes
|