django-restit 4.2.63__py3-none-any.whl → 4.2.65__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/migrations/0020_cloudcredentials_cloudcredentialsmetadata.py +47 -0
- account/models/device.py +3 -3
- account/models/group.py +6 -0
- {django_restit-4.2.63.dist-info → django_restit-4.2.65.dist-info}/METADATA +1 -1
- {django_restit-4.2.63.dist-info → django_restit-4.2.65.dist-info}/RECORD +10 -9
- incident/models/event.py +2 -0
- rest/__init__.py +1 -1
- rest/serializers/response.py +2 -1
- {django_restit-4.2.63.dist-info → django_restit-4.2.65.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.63.dist-info → django_restit-4.2.65.dist-info}/WHEEL +0 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
# Generated by Django 4.1.4 on 2024-04-15 13:45
|
2
|
+
|
3
|
+
from django.db import migrations, models
|
4
|
+
import django.db.models.deletion
|
5
|
+
import rest.fields
|
6
|
+
import rest.models.base
|
7
|
+
import rest.models.metadata
|
8
|
+
|
9
|
+
|
10
|
+
class Migration(migrations.Migration):
|
11
|
+
|
12
|
+
dependencies = [
|
13
|
+
('account', '0019_group_location'),
|
14
|
+
]
|
15
|
+
|
16
|
+
operations = [
|
17
|
+
migrations.CreateModel(
|
18
|
+
name='CloudCredentials',
|
19
|
+
fields=[
|
20
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
21
|
+
('created', models.DateTimeField(auto_now_add=True)),
|
22
|
+
('modified', models.DateTimeField(auto_now=True)),
|
23
|
+
('name', models.CharField(blank=True, default=None, max_length=128, null=True)),
|
24
|
+
('uuid', models.CharField(blank=True, db_index=True, default=None, max_length=64, null=True)),
|
25
|
+
('state', models.IntegerField(db_index=True, default=1)),
|
26
|
+
('credentials', rest.fields.JSONField(default=None, null=True)),
|
27
|
+
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cloud_credentials', to='account.group')),
|
28
|
+
],
|
29
|
+
bases=(models.Model, rest.models.base.RestModel, rest.models.metadata.MetaDataModel),
|
30
|
+
),
|
31
|
+
migrations.CreateModel(
|
32
|
+
name='CloudCredentialsMetaData',
|
33
|
+
fields=[
|
34
|
+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
35
|
+
('category', models.CharField(blank=True, db_index=True, default=None, max_length=32, null=True)),
|
36
|
+
('key', models.CharField(db_index=True, max_length=80)),
|
37
|
+
('value_format', models.CharField(max_length=16)),
|
38
|
+
('value', models.TextField()),
|
39
|
+
('int_value', models.IntegerField(blank=True, default=None, null=True)),
|
40
|
+
('float_value', models.IntegerField(blank=True, default=None, null=True)),
|
41
|
+
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='account.cloudcredentials')),
|
42
|
+
],
|
43
|
+
options={
|
44
|
+
'abstract': False,
|
45
|
+
},
|
46
|
+
),
|
47
|
+
]
|
account/models/device.py
CHANGED
@@ -138,9 +138,9 @@ class CloudCredentialsMetaData(rm.MetaDataBase):
|
|
138
138
|
|
139
139
|
|
140
140
|
def getCloudMessanger(name):
|
141
|
-
creds = CloudCredentials.objects.filter(uuid=name).last()
|
142
|
-
if creds is not None:
|
143
|
-
|
141
|
+
# creds = CloudCredentials.objects.filter(uuid=name).last()
|
142
|
+
# if creds is not None:
|
143
|
+
# return creds
|
144
144
|
if name not in CM_BACKENDS:
|
145
145
|
if name == "fcm":
|
146
146
|
from account import fcm
|
account/models/group.py
CHANGED
@@ -200,6 +200,12 @@ class Group(models.Model, RestModel, MetaDataModel):
|
|
200
200
|
self.auditLog(note, "group_edit", level=21)
|
201
201
|
self.logEvent("group_edit", component="account.Member", component_id=request.member.id, note=note)
|
202
202
|
|
203
|
+
def set_name(self, value):
|
204
|
+
if value is not None:
|
205
|
+
self.name = value.strip()
|
206
|
+
else:
|
207
|
+
self.name = None
|
208
|
+
|
203
209
|
def set_child_of(self, value):
|
204
210
|
# this is a helper to add this group to another group
|
205
211
|
parent = Group.objects.filter(pk=value).last()
|
@@ -21,11 +21,12 @@ account/migrations/0016_authsession_buid.py,sha256=wZdiH_87Ik3jAXYUgtafeAo9IbJq3
|
|
21
21
|
account/migrations/0017_rename_requires_topt_member_requires_totp.py,sha256=GksGiF7OQDV2RihyC2OTBzSmDwzCzenThkNs6FKni4M,375
|
22
22
|
account/migrations/0018_userpasskey.py,sha256=SdXYo4TkIeP5wLNfCza3Jq5-gKuUufzTHGBw0hFQOMY,1475
|
23
23
|
account/migrations/0019_group_location.py,sha256=EfMB_w4qWUGDqQeNc453PFZwpjpTeoA6xr6Qgo_YAOM,601
|
24
|
+
account/migrations/0020_cloudcredentials_cloudcredentialsmetadata.py,sha256=mHwxkyDfA4ueQOt34w5ndJB4XwNTDLv79CkKgzhlz-c,2250
|
24
25
|
account/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
26
|
account/models/__init__.py,sha256=cV_lMnT2vL_mjiYtT4hlcIHo52ocFbGSNVkOIHHLXZY,385
|
26
|
-
account/models/device.py,sha256=
|
27
|
+
account/models/device.py,sha256=MVWZEYrX_4zJaqmJS_feFplfVXYyqBJ-0_Fm3B1SVg8,5226
|
27
28
|
account/models/feeds.py,sha256=vI7fG4ASY1M0Zjke24RdnfDcuWeATl_yR_25jPmT64g,2011
|
28
|
-
account/models/group.py,sha256=
|
29
|
+
account/models/group.py,sha256=my4KT71BlS64d-Ozz9n6d57nH429kFpVdJQZZTlMqhs,21723
|
29
30
|
account/models/legacy.py,sha256=zYdtv4LC0ooxPVqWM-uToPwV-lYWQLorSE6p6yn1xDw,2720
|
30
31
|
account/models/member.py,sha256=CxxhNnFCQPEw7MGc5147J8eandYqUj6HhhQ_YRyFQX4,50397
|
31
32
|
account/models/membership.py,sha256=GJ6bSFLfU1CN9466k0XjSwn1sQIEwFeC8-oUYd2MrSs,9217
|
@@ -106,7 +107,7 @@ incident/migrations/0013_rulecheck_is_required.py,sha256=cL7tOj5XGPpKd2f5BojIKfN
|
|
106
107
|
incident/migrations/0014_event_group_alter_rulecheck_index.py,sha256=v3gm5k0LVoas27qUDOt7el7YtK4yjFVLeEpuFUCoXaQ,724
|
107
108
|
incident/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
108
109
|
incident/models/__init__.py,sha256=NMphuhb0RTMf7Ov4QkNv7iv6_I8Wtr3xQ54yjX_a31M,209
|
109
|
-
incident/models/event.py,sha256=
|
110
|
+
incident/models/event.py,sha256=WRNzvjo0jypdnQNBksOOyi-_0kVT4qWUrDZf0Aw_MPM,7355
|
110
111
|
incident/models/incident.py,sha256=Jx0RnOo70BzPX4BLMVF8jB5UOYwFPKPlxWznkTeMzOU,19332
|
111
112
|
incident/models/ossec.py,sha256=p1ptr-8lnaj1EP_VmPR58b2LmaYBGaYYKAMqhWK5yZM,2227
|
112
113
|
incident/models/rules.py,sha256=uT5GhW6Flso287lJGphAlWwL20NRnHDAZoGrWBBQfeE,6260
|
@@ -367,7 +368,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
367
368
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
368
369
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
369
370
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
370
|
-
rest/__init__.py,sha256=
|
371
|
+
rest/__init__.py,sha256=kLJs7pPu-4NUImnfU-E_eExXqJUChELhQ1dk5RGu0Gs,121
|
371
372
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
372
373
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
373
374
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -416,7 +417,7 @@ rest/serializers/legacy.py,sha256=a5O-x2PqMKX8wYWrhCmdcivVbkPnru7UdyLbrhCaAdY,61
|
|
416
417
|
rest/serializers/localizers.py,sha256=BegaCvTQVaruhWzvGHq3zWeVFmtBChatquRqAtkke10,410
|
417
418
|
rest/serializers/model.py,sha256=08HJeqpmytjxvyiJFfsSRRG0uH-iK2mXCw6w0oMfWrI,8598
|
418
419
|
rest/serializers/profiler.py,sha256=OxOimhEyvCAuzUBC9Q1dz2xaakjAqmSnekMATsjduXM,997
|
419
|
-
rest/serializers/response.py,sha256=
|
420
|
+
rest/serializers/response.py,sha256=hl5ruTWKML352Nob75uc3YGTplYmBu7OMjWeEWVEs9Y,7234
|
420
421
|
rest/serializers/util.py,sha256=-In89fpuVTd6_Ul8nwEUt3DjVKdpeoEyAxudlyB8K6Y,2734
|
421
422
|
rest/settings_helper.py,sha256=_Vn9nmL5_GPss9zIsXzacbTQkn99NbO42CqvOZC3ge4,1532
|
422
423
|
rest/ssl_check.py,sha256=kH4Pk4upUEwKTAnBLR0DIKezNJHjkW3g2TdQAObEgW4,1419
|
@@ -500,7 +501,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
500
501
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
501
502
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
502
503
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
503
|
-
django_restit-4.2.
|
504
|
-
django_restit-4.2.
|
505
|
-
django_restit-4.2.
|
506
|
-
django_restit-4.2.
|
504
|
+
django_restit-4.2.65.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
505
|
+
django_restit-4.2.65.dist-info/METADATA,sha256=XwmVxTmyV_07GGXG6B0dJ9cuFtCO6VUJeFDEPBXFzcQ,7594
|
506
|
+
django_restit-4.2.65.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
507
|
+
django_restit-4.2.65.dist-info/RECORD,,
|
incident/models/event.py
CHANGED
rest/__init__.py
CHANGED
rest/serializers/response.py
CHANGED
@@ -12,6 +12,7 @@ from . import json as js
|
|
12
12
|
from . import csv
|
13
13
|
from . import excel
|
14
14
|
# from . import profiler
|
15
|
+
STATUS_ON_PERM_DENIED = settings.get("STATUS_ON_PERM_DENIED", 403)
|
15
16
|
|
16
17
|
|
17
18
|
def restStatus(request, status, data={}, **kwargs):
|
@@ -94,7 +95,7 @@ def restResponseLog(request, resp):
|
|
94
95
|
PersistentLog.log(resp, 0, request, "rest", action="response")
|
95
96
|
|
96
97
|
|
97
|
-
def restPermissionDenied(request, error="permission denied", error_code=403, status=
|
98
|
+
def restPermissionDenied(request, error="permission denied", error_code=403, status=STATUS_ON_PERM_DENIED,
|
98
99
|
component=None, component_id=None):
|
99
100
|
# from rest import helpers as rh
|
100
101
|
# rh.log_error(error)
|
File without changes
|
File without changes
|