django-restit 4.2.143__py3-none-any.whl → 4.2.145__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.143
3
+ Version: 4.2.145
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -77,7 +77,7 @@ auditlog/urls.py,sha256=GNqpN74EpYlMND2UFUdPt5rOkTYYrdbTV0W3fg4zLfQ,163
77
77
  inbox/README.md,sha256=jsklDrzD5d94r7cwgaU6Gi1HCjBDfWq7jd92qB0JYPU,2169
78
78
  inbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
79
  inbox/admin.py,sha256=AgG82kwLzabzKgOok-ISJLQd7JoyuGa9hqrxrm3zSOQ,243
80
- inbox/handlers.py,sha256=Zz7l7Bo9z3kjSOl5QtotttImrCCePB7vHlKBpPMsHqs,5638
80
+ inbox/handlers.py,sha256=oHxGp2OBbo01OZil6LkaPSKWV20x3Y5lEKjKAcCLB-I,5798
81
81
  inbox/migrations/0001_initial.py,sha256=P1OmbSHZGhj3wVBdFKWEzNrPdbyKzR9fFBXP8rhXXh8,6429
82
82
  inbox/migrations/0002_alter_message_cc.py,sha256=dsnDHCs1-dFZfSEWJmufBOs5gvNbI7u99kru6fVas0Y,380
83
83
  inbox/migrations/0003_attachment_content_type.py,sha256=dh_km90V6R3O0-N2oNTWhWLZZ96MylRgDY7Poua9CZ8,416
@@ -115,7 +115,7 @@ incident/migrations/0014_event_group_alter_rulecheck_index.py,sha256=v3gm5k0LVoa
115
115
  incident/migrations/0015_rule_title_template_alter_incident_state.py,sha256=FPUDhFwqBC39EjeknRT7BPddEf6ExCjsXVb9LMqIn3U,687
116
116
  incident/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
117
  incident/models/__init__.py,sha256=NMphuhb0RTMf7Ov4QkNv7iv6_I8Wtr3xQ54yjX_a31M,209
118
- incident/models/event.py,sha256=mk5IQgxtwkLKJEpwIHwO0c45X4CfwqqIN-aI5lJPVBg,7944
118
+ incident/models/event.py,sha256=FEzEKKQKLkdRrPCvv-3Um9E2UPQjyIJp314Zr2LHuiw,7976
119
119
  incident/models/incident.py,sha256=n5S-QzGvAOtJmlzbj3vPTY03avIknPjDMLUUq9FyTa0,21648
120
120
  incident/models/ossec.py,sha256=eUDRGawzuLWobKEVGKfdZisDnyjS_Hlxi0T_GCSLCCI,2252
121
121
  incident/models/rules.py,sha256=aRkJ0ZnTv87nAUC1sHVkPExfb3OJ8fgHQIhnCIpIbhQ,7001
@@ -302,7 +302,7 @@ medialib/templates/medialib/testpicker.html,sha256=I7KnrAu9e4kQhuEEN-51HGzcuJ06E
302
302
  medialib/tests.py,sha256=z1THDMo-R9HWMvCCOgX6aH6-2W2uWqrtbJ_k-zfpgyc,6045
303
303
  medialib/tq.py,sha256=ZDRBZ9qEsqNAsk48cciLyX7DIziqD2uPEawtQny1Ja8,544
304
304
  medialib/urls.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
305
- medialib/utils.py,sha256=StQY7k9dOCksdTsYqUb3aGpwwrcYg07z7vskBQqCPnw,3774
305
+ medialib/utils.py,sha256=nHB1g9PuahzVVF8MqDLaxZY8u53Ggtve8nZJKyaIEUA,3810
306
306
  medialib/views.py,sha256=h_Fm3FOX04VV2G-J141wEHxT36d46HVdzPJg_u8r2vI,4321
307
307
  medialib/youtube/__init__.py,sha256=fmu9XPaDpadkb2OuroQsKiWpUPo7c5y8o83HmLLMIHA,4303
308
308
  medialib/youtube/apiclient/__init__.py,sha256=iGdQFKwzm0VxArl8X183-_ZBhIsETZlbXxhBAUz3MfI,601
@@ -379,7 +379,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
379
379
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
380
380
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
381
381
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
382
- rest/__init__.py,sha256=GJheIdY4xT-lMdgerrt-HFxPfsw3oPkVEAJYFBauwss,122
382
+ rest/__init__.py,sha256=trsrty-OmytWDbV8VQRGLWtxXyAs0fe3ChtS0kcDo1s,122
383
383
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
384
384
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
385
385
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -515,7 +515,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
515
515
  ws4redis/settings.py,sha256=KKq00EwoGnz1yLwCZr5Dfoq2izivmAdsNEEM4EhZwN4,1610
516
516
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
517
517
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
518
- django_restit-4.2.143.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
519
- django_restit-4.2.143.dist-info/METADATA,sha256=FpgN7kXRO3P4WCA8vaKZHxvyRcQRuhLyXH3la6TydgQ,7663
520
- django_restit-4.2.143.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
521
- django_restit-4.2.143.dist-info/RECORD,,
518
+ django_restit-4.2.145.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
519
+ django_restit-4.2.145.dist-info/METADATA,sha256=dfGvUCDbH5Nf_RJPVqtw7qe0mMQC1P28kHQvz25h56Y,7663
520
+ django_restit-4.2.145.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
521
+ django_restit-4.2.145.dist-info/RECORD,,
inbox/handlers.py CHANGED
@@ -57,12 +57,14 @@ def on_complaint(request, msg):
57
57
  return rv.restStatus(request, True)
58
58
 
59
59
 
60
- def on_email(request, msg):
60
+ def on_email(request, msg=None):
61
61
  """
62
62
  Email receiving can be configured in 2 ways.
63
63
  1. raw email via SNS which would have content field
64
64
  2. s3 bucket stored email which will have a receipt.action.bucketName
65
65
  """
66
+ if msg is None:
67
+ msg = request.DATA.asDict()
66
68
  if msg.content is None and msg.receipt and msg.receipt.action:
67
69
  action = msg.receipt.action
68
70
  if action.type == "S3":
@@ -111,6 +113,9 @@ def on_raw_email(request, imsg, msg_data):
111
113
  elif msg_atch.encoding == "quoted-printable":
112
114
  obj = mailtils.toFileObject(msg_atch)
113
115
  atch.saveMediaFile(obj, "media", msg_atch.name)
116
+ else:
117
+ logger.error("unknown encoding", msg_atch.encoding)
118
+ continue
114
119
  atch.save()
115
120
  attachments.append(atch)
116
121
  # add the recipients mailbox
incident/models/event.py CHANGED
@@ -193,6 +193,7 @@ class Event(JSONMetaData, rm.RestModel):
193
193
  incident.description = self.description
194
194
  elif self.category == "ossec":
195
195
  incident.description = f"{self.hostname}: {self.description}"
196
+ incident.save()
196
197
  incident.updateAbuseInfo()
197
198
  else:
198
199
  incident.description = self.description
medialib/utils.py CHANGED
@@ -7,8 +7,8 @@ import hashlib
7
7
 
8
8
  EXT_MAP = {
9
9
  "V":['mpg', 'mpeg', 'mpe', 'mp4', 'm4v', 'mov', 'qt', '3gp', 'ogv', 'webm', 'flv', 'asf', 'asx', 'wmv', 'mpv', 'mkv', 'avi', 'dat', 'swf'],
10
- "I":['jpg', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tif', 'tiff'],
11
- "T":['txt', 'html'],
10
+ "I":['jpg', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tif', 'tiff', 'webp', 'ico'],
11
+ "T":['txt', 'html', 'csv', 'md'],
12
12
  }
13
13
 
14
14
  KIND_MAP = {
@@ -27,7 +27,7 @@ def guessBase64Kind(data):
27
27
  # look at first 16 bytes for ext
28
28
  sample = fromBase64ToBytes(data[:16]).lower() # data[:16]
29
29
  # sample = self.base64_data[:16].decode('base64').lower()
30
- for ext in ["png", "jpg", "jpeg", "jfif", "bmp", "gif", "tif"]:
30
+ for ext in ["png", "jpg", "jpeg", "jfif", "bmp", "gif", "tif", "webp"]:
31
31
  if toBytes(ext) in sample:
32
32
  if ext == "jfif":
33
33
  ext = "jpg"
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.2.143"
4
+ __version__ = "4.2.145"