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.
- synapse/cmds/cortex.py +2 -14
- synapse/common.py +1 -28
- synapse/cortex.py +10 -510
- synapse/lib/ast.py +60 -1
- synapse/lib/cell.py +33 -8
- synapse/lib/certdir.py +11 -0
- synapse/lib/cmdr.py +0 -5
- synapse/lib/gis.py +2 -2
- synapse/lib/httpapi.py +1 -43
- synapse/lib/layer.py +64 -201
- synapse/lib/lmdbslab.py +11 -0
- synapse/lib/node.py +1 -3
- synapse/lib/parser.py +10 -0
- synapse/lib/snap.py +121 -21
- synapse/lib/storm.lark +23 -6
- synapse/lib/storm.py +15 -338
- synapse/lib/storm_format.py +5 -0
- synapse/lib/stormlib/gen.py +1 -2
- synapse/lib/stormlib/gis.py +41 -0
- synapse/lib/stormlib/stats.py +21 -2
- synapse/lib/stormlib/storm.py +16 -1
- synapse/lib/stormtypes.py +225 -12
- synapse/lib/version.py +2 -2
- synapse/lib/view.py +96 -21
- synapse/models/inet.py +60 -30
- synapse/models/infotech.py +56 -1
- synapse/models/orgs.py +3 -0
- synapse/models/risk.py +15 -0
- synapse/models/syn.py +0 -38
- synapse/tests/test_cmds_cortex.py +1 -1
- synapse/tests/test_cortex.py +32 -336
- synapse/tests/test_lib_agenda.py +19 -54
- synapse/tests/test_lib_aha.py +97 -0
- synapse/tests/test_lib_ast.py +402 -0
- synapse/tests/test_lib_grammar.py +30 -10
- synapse/tests/test_lib_httpapi.py +0 -46
- synapse/tests/test_lib_layer.py +19 -234
- synapse/tests/test_lib_lmdbslab.py +22 -0
- synapse/tests/test_lib_snap.py +9 -0
- synapse/tests/test_lib_storm.py +16 -309
- synapse/tests/test_lib_stormlib_gis.py +21 -0
- synapse/tests/test_lib_stormlib_stats.py +107 -20
- synapse/tests/test_lib_stormlib_storm.py +25 -0
- synapse/tests/test_lib_stormtypes.py +231 -8
- synapse/tests/test_lib_view.py +6 -13
- synapse/tests/test_model_base.py +1 -1
- synapse/tests/test_model_inet.py +15 -0
- synapse/tests/test_model_infotech.py +60 -0
- synapse/tests/test_model_orgs.py +10 -0
- synapse/tests/test_model_person.py +0 -3
- synapse/tests/test_model_risk.py +20 -0
- synapse/tests/test_model_syn.py +20 -34
- synapse/tests/test_tools_csvtool.py +2 -1
- synapse/tests/test_tools_feed.py +4 -30
- synapse/tools/csvtool.py +2 -1
- {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/METADATA +3 -3
- {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/RECORD +60 -62
- {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/WHEEL +1 -1
- synapse/cmds/cron.py +0 -726
- synapse/cmds/trigger.py +0 -319
- synapse/tests/test_cmds_cron.py +0 -453
- synapse/tests/test_cmds_trigger.py +0 -176
- {synapse-2.155.0.dist-info → synapse-2.156.0.dist-info}/LICENSE +0 -0
- {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]
|
|
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', '
|
|
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
|
-
|
|
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.
|