synapse 2.155.0__py311-none-any.whl → 2.156.0__py311-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.

Potentially problematic release.


This version of synapse might be problematic. Click here for more details.

Files changed (64) hide show
  1. synapse/cmds/cortex.py +2 -14
  2. synapse/common.py +1 -28
  3. synapse/cortex.py +10 -510
  4. synapse/lib/ast.py +60 -1
  5. synapse/lib/cell.py +33 -8
  6. synapse/lib/certdir.py +11 -0
  7. synapse/lib/cmdr.py +0 -5
  8. synapse/lib/gis.py +2 -2
  9. synapse/lib/httpapi.py +1 -43
  10. synapse/lib/layer.py +64 -201
  11. synapse/lib/lmdbslab.py +11 -0
  12. synapse/lib/node.py +1 -3
  13. synapse/lib/parser.py +10 -0
  14. synapse/lib/snap.py +121 -21
  15. synapse/lib/storm.lark +23 -6
  16. synapse/lib/storm.py +15 -338
  17. synapse/lib/storm_format.py +5 -0
  18. synapse/lib/stormlib/gen.py +1 -2
  19. synapse/lib/stormlib/gis.py +41 -0
  20. synapse/lib/stormlib/stats.py +21 -2
  21. synapse/lib/stormlib/storm.py +16 -1
  22. synapse/lib/stormtypes.py +225 -12
  23. synapse/lib/version.py +2 -2
  24. synapse/lib/view.py +96 -21
  25. synapse/models/inet.py +60 -30
  26. synapse/models/infotech.py +56 -1
  27. synapse/models/orgs.py +3 -0
  28. synapse/models/risk.py +15 -0
  29. synapse/models/syn.py +0 -38
  30. synapse/tests/test_cmds_cortex.py +1 -1
  31. synapse/tests/test_cortex.py +32 -336
  32. synapse/tests/test_lib_agenda.py +19 -54
  33. synapse/tests/test_lib_aha.py +97 -0
  34. synapse/tests/test_lib_ast.py +402 -0
  35. synapse/tests/test_lib_grammar.py +30 -10
  36. synapse/tests/test_lib_httpapi.py +0 -46
  37. synapse/tests/test_lib_layer.py +19 -234
  38. synapse/tests/test_lib_lmdbslab.py +22 -0
  39. synapse/tests/test_lib_snap.py +9 -0
  40. synapse/tests/test_lib_storm.py +16 -309
  41. synapse/tests/test_lib_stormlib_gis.py +21 -0
  42. synapse/tests/test_lib_stormlib_stats.py +107 -20
  43. synapse/tests/test_lib_stormlib_storm.py +25 -0
  44. synapse/tests/test_lib_stormtypes.py +231 -8
  45. synapse/tests/test_lib_view.py +6 -13
  46. synapse/tests/test_model_base.py +1 -1
  47. synapse/tests/test_model_inet.py +15 -0
  48. synapse/tests/test_model_infotech.py +60 -0
  49. synapse/tests/test_model_orgs.py +10 -0
  50. synapse/tests/test_model_person.py +0 -3
  51. synapse/tests/test_model_risk.py +20 -0
  52. synapse/tests/test_model_syn.py +20 -34
  53. synapse/tests/test_tools_csvtool.py +2 -1
  54. synapse/tests/test_tools_feed.py +4 -30
  55. synapse/tools/csvtool.py +2 -1
  56. {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/METADATA +3 -3
  57. {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/RECORD +60 -62
  58. {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/WHEEL +1 -1
  59. synapse/cmds/cron.py +0 -726
  60. synapse/cmds/trigger.py +0 -319
  61. synapse/tests/test_cmds_cron.py +0 -453
  62. synapse/tests/test_cmds_trigger.py +0 -176
  63. {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/LICENSE +0 -0
  64. {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/top_level.txt +0 -0
synapse/cmds/cortex.py CHANGED
@@ -56,17 +56,6 @@ Examples:
56
56
  ('line', {'type': 'glob'}), # type: ignore
57
57
  )
58
58
 
59
- splicetypes = (
60
- 'tag:add',
61
- 'tag:del',
62
- 'node:add',
63
- 'node:del',
64
- 'prop:set',
65
- 'prop:del',
66
- 'tag:prop:set',
67
- 'tag:prop:del',
68
- )
69
-
70
59
  def _make_argparser(self):
71
60
 
72
61
  parser = s_cmd.Parser(prog='log', outp=self, description=self.__doc__)
@@ -111,7 +100,7 @@ Examples:
111
100
  editsonly = self.locs.get('log:editsonly')
112
101
  nodesonly = self.locs.get('log:nodesonly')
113
102
  if fd and not fd.closed:
114
- if editsonly and mesg[0] not in (*self.splicetypes, 'node:edits'):
103
+ if editsonly and mesg[0] != 'node:edits':
115
104
  return
116
105
  if nodesonly:
117
106
  if mesg[0] != 'node':
@@ -221,7 +210,6 @@ class StormCmd(s_cli.Cmd):
221
210
  --editformat <format>: What format of edits the server shall emit.
222
211
  Options are
223
212
  * nodeedits (default),
224
- * splices (similar to < 2.0.0),
225
213
  * count (just counts of nodeedits), or
226
214
  * none (no such messages emitted).
227
215
  --show-prov: Show provenance messages.
@@ -239,7 +227,7 @@ class StormCmd(s_cli.Cmd):
239
227
  '''
240
228
  _cmd_name = 'storm'
241
229
 
242
- editformat_enums = ('nodeedits', 'splices', 'count', 'none')
230
+ editformat_enums = ('nodeedits', 'count', 'none')
243
231
  _cmd_syntax = (
244
232
  ('--hide-tags', {}), # type: ignore
245
233
  ('--show', {'type': 'valu'}),
synapse/common.py CHANGED
@@ -935,8 +935,7 @@ def deprecated(name, curv='2.x', eolv='3.0.0'):
935
935
  mesg = f'"{name}" is deprecated in {curv} and will be removed in {eolv}'
936
936
  warnings.warn(mesg, DeprecationWarning)
937
937
 
938
- _splicedepr = '2023-10-01'
939
- def deprdate(name, date):
938
+ def deprdate(name, date): # pragma: no cover
940
939
  mesg = f'{name} is deprecated and will be removed on {date}.'
941
940
  warnings.warn(mesg, DeprecationWarning)
942
941
 
@@ -1159,32 +1158,6 @@ def getSslCtx(cadir, purpose=ssl.Purpose.SERVER_AUTH):
1159
1158
  logger.exception(f'Error loading {certpath}')
1160
1159
  return sslctx
1161
1160
 
1162
- class aclosing(contextlib.AbstractAsyncContextManager): # pragma: no cover
1163
- """Async context manager for safely finalizing an asynchronously cleaned-up
1164
- resource such as an async generator, calling its ``aclose()`` method.
1165
-
1166
- Code like this::
1167
-
1168
- async with aclosing(<module>.fetch(<arguments>)) as agen:
1169
- <block>
1170
-
1171
- is equivalent to this::
1172
-
1173
- agen = <module>.fetch(<arguments>)
1174
- try:
1175
- <block>
1176
- finally:
1177
- await agen.aclose()
1178
-
1179
- """
1180
- def __init__(self, thing):
1181
- deprecated('synapse.common.aclosing()', curv='2.145.0', eolv='v2.150.0')
1182
- self.thing = thing
1183
- async def __aenter__(self):
1184
- return self.thing
1185
- async def __aexit__(self, exc, cls, tb):
1186
- await self.thing.aclose()
1187
-
1188
1161
  def httpcodereason(code):
1189
1162
  '''
1190
1163
  Get the reason for an HTTP status code.