synapse 2.175.0__py311-none-any.whl → 2.176.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/cortex.py +1 -0
- synapse/lib/ast.py +6 -5
- synapse/lib/storm.py +9 -4
- synapse/lib/stormlib/storm.py +117 -5
- synapse/lib/version.py +2 -2
- synapse/models/inet.py +23 -0
- synapse/tests/test_lib_stormlib_storm.py +82 -1
- synapse/tests/test_model_inet.py +31 -0
- {synapse-2.175.0.dist-info → synapse-2.176.0.dist-info}/METADATA +1 -1
- {synapse-2.175.0.dist-info → synapse-2.176.0.dist-info}/RECORD +13 -13
- {synapse-2.175.0.dist-info → synapse-2.176.0.dist-info}/WHEEL +1 -1
- {synapse-2.175.0.dist-info → synapse-2.176.0.dist-info}/LICENSE +0 -0
- {synapse-2.175.0.dist-info → synapse-2.176.0.dist-info}/top_level.txt +0 -0
synapse/cortex.py
CHANGED
|
@@ -4027,6 +4027,7 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
|
|
|
4027
4027
|
self.addStormCmd(s_storm.MoveNodesCmd)
|
|
4028
4028
|
self.addStormCmd(s_storm.BackgroundCmd)
|
|
4029
4029
|
self.addStormCmd(s_stormlib_macro.MacroExecCmd)
|
|
4030
|
+
self.addStormCmd(s_stormlib_storm.StormExecCmd)
|
|
4030
4031
|
self.addStormCmd(s_stormlib_stats.StatsCountByCmd)
|
|
4031
4032
|
self.addStormCmd(s_stormlib_cortex.StormPoolDelCmd)
|
|
4032
4033
|
self.addStormCmd(s_stormlib_cortex.StormPoolGetCmd)
|
synapse/lib/ast.py
CHANGED
|
@@ -284,7 +284,7 @@ class Search(Query):
|
|
|
284
284
|
view = runt.snap.view
|
|
285
285
|
|
|
286
286
|
if not view.core.stormiface_search:
|
|
287
|
-
await runt.snap.warn('Storm search interface is not enabled!')
|
|
287
|
+
await runt.snap.warn('Storm search interface is not enabled!', log=False)
|
|
288
288
|
return
|
|
289
289
|
|
|
290
290
|
async def searchgenr():
|
|
@@ -2389,7 +2389,7 @@ class FormPivot(PivotOper):
|
|
|
2389
2389
|
items = e.items()
|
|
2390
2390
|
mesg = items.pop('mesg', '')
|
|
2391
2391
|
mesg = ': '.join((f'{e.__class__.__qualname__} [{repr(node.ndef[1])}] during pivot', mesg))
|
|
2392
|
-
await runt.snap.warn(mesg, **items)
|
|
2392
|
+
await runt.snap.warn(mesg, log=False, **items)
|
|
2393
2393
|
|
|
2394
2394
|
class PropPivotOut(PivotOper):
|
|
2395
2395
|
'''
|
|
@@ -2428,7 +2428,7 @@ class PropPivotOut(PivotOper):
|
|
|
2428
2428
|
if runt.model.forms.get(fname) is None:
|
|
2429
2429
|
if not warned:
|
|
2430
2430
|
mesg = f'The source property "{name}" array type "{fname}" is not a form. Cannot pivot.'
|
|
2431
|
-
await runt.snap.warn(mesg)
|
|
2431
|
+
await runt.snap.warn(mesg, log=False)
|
|
2432
2432
|
warned = True
|
|
2433
2433
|
continue
|
|
2434
2434
|
|
|
@@ -2452,7 +2452,8 @@ class PropPivotOut(PivotOper):
|
|
|
2452
2452
|
fname = prop.type.name
|
|
2453
2453
|
if prop.modl.form(fname) is None:
|
|
2454
2454
|
if warned is False:
|
|
2455
|
-
await runt.snap.warn(f'The source property "{name}" type "{fname}" is not a form. Cannot pivot.'
|
|
2455
|
+
await runt.snap.warn(f'The source property "{name}" type "{fname}" is not a form. Cannot pivot.',
|
|
2456
|
+
log=False)
|
|
2456
2457
|
warned = True
|
|
2457
2458
|
continue
|
|
2458
2459
|
|
|
@@ -2574,7 +2575,7 @@ class PropPivot(PivotOper):
|
|
|
2574
2575
|
items = e.items()
|
|
2575
2576
|
mesg = items.pop('mesg', '')
|
|
2576
2577
|
mesg = ': '.join((f'{e.__class__.__qualname__} [{repr(valu)}] during pivot', mesg))
|
|
2577
|
-
await runt.snap.warn(mesg, **items)
|
|
2578
|
+
await runt.snap.warn(mesg, log=False, **items)
|
|
2578
2579
|
|
|
2579
2580
|
class Value(AstNode):
|
|
2580
2581
|
'''
|
synapse/lib/storm.py
CHANGED
|
@@ -1874,6 +1874,14 @@ class Runtime(s_base.Base):
|
|
|
1874
1874
|
valu.incref()
|
|
1875
1875
|
self.vars.update(varz)
|
|
1876
1876
|
|
|
1877
|
+
self._initRuntVars(query)
|
|
1878
|
+
|
|
1879
|
+
self.proxies = {}
|
|
1880
|
+
|
|
1881
|
+
self.onfini(self._onRuntFini)
|
|
1882
|
+
|
|
1883
|
+
def _initRuntVars(self, query):
|
|
1884
|
+
|
|
1877
1885
|
# declare path builtins as non-runtsafe
|
|
1878
1886
|
self.runtvars = {
|
|
1879
1887
|
'node': False,
|
|
@@ -1882,17 +1890,14 @@ class Runtime(s_base.Base):
|
|
|
1882
1890
|
|
|
1883
1891
|
# inherit runtsafe vars from our root
|
|
1884
1892
|
if self.root is not None:
|
|
1885
|
-
self.runtvars.update(root.runtvars)
|
|
1893
|
+
self.runtvars.update(self.root.runtvars)
|
|
1886
1894
|
self.runtvars.update({k: True for k in self.root.getScopeVars().keys()})
|
|
1887
1895
|
|
|
1888
1896
|
# all vars/ctors are de-facto runtsafe
|
|
1889
1897
|
self.runtvars.update({k: True for k in self.vars.keys()})
|
|
1890
1898
|
self.runtvars.update({k: True for k in self.ctors.keys()})
|
|
1891
1899
|
|
|
1892
|
-
self.proxies = {}
|
|
1893
|
-
|
|
1894
1900
|
self._loadRuntVars(query)
|
|
1895
|
-
self.onfini(self._onRuntFini)
|
|
1896
1901
|
|
|
1897
1902
|
def getScopeVars(self):
|
|
1898
1903
|
'''
|
synapse/lib/stormlib/storm.py
CHANGED
|
@@ -1,18 +1,102 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
import synapse.exc as s_exc
|
|
4
|
+
import synapse.common as s_common
|
|
4
5
|
|
|
6
|
+
import synapse.lib.storm as s_storm
|
|
5
7
|
import synapse.lib.stormtypes as s_stormtypes
|
|
6
8
|
|
|
7
9
|
evaldesc = '''\
|
|
8
|
-
Evaluate a
|
|
10
|
+
Evaluate a Storm runtime value and optionally cast/coerce it.
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
Note:
|
|
13
|
+
If Storm logging is enabled, the expression being evaluated will be logged
|
|
14
|
+
separately.
|
|
15
|
+
'''
|
|
16
|
+
|
|
17
|
+
rundesc = '''
|
|
18
|
+
Run a Storm query and yield the messages output by the Storm interpreter.
|
|
19
|
+
|
|
20
|
+
Note:
|
|
21
|
+
If Storm logging is enabled, the query being run will be logged separately.
|
|
12
22
|
'''
|
|
13
23
|
|
|
14
24
|
stormlogger = logging.getLogger('synapse.storm')
|
|
15
25
|
|
|
26
|
+
class StormExecCmd(s_storm.Cmd):
|
|
27
|
+
'''
|
|
28
|
+
Execute text or an embedded query object as Storm in the current pipeline.
|
|
29
|
+
|
|
30
|
+
NOTE: It is recommended to avoid using this where possible to avoid potential
|
|
31
|
+
query injection risks. If you must use this, take care to ensure any values
|
|
32
|
+
being executed have been properly sanitized.
|
|
33
|
+
|
|
34
|
+
Examples:
|
|
35
|
+
|
|
36
|
+
// Add nodes using text in a variable
|
|
37
|
+
$query = '[ inet:fqdn=foo.com inet:fqdn=bar.net ]'
|
|
38
|
+
storm.exec $query
|
|
39
|
+
|
|
40
|
+
// Filter nodes in the pipeline using text in a variable
|
|
41
|
+
$filter = '-:asn=10'
|
|
42
|
+
inet:ipv4:asn
|
|
43
|
+
storm.exec $filter
|
|
44
|
+
|
|
45
|
+
// Pivot using an embedded query
|
|
46
|
+
$pivot = ${ -> inet:asn }
|
|
47
|
+
inet:ipv4:asn
|
|
48
|
+
storm.exec $pivot
|
|
49
|
+
'''
|
|
50
|
+
name = 'storm.exec'
|
|
51
|
+
def getArgParser(self):
|
|
52
|
+
pars = s_storm.Cmd.getArgParser(self)
|
|
53
|
+
pars.add_argument('query', help='The Storm to execute.')
|
|
54
|
+
return pars
|
|
55
|
+
|
|
56
|
+
async def execStormCmd(self, runt, genr):
|
|
57
|
+
|
|
58
|
+
if self.runtsafe:
|
|
59
|
+
|
|
60
|
+
text = await s_stormtypes.tostr(self.opts.query)
|
|
61
|
+
query = await runt.getStormQuery(text)
|
|
62
|
+
|
|
63
|
+
extra = await self.runt.snap.core.getLogExtra(text=text, view=self.runt.snap.view.iden)
|
|
64
|
+
stormlogger.info(f'Executing storm query via storm.exec {{{text}}} as [{self.runt.user.name}]', extra=extra)
|
|
65
|
+
|
|
66
|
+
async with runt.getSubRuntime(query) as subr:
|
|
67
|
+
async for subp in subr.execute(genr=genr):
|
|
68
|
+
yield subp
|
|
69
|
+
|
|
70
|
+
else:
|
|
71
|
+
|
|
72
|
+
item = None
|
|
73
|
+
async for item in genr:
|
|
74
|
+
break
|
|
75
|
+
|
|
76
|
+
text = await s_stormtypes.tostr(self.opts.query)
|
|
77
|
+
query = await runt.getStormQuery(text)
|
|
78
|
+
|
|
79
|
+
extra = await self.runt.snap.core.getLogExtra(text=text, view=self.runt.snap.view.iden)
|
|
80
|
+
stormlogger.info(f'Executing storm query via storm.exec {{{text}}} as [{self.runt.user.name}]', extra=extra)
|
|
81
|
+
|
|
82
|
+
async with runt.getSubRuntime(query) as subr:
|
|
83
|
+
async for subp in subr.execute(genr=s_common.agen(item)):
|
|
84
|
+
yield subp
|
|
85
|
+
|
|
86
|
+
async for item in genr:
|
|
87
|
+
text = await s_stormtypes.tostr(self.opts.query)
|
|
88
|
+
query = await runt.getStormQuery(text)
|
|
89
|
+
|
|
90
|
+
subr.runtvars.clear()
|
|
91
|
+
subr.query = query
|
|
92
|
+
subr._initRuntVars(query)
|
|
93
|
+
|
|
94
|
+
extra = await self.runt.snap.core.getLogExtra(text=text, view=self.runt.snap.view.iden)
|
|
95
|
+
stormlogger.info(f'Executing storm query via storm.exec {{{text}}} as [{self.runt.user.name}]', extra=extra)
|
|
96
|
+
|
|
97
|
+
async for subp in subr.execute(genr=s_common.agen(item)):
|
|
98
|
+
yield subp
|
|
99
|
+
|
|
16
100
|
@s_stormtypes.registry.registerLib
|
|
17
101
|
class LibStorm(s_stormtypes.Lib):
|
|
18
102
|
'''
|
|
@@ -25,15 +109,43 @@ class LibStorm(s_stormtypes.Lib):
|
|
|
25
109
|
{'name': 'text', 'type': 'str', 'desc': 'A storm expression string.'},
|
|
26
110
|
{'name': 'cast', 'type': 'str', 'desc': 'A type to cast the result to.', 'default': None},
|
|
27
111
|
),
|
|
28
|
-
'returns': {'type': 'any', 'desc': 'The value of the expression and optional cast.'
|
|
112
|
+
'returns': {'type': 'any', 'desc': 'The value of the expression and optional cast.'}}},
|
|
113
|
+
{'name': 'run', 'desc': rundesc,
|
|
114
|
+
'type': {'type': 'function', '_funcname': '_runStorm',
|
|
115
|
+
'args': (
|
|
116
|
+
{'name': 'query', 'type': 'str', 'desc': 'A Storm query string.'},
|
|
117
|
+
{'name': 'opts', 'type': 'dict', 'desc': 'Storm options dictionary.', 'default': None},
|
|
118
|
+
),
|
|
119
|
+
'returns': {'name': 'yields', 'type': 'list', 'desc': 'The output messages from the Storm runtime.'}}},
|
|
29
120
|
)
|
|
30
121
|
_storm_lib_path = ('storm',)
|
|
31
122
|
|
|
32
123
|
def getObjLocals(self):
|
|
33
124
|
return {
|
|
125
|
+
'run': self._runStorm,
|
|
34
126
|
'eval': self._evalStorm,
|
|
35
127
|
}
|
|
36
128
|
|
|
129
|
+
async def _runStorm(self, query, opts=None):
|
|
130
|
+
|
|
131
|
+
opts = await s_stormtypes.toprim(opts)
|
|
132
|
+
query = await s_stormtypes.tostr(query)
|
|
133
|
+
|
|
134
|
+
if opts is None:
|
|
135
|
+
opts = {}
|
|
136
|
+
|
|
137
|
+
user = opts.get('user')
|
|
138
|
+
if user is None:
|
|
139
|
+
user = opts['user'] = self.runt.user.iden
|
|
140
|
+
|
|
141
|
+
if user != self.runt.user.iden:
|
|
142
|
+
self.runt.confirm(('impersonate',))
|
|
143
|
+
|
|
144
|
+
opts.setdefault('view', self.runt.snap.view.iden)
|
|
145
|
+
|
|
146
|
+
async for mesg in self.runt.snap.view.core.storm(query, opts=opts):
|
|
147
|
+
yield mesg
|
|
148
|
+
|
|
37
149
|
@s_stormtypes.stormfunc(readonly=True)
|
|
38
150
|
async def _evalStorm(self, text, cast=None):
|
|
39
151
|
|
|
@@ -41,7 +153,7 @@ class LibStorm(s_stormtypes.Lib):
|
|
|
41
153
|
cast = await s_stormtypes.tostr(cast, noneok=True)
|
|
42
154
|
|
|
43
155
|
if self.runt.snap.core.stormlog:
|
|
44
|
-
extra = await self.runt.snap.core.getLogExtra(text=text)
|
|
156
|
+
extra = await self.runt.snap.core.getLogExtra(text=text, view=self.runt.snap.view.iden)
|
|
45
157
|
stormlogger.info(f'Executing storm query via $lib.storm.eval() {{{text}}} as [{self.runt.user.name}]', extra=extra)
|
|
46
158
|
|
|
47
159
|
casttype = None
|
synapse/lib/version.py
CHANGED
|
@@ -223,6 +223,6 @@ def reqVersion(valu, reqver,
|
|
|
223
223
|
##############################################################################
|
|
224
224
|
# The following are touched during the release process by bumpversion.
|
|
225
225
|
# Do not modify these directly.
|
|
226
|
-
version = (2,
|
|
226
|
+
version = (2, 176, 0)
|
|
227
227
|
verstring = '.'.join([str(x) for x in version])
|
|
228
|
-
commit = '
|
|
228
|
+
commit = '16ee721a6b7221344eaf946c3ab4602dda546b1a'
|
synapse/models/inet.py
CHANGED
|
@@ -1519,6 +1519,7 @@ class InetModule(s_module.CoreModule):
|
|
|
1519
1519
|
'doc': 'An object status enumeration.'}),
|
|
1520
1520
|
|
|
1521
1521
|
('inet:service:account', ('guid', {}), {
|
|
1522
|
+
'interfaces': ('inet:service:object',),
|
|
1522
1523
|
'doc': 'An account within a service platform. Accounts may be instance specific.'}),
|
|
1523
1524
|
|
|
1524
1525
|
('inet:service:permission:type:taxonomy', ('taxonomy', {}), {
|
|
@@ -1557,6 +1558,10 @@ class InetModule(s_module.CoreModule):
|
|
|
1557
1558
|
'interfaces': ('inet:service:object',),
|
|
1558
1559
|
'doc': 'A channel used to distribute messages.'}),
|
|
1559
1560
|
|
|
1561
|
+
('inet:service:thread', ('guid', {}), {
|
|
1562
|
+
'interfaces': ('inet:service:object',),
|
|
1563
|
+
'doc': 'A message thread.'}),
|
|
1564
|
+
|
|
1560
1565
|
('inet:service:channel:member', ('guid', {}), {
|
|
1561
1566
|
'interfaces': ('inet:service:object',),
|
|
1562
1567
|
'doc': 'Represents a service account being a member of a channel.'}),
|
|
@@ -3657,9 +3662,15 @@ class InetModule(s_module.CoreModule):
|
|
|
3657
3662
|
('channel', ('inet:service:channel', {}), {
|
|
3658
3663
|
'doc': 'The channel that the message was sent to.'}),
|
|
3659
3664
|
|
|
3665
|
+
('thread', ('inet:service:thread', {}), {
|
|
3666
|
+
'doc': 'The thread which contains the message.'}),
|
|
3667
|
+
|
|
3660
3668
|
('public', ('bool', {}), {
|
|
3661
3669
|
'doc': 'Set to true if the message is publicly visible.'}),
|
|
3662
3670
|
|
|
3671
|
+
('title', ('str', {'lower': True, 'onespace': True}), {
|
|
3672
|
+
'doc': 'The message title.'}),
|
|
3673
|
+
|
|
3663
3674
|
('text', ('str', {}), {
|
|
3664
3675
|
'disp': {'hint': 'text'},
|
|
3665
3676
|
'doc': 'The text body of the message.'}),
|
|
@@ -3725,6 +3736,18 @@ class InetModule(s_module.CoreModule):
|
|
|
3725
3736
|
'doc': 'The time period where the channel was available.'}),
|
|
3726
3737
|
)),
|
|
3727
3738
|
|
|
3739
|
+
('inet:service:thread', {}, (
|
|
3740
|
+
|
|
3741
|
+
('title', ('str', {'lower': True, 'onespace': True}), {
|
|
3742
|
+
'doc': 'The title of the thread.'}),
|
|
3743
|
+
|
|
3744
|
+
('channel', ('inet:service:channel', {}), {
|
|
3745
|
+
'doc': 'The channel that contains the thread.'}),
|
|
3746
|
+
|
|
3747
|
+
('message', ('inet:service:message', {}), {
|
|
3748
|
+
'doc': 'The message which initiated the thread.'}),
|
|
3749
|
+
)),
|
|
3750
|
+
|
|
3728
3751
|
('inet:service:channel:member', {}, (
|
|
3729
3752
|
|
|
3730
3753
|
('channel', ('inet:service:channel', {}), {
|
|
@@ -5,7 +5,7 @@ import synapse.tests.utils as s_test
|
|
|
5
5
|
|
|
6
6
|
class LibStormTest(s_test.SynTest):
|
|
7
7
|
|
|
8
|
-
async def
|
|
8
|
+
async def test_lib_stormlib_storm_eval(self):
|
|
9
9
|
async with self.getTestCore() as core:
|
|
10
10
|
|
|
11
11
|
opts = {'vars': {'text': '(10)'}}
|
|
@@ -61,3 +61,84 @@ class LibStormTest(s_test.SynTest):
|
|
|
61
61
|
|
|
62
62
|
mesg = f'Executing storm query via $lib.storm.eval() {{{q}}} as [root]'
|
|
63
63
|
self.isin(mesg, data)
|
|
64
|
+
|
|
65
|
+
async def test_lib_stormlib_storm(self):
|
|
66
|
+
|
|
67
|
+
async with self.getTestCore() as core:
|
|
68
|
+
|
|
69
|
+
q = '''
|
|
70
|
+
$query = '[ inet:fqdn=foo.com inet:fqdn=bar.com ]'
|
|
71
|
+
storm.exec $query
|
|
72
|
+
'''
|
|
73
|
+
self.len(2, await core.nodes(q))
|
|
74
|
+
|
|
75
|
+
q = '''[
|
|
76
|
+
(inet:ipv4=1.2.3.4 :asn=4)
|
|
77
|
+
(inet:ipv4=1.2.3.5 :asn=5)
|
|
78
|
+
(inet:ipv4=1.2.3.6 :asn=10)
|
|
79
|
+
]'''
|
|
80
|
+
await core.nodes(q)
|
|
81
|
+
|
|
82
|
+
q = '''
|
|
83
|
+
$filter = '-:asn=10'
|
|
84
|
+
inet:ipv4:asn
|
|
85
|
+
storm.exec $filter
|
|
86
|
+
'''
|
|
87
|
+
nodes = await core.nodes(q)
|
|
88
|
+
self.len(2, nodes)
|
|
89
|
+
for node in nodes:
|
|
90
|
+
self.ne(node.get('asn'), 10)
|
|
91
|
+
|
|
92
|
+
q = '''
|
|
93
|
+
$pivot = ${ -> inet:asn }
|
|
94
|
+
inet:ipv4:asn
|
|
95
|
+
storm.exec $pivot
|
|
96
|
+
'''
|
|
97
|
+
nodes = await core.nodes(q)
|
|
98
|
+
self.len(3, nodes)
|
|
99
|
+
for node in nodes:
|
|
100
|
+
self.eq(node.form.name, 'inet:asn')
|
|
101
|
+
|
|
102
|
+
# Exec a non-runtsafe query
|
|
103
|
+
q = '''
|
|
104
|
+
inet:ipv4:asn
|
|
105
|
+
$filter = `+:asn={$node.repr().split('.').'-1'}`
|
|
106
|
+
storm.exec $filter
|
|
107
|
+
'''
|
|
108
|
+
nodes = await core.nodes(q)
|
|
109
|
+
self.len(2, nodes)
|
|
110
|
+
for node in nodes:
|
|
111
|
+
self.ne(node.get('asn'), 10)
|
|
112
|
+
|
|
113
|
+
iden = await core.callStorm('return($lib.view.get().fork().iden)')
|
|
114
|
+
msgs = await core.stormlist('''
|
|
115
|
+
$query = "[inet:fqdn=vertex.link +#haha] $lib.print(woot)"
|
|
116
|
+
$opts = ({"view": $view})
|
|
117
|
+
for $mesg in $lib.storm.run($query, opts=$opts) {
|
|
118
|
+
if ($mesg.0 = "print") { $lib.print($mesg.1.mesg) }
|
|
119
|
+
}
|
|
120
|
+
''', opts={'vars': {'view': iden}})
|
|
121
|
+
self.stormIsInPrint('woot', msgs)
|
|
122
|
+
self.len(1, await core.nodes('inet:fqdn#haha', opts={'view': iden}))
|
|
123
|
+
|
|
124
|
+
visi = await core.auth.addUser('visi')
|
|
125
|
+
msgs = await core.stormlist('''
|
|
126
|
+
$opts=({"user": $lib.auth.users.byname(root).iden})
|
|
127
|
+
for $mesg in $lib.storm.run("$lib.print(lolz)", opts=$opts) {
|
|
128
|
+
if ($mesg.0 = "err") { $lib.print($mesg) }
|
|
129
|
+
if ($mesg.0 = "print") { $lib.print($mesg) }
|
|
130
|
+
}
|
|
131
|
+
''', opts={'user': visi.iden})
|
|
132
|
+
self.stormIsInErr('must have permission impersonate', msgs)
|
|
133
|
+
self.stormNotInPrint('lolz', msgs)
|
|
134
|
+
|
|
135
|
+
# no opts provided
|
|
136
|
+
msgs = await core.stormlist('''
|
|
137
|
+
$q = ${ $lib.print('hello') }
|
|
138
|
+
for $mesg in $lib.storm.run($q) {
|
|
139
|
+
if ( $mesg.0 = 'print' ) {
|
|
140
|
+
$lib.print(`mesg={$mesg.1.mesg}`)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
''')
|
|
144
|
+
self.stormIsInPrint('mesg=hello', msgs)
|
synapse/tests/test_model_inet.py
CHANGED
|
@@ -3300,3 +3300,34 @@ class InetModelTest(s_t_utils.SynTest):
|
|
|
3300
3300
|
self.eq(nodes[0].get('resource'), resource.ndef[1])
|
|
3301
3301
|
self.true(nodes[0].get('success'))
|
|
3302
3302
|
self.eq(nodes[0].get('time'), 1715856900000)
|
|
3303
|
+
|
|
3304
|
+
q = '''
|
|
3305
|
+
[ inet:service:message=(visi, says, relax)
|
|
3306
|
+
:title="Hehe Haha"
|
|
3307
|
+
:thread={[
|
|
3308
|
+
inet:service:thread=*
|
|
3309
|
+
:title="Woot Woot"
|
|
3310
|
+
:message=(visi, says, hello)
|
|
3311
|
+
:channel={[
|
|
3312
|
+
inet:service:channel=(synapse, subreddit)
|
|
3313
|
+
:name="/r/synapse"
|
|
3314
|
+
]}
|
|
3315
|
+
]}
|
|
3316
|
+
]
|
|
3317
|
+
'''
|
|
3318
|
+
nodes = await core.nodes(q)
|
|
3319
|
+
self.len(1, nodes)
|
|
3320
|
+
self.len(1, await core.nodes('inet:service:message=(visi, says, hello) -> inet:service:thread:message'))
|
|
3321
|
+
self.len(1, await core.nodes('''
|
|
3322
|
+
inet:service:message:title="hehe haha"
|
|
3323
|
+
:thread -> inet:service:thread
|
|
3324
|
+
+:title="woot woot"
|
|
3325
|
+
'''))
|
|
3326
|
+
self.len(2, await core.nodes('inet:service:thread -> inet:service:message'))
|
|
3327
|
+
|
|
3328
|
+
self.len(1, await core.nodes('''
|
|
3329
|
+
inet:service:message:title="hehe haha"
|
|
3330
|
+
:thread -> inet:service:thread
|
|
3331
|
+
:channel -> inet:service:channel
|
|
3332
|
+
+:name="/r/synapse"
|
|
3333
|
+
'''))
|
|
@@ -2,7 +2,7 @@ synapse/__init__.py,sha256=R2kOXlF5j-8m6G0JkHuN7rXRPg_tHLmbMxr__94mHQk,1145
|
|
|
2
2
|
synapse/axon.py,sha256=id-rsAHlExSg87yYW2bg4QlElOd7RSaGLZZBRgo-z2o,61121
|
|
3
3
|
synapse/cells.py,sha256=eNvdglfAoTURVhGOLGcgMXCGpfsIX1a02SQnyiklo3E,308
|
|
4
4
|
synapse/common.py,sha256=GmKrCHTrg6Ji2tvXQ8mfr93JxWXKxNd_t4PHTeqaQvY,36466
|
|
5
|
-
synapse/cortex.py,sha256=
|
|
5
|
+
synapse/cortex.py,sha256=Sa5L6Bt1Ssf2iLdiVjbIcWW_Nei6ygutaIWVzqjzC14,243868
|
|
6
6
|
synapse/cryotank.py,sha256=kOriVF8LnwYxgyTxQXSepyFRtSu2C6n9t_yImTV7ZNI,11714
|
|
7
7
|
synapse/daemon.py,sha256=-xy6EnmD5CodWQs_S-v7apKILECmn5EEYBpEPG-MDns,16986
|
|
8
8
|
synapse/datamodel.py,sha256=s3JgFXDCPCBPTr2S9hx83FYi-jYIyDD8w_Wlhqh9DvA,34270
|
|
@@ -85,7 +85,7 @@ synapse/data/jsonschemas/raw.githubusercontent.com/oasis-open/cti-stix2-json-sch
|
|
|
85
85
|
synapse/lib/__init__.py,sha256=qLS7nt8-Iot8jnD2Xss_6wZi5lJoyv2rqxF9kkektT0,129
|
|
86
86
|
synapse/lib/agenda.py,sha256=VvTBQcYi0ai8rW2W0Jzt_3X6f2QEyThKyxqgQwoU7Kk,33376
|
|
87
87
|
synapse/lib/aha.py,sha256=fT1Assn7j1YQFSr5IYuW1GNH2G19gSXwV7ajNS3mlLY,42392
|
|
88
|
-
synapse/lib/ast.py,sha256=
|
|
88
|
+
synapse/lib/ast.py,sha256=5V8jTMhitF2DhDfXG0tXOcGnOmBbZpGg7rxHkMMSZ4A,151744
|
|
89
89
|
synapse/lib/autodoc.py,sha256=CsGaX0tAKGh21YbIvUtvaUnZyqmsx6j-E9QD_vhKSP4,20747
|
|
90
90
|
synapse/lib/base.py,sha256=sTti-XzyQnoAwq0JvbDrjSu0_GqRT_J2eBxfNV8_ZrI,22520
|
|
91
91
|
synapse/lib/boss.py,sha256=rYu4jkHJ3Y5GLX23Hlrwe9H17LF27LZ0BkK_A_9Aqh0,2056
|
|
@@ -140,7 +140,7 @@ synapse/lib/slabseqn.py,sha256=xprAs6sdyeKKqI2POMa0tTyDgvR2JsHU94g7U02Ybyc,10275
|
|
|
140
140
|
synapse/lib/snap.py,sha256=-QW4qvHTa5HdTdy_uIKH9r7MfIklwjbenfPAqHy91HI,54340
|
|
141
141
|
synapse/lib/spooled.py,sha256=00x_RS1TiJkfuTXwwdUcYifuECGYgC8B1tX-sX7nb_k,5385
|
|
142
142
|
synapse/lib/storm.lark,sha256=KlzTs3-Gcv0eHfen8356Smn6XKBIpD_aH0uyogSZvv8,25604
|
|
143
|
-
synapse/lib/storm.py,sha256=
|
|
143
|
+
synapse/lib/storm.py,sha256=W39Bvi-yvrhb04I4xkx0ydKuD7G8PgGdTK31DDjewQY,209273
|
|
144
144
|
synapse/lib/storm_format.py,sha256=IySRTGUbCAsIhULY1VS1vxvAbLYUXMezPlPSCRJX4rU,4753
|
|
145
145
|
synapse/lib/stormctrl.py,sha256=XvyZ6M0Ew8sXsjGvRTWbXh0MjktZrGi_zQ9kNa7AWTE,285
|
|
146
146
|
synapse/lib/stormhttp.py,sha256=4um-9ovY8XJvxsyWZVI8psTPNg_p22AsNLstpS-7HrI,26898
|
|
@@ -156,7 +156,7 @@ synapse/lib/time.py,sha256=FKTYwpdvpuAj8p8sSodRjOxoA7Vu67CIbbXz55gtghk,9231
|
|
|
156
156
|
synapse/lib/trigger.py,sha256=BHTxE9DtVCvfK9bvNhrz_VHwG7ZJ7GlAJWKLrppgUvA,20703
|
|
157
157
|
synapse/lib/types.py,sha256=lekWp1t3tLlBAs9Su8wUiVv_6LBo2F1e56P8HhyoQzo,68988
|
|
158
158
|
synapse/lib/urlhelp.py,sha256=j-DvWGi-xH0TcO0NbCuwG7guUuiV8wxIxfMyJOzDygo,2523
|
|
159
|
-
synapse/lib/version.py,sha256=
|
|
159
|
+
synapse/lib/version.py,sha256=0zIu_mjwAPQQcIzRhbcM-gf7DmBdvQy3BSDE78LqMLU,7162
|
|
160
160
|
synapse/lib/view.py,sha256=CcOqYDraTFgQ8uxliq_7YoxFmNqo82LyrTIjrBaGsZs,57922
|
|
161
161
|
synapse/lib/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
162
162
|
synapse/lib/crypto/coin.py,sha256=_dhlkzIrHT8BvHdJOWK7PDThz3sK3dDRnWAUqjRpZJc,4910
|
|
@@ -208,7 +208,7 @@ synapse/lib/stormlib/smtp.py,sha256=CQCp7BR9GAXqdzpXm3Q49f9EV8UfJQqGCRQkdbxPQM8,
|
|
|
208
208
|
synapse/lib/stormlib/spooled.py,sha256=f-JZcZBngTlWQW732mPaZ7IVwPZ9M-e4xqS9wKSYo4U,4106
|
|
209
209
|
synapse/lib/stormlib/stats.py,sha256=I-oxv9Ig-ZUyZ2yQX9TowtFCYOqMRWjnaiF3ErOjIQc,8575
|
|
210
210
|
synapse/lib/stormlib/stix.py,sha256=XlSulY__hinh3lyIZfKfoUalGfqNpkG-SV_oyiJiYzc,52112
|
|
211
|
-
synapse/lib/stormlib/storm.py,sha256=
|
|
211
|
+
synapse/lib/stormlib/storm.py,sha256=dnPwH6p3DaOaKXfagqu-9szqr1wNzmCySDyzGJ77n74,6246
|
|
212
212
|
synapse/lib/stormlib/vault.py,sha256=OBXIs1TygBJ6mwEfbuuPIumbzFdmSGtupte4Uj85l5A,30556
|
|
213
213
|
synapse/lib/stormlib/version.py,sha256=FHWLsU6qy--iFfuN_2ZFDpwFzkqKL4b3ESLZ9ByUXak,2431
|
|
214
214
|
synapse/lib/stormlib/xml.py,sha256=yMlvVTJhsqdmzr5h49lr5bpeaQW_RRzgiynwRmyO3HU,3657
|
|
@@ -233,7 +233,7 @@ synapse/models/entity.py,sha256=vwjx5iVDpxdkGlII5GulgIHuDRX9kJIcO7Ge-XanQ58,415
|
|
|
233
233
|
synapse/models/files.py,sha256=csAxpubCifGfBcCKIqpmNlHnvm9FW9CfiYS0pPzSdEM,33032
|
|
234
234
|
synapse/models/geopol.py,sha256=GWn6a_bUr8HK4OtvY2BpoZAhtf9M7sUKEWjm8V-Er1s,11047
|
|
235
235
|
synapse/models/geospace.py,sha256=JIhH45AReWDMrl7lFivkF4Lo3K9dzqQvguoCdsVmPBg,19171
|
|
236
|
-
synapse/models/inet.py,sha256=
|
|
236
|
+
synapse/models/inet.py,sha256=fvyHr5UWduPGCbomUvqxj_3wzGsr3tyg1MVkfTzTZTc,167304
|
|
237
237
|
synapse/models/infotech.py,sha256=GW0DuwiiuJYrLMqMKJe9lNDU3D7H65SoyeJcDxQOVMk,146406
|
|
238
238
|
synapse/models/language.py,sha256=D2gyMrCQmKY_QjxN7OwJsCmh_pR9fjjZnxcKoJ9NItM,3430
|
|
239
239
|
synapse/models/material.py,sha256=d-nonZKyJpHc32ebghtkm5tSifwVFN_ctx2kb8N4NqI,3214
|
|
@@ -363,7 +363,7 @@ synapse/tests/test_lib_stormlib_smtp.py,sha256=FKC71JaLDdXJA04xxM1RGapXpufOS0bDc
|
|
|
363
363
|
synapse/tests/test_lib_stormlib_spooled.py,sha256=GJxziVDX0TNjk7CAvuVE1LKKbRdXT3_L-OuS_ZXbAlE,6608
|
|
364
364
|
synapse/tests/test_lib_stormlib_stats.py,sha256=zIaqhK6SWaKR6MOkevNZ-dSDVYBq8mwFRxhm9U_F0kg,9364
|
|
365
365
|
synapse/tests/test_lib_stormlib_stix.py,sha256=8apRT5Gy4KPGM3UZnf3JKCVq_lM3UYhemme6m1BY1yE,24166
|
|
366
|
-
synapse/tests/test_lib_stormlib_storm.py,sha256=
|
|
366
|
+
synapse/tests/test_lib_stormlib_storm.py,sha256=yJbxeBoncDB0QPpr_KqJ5K7nGQfoE6qSLm3AKdrSyYk,5423
|
|
367
367
|
synapse/tests/test_lib_stormlib_vault.py,sha256=JWCDmSoclZyTVzFdfAvjdLxq6eWIwTCw4n87SopqvXY,19314
|
|
368
368
|
synapse/tests/test_lib_stormlib_xml.py,sha256=dWa9NkXXE28VZ3bTmMDbddo7VpUKsSEHTS1ojJr-F90,3704
|
|
369
369
|
synapse/tests/test_lib_stormlib_yaml.py,sha256=egTVXk8wW31V2msF__9WxP3THcqfysG1mYhc7hQG8rw,1358
|
|
@@ -395,7 +395,7 @@ synapse/tests/test_model_geospace.py,sha256=HfICVBkVl7PCbxZK0vQsA_iVXRHGyS-7-5oI
|
|
|
395
395
|
synapse/tests/test_model_gov_cn.py,sha256=FnfKNM_wnvmScLm4cYFSQXZ21kVaTPPDusiCD79awBA,675
|
|
396
396
|
synapse/tests/test_model_gov_intl.py,sha256=v5BZhQnoMurzZYhM9hkzALzQzp92KidweYxVlghXDws,770
|
|
397
397
|
synapse/tests/test_model_gov_us.py,sha256=kvZ9DudBrbKtZmqGm8X-b_IOw4oJ7XZMnvTgiDkzsrY,1525
|
|
398
|
-
synapse/tests/test_model_inet.py,sha256=
|
|
398
|
+
synapse/tests/test_model_inet.py,sha256=0N6ay7ZhECmSm4dWI5xkX7TStP5vhda3Fk7VTjBWwgc,148688
|
|
399
399
|
synapse/tests/test_model_infotech.py,sha256=g0TLvnc2Em6TEEuNNtB5SmNrhySUGSpb56RmdlStbfE,106570
|
|
400
400
|
synapse/tests/test_model_language.py,sha256=LQFF-hya6WsGnkebC8FwguDvYn5t3sXSIDeCZ_coJ54,2883
|
|
401
401
|
synapse/tests/test_model_material.py,sha256=M7ACDCuMtavm-xtwAIZa1M-bHVq5PCUedDfR-Ty9_F4,1975
|
|
@@ -569,8 +569,8 @@ synapse/vendor/xrpl/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
569
569
|
synapse/vendor/xrpl/tests/test_codec.py,sha256=Zwq6A5uZUK_FWDL3BA932c5b-rL3hnC6efobWHSLC4o,6651
|
|
570
570
|
synapse/vendor/xrpl/tests/test_main.py,sha256=kZQwWk7I6HrP-PMvLdsUUN4POvWD9I-iXDHOwdeF090,4299
|
|
571
571
|
synapse/vendor/xrpl/tests/test_main_test_cases.py,sha256=vTlUM4hJD2Hd2wCIdd9rfsvcMZZZQmNHWdCTTFeGz2Y,4221
|
|
572
|
-
synapse-2.
|
|
573
|
-
synapse-2.
|
|
574
|
-
synapse-2.
|
|
575
|
-
synapse-2.
|
|
576
|
-
synapse-2.
|
|
572
|
+
synapse-2.176.0.dist-info/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
|
|
573
|
+
synapse-2.176.0.dist-info/METADATA,sha256=LO889iJ9KOnQej-qS_TAjIUDsJT3wMaFj-7WikslEnA,4921
|
|
574
|
+
synapse-2.176.0.dist-info/WHEEL,sha256=zivgDaFq68FBuh65fpIahlF7Z29HZDCl8zMEYMxNifI,93
|
|
575
|
+
synapse-2.176.0.dist-info/top_level.txt,sha256=v_1YsqjmoSCzCKs7oIhzTNmWtSYoORiBMv1TJkOhx8A,8
|
|
576
|
+
synapse-2.176.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|