synapse 2.216.0__py311-none-any.whl → 2.218.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.
- synapse/common.py +31 -0
- synapse/cortex.py +2 -1
- synapse/lib/storm.py +12 -0
- synapse/lib/stormtypes.py +23 -1
- synapse/lib/version.py +2 -2
- synapse/models/inet.py +17 -3
- synapse/models/orgs.py +4 -2
- synapse/tests/test_lib_storm.py +70 -5
- synapse/tests/test_model_inet.py +21 -0
- synapse/tests/test_model_infotech.py +14 -9
- synapse/tests/test_telepath.py +1 -2
- {synapse-2.216.0.dist-info → synapse-2.218.0.dist-info}/METADATA +2 -2
- {synapse-2.216.0.dist-info → synapse-2.218.0.dist-info}/RECORD +16 -16
- {synapse-2.216.0.dist-info → synapse-2.218.0.dist-info}/WHEEL +0 -0
- {synapse-2.216.0.dist-info → synapse-2.218.0.dist-info}/licenses/LICENSE +0 -0
- {synapse-2.216.0.dist-info → synapse-2.218.0.dist-info}/top_level.txt +0 -0
synapse/common.py
CHANGED
|
@@ -17,6 +17,7 @@ import decimal
|
|
|
17
17
|
import fnmatch
|
|
18
18
|
import hashlib
|
|
19
19
|
import logging
|
|
20
|
+
import tarfile
|
|
20
21
|
import binascii
|
|
21
22
|
import builtins
|
|
22
23
|
import tempfile
|
|
@@ -1189,8 +1190,38 @@ def _patch_tornado_json():
|
|
|
1189
1190
|
if hasattr(tornado.escape, 'json_decode'):
|
|
1190
1191
|
tornado.escape.json_decode = s_json.loads
|
|
1191
1192
|
|
|
1193
|
+
def _patch_tarfile_count():
|
|
1194
|
+
'''
|
|
1195
|
+
Patch tarfile block size reading from the cpython implementation if
|
|
1196
|
+
the interpreter has not been patched for CVE-2025-8194.
|
|
1197
|
+
See https://mail.python.org/archives/list/security-announce@python.org/thread/ZULLF3IZ726XP5EY7XJ7YIN3K5MDYR2D/
|
|
1198
|
+
'''
|
|
1199
|
+
if sys.version_info.major > 3:
|
|
1200
|
+
return
|
|
1201
|
+
|
|
1202
|
+
# Map of minor versions to micro versions which contain the patch
|
|
1203
|
+
min_patched_micros = {
|
|
1204
|
+
11: 14,
|
|
1205
|
+
12: 12,
|
|
1206
|
+
13: 6,
|
|
1207
|
+
}
|
|
1208
|
+
req_micro = min_patched_micros.get(sys.version_info.minor)
|
|
1209
|
+
if req_micro is None:
|
|
1210
|
+
return
|
|
1211
|
+
if sys.version_info.micro >= req_micro:
|
|
1212
|
+
return
|
|
1213
|
+
|
|
1214
|
+
def _block_patched(self, count):
|
|
1215
|
+
if count < 0: # pragma: no cover
|
|
1216
|
+
raise tarfile.InvalidHeaderError("invalid offset")
|
|
1217
|
+
return _block_patched._orig_block(self, count)
|
|
1218
|
+
|
|
1219
|
+
_block_patched._orig_block = tarfile.TarInfo._block
|
|
1220
|
+
tarfile.TarInfo._block = _block_patched
|
|
1221
|
+
|
|
1192
1222
|
_patch_http_cookies()
|
|
1193
1223
|
_patch_tornado_json()
|
|
1224
|
+
_patch_tarfile_count()
|
|
1194
1225
|
|
|
1195
1226
|
# TODO: Switch back to using asyncio.wait_for when we are using py 3.12+
|
|
1196
1227
|
# This is a workaround for a race where asyncio.wait_for can end up
|
synapse/cortex.py
CHANGED
|
@@ -5500,6 +5500,7 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
|
|
|
5500
5500
|
# TODO Remove the defaults in 3.0.0
|
|
5501
5501
|
csize = pdef.get('chunk:size', s_const.layer_pdef_csize)
|
|
5502
5502
|
qsize = pdef.get('queue:size', s_const.layer_pdef_qsize)
|
|
5503
|
+
soffs = pdef.get('offs', -1)
|
|
5503
5504
|
|
|
5504
5505
|
async with await s_base.Base.anit() as base:
|
|
5505
5506
|
|
|
@@ -5508,7 +5509,7 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
|
|
|
5508
5509
|
async def fill():
|
|
5509
5510
|
|
|
5510
5511
|
try:
|
|
5511
|
-
filloffs = await self.getStormVar(gvar,
|
|
5512
|
+
filloffs = await self.getStormVar(gvar, soffs)
|
|
5512
5513
|
async for item in layr0.syncNodeEdits(filloffs + 1, wait=True):
|
|
5513
5514
|
await queue.put(item)
|
|
5514
5515
|
await queue.close()
|
synapse/lib/storm.py
CHANGED
|
@@ -4906,6 +4906,9 @@ class ViewExecCmd(Cmd):
|
|
|
4906
4906
|
|
|
4907
4907
|
query = await runt.getStormQuery(text)
|
|
4908
4908
|
async with runt.getSubRuntime(query, opts=opts) as subr:
|
|
4909
|
+
await subr.enter_context(subr.snap.onWith('print', runt.snap.dist))
|
|
4910
|
+
await subr.enter_context(subr.snap.onWith('warn', runt.snap.dist))
|
|
4911
|
+
|
|
4909
4912
|
async for item in subr.execute():
|
|
4910
4913
|
await asyncio.sleep(0)
|
|
4911
4914
|
|
|
@@ -4918,6 +4921,9 @@ class ViewExecCmd(Cmd):
|
|
|
4918
4921
|
|
|
4919
4922
|
opts = {'view': view}
|
|
4920
4923
|
async with runt.getSubRuntime(query, opts=opts) as subr:
|
|
4924
|
+
await subr.enter_context(subr.snap.onWith('print', runt.snap.dist))
|
|
4925
|
+
await subr.enter_context(subr.snap.onWith('warn', runt.snap.dist))
|
|
4926
|
+
|
|
4921
4927
|
async for item in subr.execute():
|
|
4922
4928
|
await asyncio.sleep(0)
|
|
4923
4929
|
|
|
@@ -5736,6 +5742,9 @@ class RunAsCmd(Cmd):
|
|
|
5736
5742
|
opts = {'vars': path.vars}
|
|
5737
5743
|
|
|
5738
5744
|
async with await core.snap(user=user, view=runt.snap.view) as snap:
|
|
5745
|
+
await snap.enter_context(snap.onWith('warn', runt.snap.dist))
|
|
5746
|
+
await snap.enter_context(snap.onWith('print', runt.snap.dist))
|
|
5747
|
+
|
|
5739
5748
|
async with await Runtime.anit(query, snap, user=user, opts=opts, root=runt) as subr:
|
|
5740
5749
|
subr.debug = runt.debug
|
|
5741
5750
|
subr.readonly = runt.readonly
|
|
@@ -5758,6 +5767,9 @@ class RunAsCmd(Cmd):
|
|
|
5758
5767
|
opts = {'user': user}
|
|
5759
5768
|
|
|
5760
5769
|
async with await core.snap(user=user, view=runt.snap.view) as snap:
|
|
5770
|
+
await snap.enter_context(snap.onWith('warn', runt.snap.dist))
|
|
5771
|
+
await snap.enter_context(snap.onWith('print', runt.snap.dist))
|
|
5772
|
+
|
|
5761
5773
|
async with await Runtime.anit(query, snap, user=user, opts=opts, root=runt) as subr:
|
|
5762
5774
|
subr.debug = runt.debug
|
|
5763
5775
|
subr.readonly = runt.readonly
|
synapse/lib/stormtypes.py
CHANGED
|
@@ -3653,6 +3653,12 @@ class LibFeed(Lib):
|
|
|
3653
3653
|
{'name': 'data', 'type': 'prim', 'desc': 'Data to send to the ingest function.', },
|
|
3654
3654
|
),
|
|
3655
3655
|
'returns': {'type': 'null', }}},
|
|
3656
|
+
{'name': 'fromAxon', 'desc': 'Load a syn.nodes formatted export from axon.',
|
|
3657
|
+
'type': {'type': 'function', '_funcname': '_fromAxon',
|
|
3658
|
+
'args': (
|
|
3659
|
+
{'name': 'sha256', 'type': 'str', 'desc': 'The sha256 of the file stored in the axon.', },
|
|
3660
|
+
),
|
|
3661
|
+
'returns': {'type': 'int', 'desc': 'The number of nodes loaded.', }}},
|
|
3656
3662
|
)
|
|
3657
3663
|
_storm_lib_path = ('feed',)
|
|
3658
3664
|
|
|
@@ -7677,7 +7683,23 @@ class Layer(Prim):
|
|
|
7677
7683
|
|
|
7678
7684
|
@stormfunc(readonly=True)
|
|
7679
7685
|
async def _methLayerGet(self, name, defv=None):
|
|
7680
|
-
|
|
7686
|
+
match name:
|
|
7687
|
+
case 'pushs':
|
|
7688
|
+
pushs = copy.deepcopy(self.valu.get('pushs', {}))
|
|
7689
|
+
for iden, pdef in pushs.items():
|
|
7690
|
+
gvar = f'push:{iden}'
|
|
7691
|
+
pdef['offs'] = await self.runt.snap.core.getStormVar(gvar, 0)
|
|
7692
|
+
return pushs
|
|
7693
|
+
|
|
7694
|
+
case 'pulls':
|
|
7695
|
+
pulls = copy.deepcopy(self.valu.get('pulls', {}))
|
|
7696
|
+
for iden, pdef in pulls.items():
|
|
7697
|
+
gvar = f'pull:{iden}'
|
|
7698
|
+
pdef['offs'] = await self.runt.snap.core.getStormVar(gvar, 0)
|
|
7699
|
+
return pulls
|
|
7700
|
+
|
|
7701
|
+
case _:
|
|
7702
|
+
return self.valu.get(name, defv)
|
|
7681
7703
|
|
|
7682
7704
|
async def _methLayerSet(self, name, valu):
|
|
7683
7705
|
name = await tostr(name)
|
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, 218, 0)
|
|
227
227
|
verstring = '.'.join([str(x) for x in version])
|
|
228
|
-
commit = '
|
|
228
|
+
commit = '69efe6d3b57074a6141c75bccafaf8521838dee2'
|
synapse/models/inet.py
CHANGED
|
@@ -108,6 +108,10 @@ def getAddrScope(ipv6):
|
|
|
108
108
|
|
|
109
109
|
class Addr(s_types.Str):
|
|
110
110
|
|
|
111
|
+
protos = ('tcp', 'udp', 'icmp', 'host', 'gre')
|
|
112
|
+
# TODO: this should include icmp and host but requires a migration
|
|
113
|
+
noports = ('gre',)
|
|
114
|
+
|
|
111
115
|
def postTypeInit(self):
|
|
112
116
|
s_types.Str.postTypeInit(self)
|
|
113
117
|
self.setNormFunc(str, self._normPyStr)
|
|
@@ -140,9 +144,11 @@ class Addr(s_types.Str):
|
|
|
140
144
|
if len(parts) == 2:
|
|
141
145
|
proto, valu = parts
|
|
142
146
|
|
|
143
|
-
if proto not in
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
if proto not in self.protos:
|
|
148
|
+
protostr = ','.join(self.protos)
|
|
149
|
+
mesg = f'inet:addr protocol must be one of: {protostr}'
|
|
150
|
+
raise s_exc.BadTypeValu(mesg=mesg, valu=orig, name=self.name)
|
|
151
|
+
|
|
146
152
|
subs['proto'] = proto
|
|
147
153
|
|
|
148
154
|
valu = valu.strip().strip('/')
|
|
@@ -181,6 +187,10 @@ class Addr(s_types.Str):
|
|
|
181
187
|
subs['port'] = port
|
|
182
188
|
portstr = f':{port}'
|
|
183
189
|
|
|
190
|
+
if port and proto in self.noports:
|
|
191
|
+
mesg = f'Protocol {proto} does not allow specifying ports.'
|
|
192
|
+
raise s_exc.BadTypeValu(mesg=mesg, valu=orig)
|
|
193
|
+
|
|
184
194
|
return f'{proto}://[{ipv6}]{portstr}', {'subs': subs}
|
|
185
195
|
|
|
186
196
|
mesg = f'Invalid IPv6 w/port ({orig})'
|
|
@@ -196,6 +206,10 @@ class Addr(s_types.Str):
|
|
|
196
206
|
if port:
|
|
197
207
|
subs['port'] = port
|
|
198
208
|
|
|
209
|
+
if port and proto in self.noports:
|
|
210
|
+
mesg = f'Protocol {proto} does not allow specifying ports.'
|
|
211
|
+
raise s_exc.BadTypeValu(mesg=mesg, valu=orig)
|
|
212
|
+
|
|
199
213
|
ipv4 = self.modl.type('inet:ipv4').norm(valu)[0]
|
|
200
214
|
ipv4_repr = self.modl.type('inet:ipv4').repr(ipv4)
|
|
201
215
|
subs['ipv4'] = ipv4
|
synapse/models/orgs.py
CHANGED
|
@@ -292,11 +292,13 @@ class OuModule(s_module.CoreModule):
|
|
|
292
292
|
'doc': 'An organization enacting a document.'}),
|
|
293
293
|
|
|
294
294
|
('ou:requirement:type:taxonomy', ('taxonomy', {}), {
|
|
295
|
+
'deprecated': True,
|
|
295
296
|
'interfaces': ('meta:taxonomy',),
|
|
296
|
-
'doc': '
|
|
297
|
+
'doc': 'Deprecated. Please use doc:requirement and ou:enacted.'}),
|
|
297
298
|
|
|
298
299
|
('ou:requirement', ('guid', {}), {
|
|
299
|
-
'
|
|
300
|
+
'deprecated': True,
|
|
301
|
+
'doc': 'Deprecated. Please use doc:requirement and ou:enacted.'}),
|
|
300
302
|
|
|
301
303
|
),
|
|
302
304
|
'edges': (
|
synapse/tests/test_lib_storm.py
CHANGED
|
@@ -4113,6 +4113,29 @@ class StormTest(s_t_utils.SynTest):
|
|
|
4113
4113
|
view = await core.callStorm('return( $lib.view.get().iden )')
|
|
4114
4114
|
fork = await core.callStorm('return( $lib.view.get().fork().iden )')
|
|
4115
4115
|
|
|
4116
|
+
q = '''view.exec $view {
|
|
4117
|
+
$lib.print(foo)
|
|
4118
|
+
$lib.warn(bar)
|
|
4119
|
+
[ it:dev:str=nomsg ]
|
|
4120
|
+
}'''
|
|
4121
|
+
msgs = await core.stormlist(q, opts={'view': fork, 'vars': {'view': view}})
|
|
4122
|
+
self.stormIsInPrint('foo', msgs)
|
|
4123
|
+
self.stormIsInWarn('bar', msgs)
|
|
4124
|
+
|
|
4125
|
+
q = '''
|
|
4126
|
+
[ it:dev:str=woot ] $valu=$node.repr()
|
|
4127
|
+
view.exec $view {
|
|
4128
|
+
$lib.print(foo)
|
|
4129
|
+
$lib.print($valu)
|
|
4130
|
+
$lib.warn(bar)
|
|
4131
|
+
[ it:dev:str=nomsg ]
|
|
4132
|
+
}
|
|
4133
|
+
'''
|
|
4134
|
+
msgs = await core.stormlist(q, opts={'view': fork, 'vars': {'view': view}})
|
|
4135
|
+
self.stormIsInPrint('foo', msgs)
|
|
4136
|
+
self.stormIsInPrint('woot', msgs)
|
|
4137
|
+
self.stormIsInWarn('bar', msgs)
|
|
4138
|
+
|
|
4116
4139
|
await core.addStormPkg({
|
|
4117
4140
|
'name': 'testpkg',
|
|
4118
4141
|
'version': (0, 0, 1),
|
|
@@ -4805,16 +4828,19 @@ class StormTest(s_t_utils.SynTest):
|
|
|
4805
4828
|
view1, layr1 = await core.callStorm('$view = $lib.view.get().fork() return(($view.iden, $view.layers.0.iden))')
|
|
4806
4829
|
view2, layr2 = await core.callStorm('$view = $lib.view.get().fork() return(($view.iden, $view.layers.0.iden))')
|
|
4807
4830
|
view3, layr3 = await core.callStorm('$view = $lib.view.get().fork() return(($view.iden, $view.layers.0.iden))')
|
|
4831
|
+
view4, layr4 = await core.callStorm('$view = $lib.view.get().fork() return(($view.iden, $view.layers.0.iden))')
|
|
4808
4832
|
|
|
4809
4833
|
opts = {'vars': {
|
|
4810
4834
|
'view0': view0,
|
|
4811
4835
|
'view1': view1,
|
|
4812
4836
|
'view2': view2,
|
|
4813
4837
|
'view3': view3,
|
|
4838
|
+
'view4': view4,
|
|
4814
4839
|
'layr0': layr0,
|
|
4815
4840
|
'layr1': layr1,
|
|
4816
4841
|
'layr2': layr2,
|
|
4817
4842
|
'layr3': layr3,
|
|
4843
|
+
'layr4': layr4,
|
|
4818
4844
|
}}
|
|
4819
4845
|
|
|
4820
4846
|
# lets get some auth denies...
|
|
@@ -4867,13 +4893,26 @@ class StormTest(s_t_utils.SynTest):
|
|
|
4867
4893
|
self.len(3, await core.nodes('ps:contact', opts={'view': view1}))
|
|
4868
4894
|
self.len(3, await core.nodes('ps:contact', opts={'view': view2}))
|
|
4869
4895
|
|
|
4870
|
-
# Check offset reporting
|
|
4896
|
+
# Check offset reporting from pack()
|
|
4871
4897
|
q = '$layer=$lib.layer.get($layr0) return ($layer.pack())'
|
|
4872
4898
|
layrinfo = await core.callStorm(q, opts=opts)
|
|
4873
4899
|
pushs = layrinfo.get('pushs')
|
|
4874
4900
|
self.len(1, pushs)
|
|
4875
4901
|
pdef = list(pushs.values())[0]
|
|
4876
|
-
|
|
4902
|
+
eoffs = pdef.get('offs', 0)
|
|
4903
|
+
self.lt(10, eoffs)
|
|
4904
|
+
|
|
4905
|
+
# check offset reporting from list()
|
|
4906
|
+
msgs = await core.stormlist('layer.push.list $layr0', opts=opts)
|
|
4907
|
+
self.stormIsInPrint(f'{eoffs}', msgs)
|
|
4908
|
+
|
|
4909
|
+
# Pull from layr0 using a custom offset (skip first node)
|
|
4910
|
+
await core.callStorm(f'$lib.layer.get($layr0).addPush("tcp://root:secret@127.0.0.1:{port}/*/layer/{layr4}", offs={offs})', opts=opts)
|
|
4911
|
+
await core.layers.get(layr4).waitEditOffs(offs, timeout=3)
|
|
4912
|
+
self.len(2, await core.nodes('ps:contact', opts={'view': view4}))
|
|
4913
|
+
|
|
4914
|
+
# Clean up
|
|
4915
|
+
self.none(await core.callStorm('$lib.layer.get($layr0).delPush($layr4)', opts=opts))
|
|
4877
4916
|
|
|
4878
4917
|
q = '$layer=$lib.layer.get($layr2) return ($layer.pack())'
|
|
4879
4918
|
layrinfo = await core.callStorm(q, opts=opts)
|
|
@@ -4914,7 +4953,7 @@ class StormTest(s_t_utils.SynTest):
|
|
|
4914
4953
|
}
|
|
4915
4954
|
}
|
|
4916
4955
|
''')
|
|
4917
|
-
self.eq(actv -
|
|
4956
|
+
self.eq(actv - 3, len(core.activecoros))
|
|
4918
4957
|
tasks = await core.callStorm('return($lib.ps.list())')
|
|
4919
4958
|
self.len(0, [t for t in tasks if t.get('name').startswith('layer pull:')])
|
|
4920
4959
|
self.len(0, [t for t in tasks if t.get('name').startswith('layer push:')])
|
|
@@ -4984,7 +5023,7 @@ class StormTest(s_t_utils.SynTest):
|
|
|
4984
5023
|
tasks = await core.callStorm('return($lib.ps.list())')
|
|
4985
5024
|
self.len(1, [t for t in tasks if t.get('name').startswith('layer pull:')])
|
|
4986
5025
|
self.len(1, [t for t in tasks if t.get('name').startswith('layer push:')])
|
|
4987
|
-
self.eq(actv, len(core.activecoros))
|
|
5026
|
+
self.eq(actv - 1, len(core.activecoros))
|
|
4988
5027
|
|
|
4989
5028
|
pushpulls = set()
|
|
4990
5029
|
for ldef in await core.getLayerDefs():
|
|
@@ -5009,7 +5048,7 @@ class StormTest(s_t_utils.SynTest):
|
|
|
5009
5048
|
tasks = await core.callStorm('return($lib.ps.list())')
|
|
5010
5049
|
self.len(0, [t for t in tasks if t.get('name').startswith('layer pull:')])
|
|
5011
5050
|
self.len(0, [t for t in tasks if t.get('name').startswith('layer push:')])
|
|
5012
|
-
self.eq(actv -
|
|
5051
|
+
self.eq(actv - 3, len(core.activecoros))
|
|
5013
5052
|
|
|
5014
5053
|
with self.raises(s_exc.SchemaViolation):
|
|
5015
5054
|
await core.addLayrPush('newp', {})
|
|
@@ -5354,6 +5393,32 @@ class StormTest(s_t_utils.SynTest):
|
|
|
5354
5393
|
for node in nodes:
|
|
5355
5394
|
self.none(node.tags.get('btag'))
|
|
5356
5395
|
|
|
5396
|
+
q = '''runas visi {
|
|
5397
|
+
$lib.print(foo)
|
|
5398
|
+
$lib.warn(bar)
|
|
5399
|
+
[ it:dev:str=nomsg ]
|
|
5400
|
+
}'''
|
|
5401
|
+
msgs = await core.stormlist(q)
|
|
5402
|
+
self.stormIsInPrint('foo', msgs)
|
|
5403
|
+
self.stormIsInWarn('bar', msgs)
|
|
5404
|
+
|
|
5405
|
+
q = '''
|
|
5406
|
+
[it:dev:str=woot] $valu=$node.repr()
|
|
5407
|
+
runas visi {
|
|
5408
|
+
$lib.print(foo)
|
|
5409
|
+
$lib.warn(bar)
|
|
5410
|
+
$lib.print($valu)
|
|
5411
|
+
[ it:dev:str=nomsg ]
|
|
5412
|
+
}
|
|
5413
|
+
'''
|
|
5414
|
+
msgs = await core.stormlist(q)
|
|
5415
|
+
self.stormIsInPrint('foo', msgs)
|
|
5416
|
+
self.stormIsInPrint('woot', msgs)
|
|
5417
|
+
self.stormIsInWarn('bar', msgs)
|
|
5418
|
+
|
|
5419
|
+
msgs = await core.stormlist('runas visi {$lib.raise(Foo, asdf)}')
|
|
5420
|
+
self.stormIsInErr('asdf', msgs)
|
|
5421
|
+
|
|
5357
5422
|
async def test_storm_batch(self):
|
|
5358
5423
|
async with self.getTestCore() as core:
|
|
5359
5424
|
q = '''
|
synapse/tests/test_model_inet.py
CHANGED
|
@@ -1363,6 +1363,27 @@ class InetModelTest(s_t_utils.SynTest):
|
|
|
1363
1363
|
for p, v in props.items():
|
|
1364
1364
|
self.eq(node.get(p), v)
|
|
1365
1365
|
|
|
1366
|
+
nodes = await core.nodes('[ inet:server=gre://::1 ]')
|
|
1367
|
+
self.eq(nodes[0].get('proto'), 'gre')
|
|
1368
|
+
|
|
1369
|
+
nodes = await core.nodes('[ inet:server=gre://1.2.3.4 ]')
|
|
1370
|
+
self.eq(nodes[0].get('proto'), 'gre')
|
|
1371
|
+
|
|
1372
|
+
with self.raises(s_exc.BadTypeValu) as ctx:
|
|
1373
|
+
await core.nodes('[ inet:server=gre://1.2.3.4:99 ]')
|
|
1374
|
+
|
|
1375
|
+
self.eq(ctx.exception.get('mesg'), 'Protocol gre does not allow specifying ports.')
|
|
1376
|
+
|
|
1377
|
+
with self.raises(s_exc.BadTypeValu) as ctx:
|
|
1378
|
+
await core.nodes('[ inet:server="gre://[::1]:99" ]')
|
|
1379
|
+
|
|
1380
|
+
self.eq(ctx.exception.get('mesg'), 'Protocol gre does not allow specifying ports.')
|
|
1381
|
+
|
|
1382
|
+
with self.raises(s_exc.BadTypeValu) as ctx:
|
|
1383
|
+
await core.nodes('[ inet:server=newp://1.2.3.4:99 ]')
|
|
1384
|
+
|
|
1385
|
+
self.eq(ctx.exception.get('mesg'), 'inet:addr protocol must be one of: tcp,udp,icmp,host,gre')
|
|
1386
|
+
|
|
1366
1387
|
async def test_servfile(self):
|
|
1367
1388
|
async with self.getTestCore() as core:
|
|
1368
1389
|
valu = ('tcp://127.0.0.1:4040', 64 * 'f')
|
|
@@ -1953,6 +1953,12 @@ class InfotechModelTest(s_t_utils.SynTest):
|
|
|
1953
1953
|
self.len(1, nodes)
|
|
1954
1954
|
self.eq(nodes[0].get('product'), 'product%23')
|
|
1955
1955
|
|
|
1956
|
+
async def test_infotech_cpe_conversions(self):
|
|
1957
|
+
self.thisEnvMust('CIRCLECI')
|
|
1958
|
+
|
|
1959
|
+
async with self.getTestCore() as core:
|
|
1960
|
+
cpe23 = core.model.type('it:sec:cpe')
|
|
1961
|
+
cpe22 = core.model.type('it:sec:cpe:v2_2')
|
|
1956
1962
|
# Test 2.2->2.3 and 2.3->2.2 conversions
|
|
1957
1963
|
filename = s_t_files.getAssetPath('cpedata.json')
|
|
1958
1964
|
with open(filename, 'r') as fp:
|
|
@@ -1960,25 +1966,24 @@ class InfotechModelTest(s_t_utils.SynTest):
|
|
|
1960
1966
|
|
|
1961
1967
|
for (_cpe22, _cpe23) in cpedata:
|
|
1962
1968
|
# Convert cpe22 -> cpe23
|
|
1963
|
-
|
|
1964
|
-
self.eq(
|
|
1969
|
+
norm_22, _ = cpe23.norm(_cpe22)
|
|
1970
|
+
self.eq(norm_22, _cpe23)
|
|
1965
1971
|
|
|
1966
|
-
|
|
1967
|
-
self.eq(
|
|
1972
|
+
norm_23, info_23 = cpe23.norm(_cpe23)
|
|
1973
|
+
self.eq(norm_23, _cpe23)
|
|
1968
1974
|
|
|
1969
1975
|
# No escaped characters in the secondary props
|
|
1970
|
-
for name, valu in
|
|
1976
|
+
for name, valu in info_23.items():
|
|
1971
1977
|
if name == 'v2_2':
|
|
1972
1978
|
continue
|
|
1973
1979
|
|
|
1974
1980
|
self.notin('\\', valu)
|
|
1975
1981
|
|
|
1976
1982
|
# Norm cpe23 and check the cpe22 conversion
|
|
1977
|
-
|
|
1978
|
-
v2_2 = info['subs']['v2_2']
|
|
1983
|
+
sub_23_v2_2 = info_23['subs']['v2_2']
|
|
1979
1984
|
|
|
1980
|
-
|
|
1981
|
-
self.eq(
|
|
1985
|
+
norm_sub_23_v2_2, _ = cpe22.norm(sub_23_v2_2)
|
|
1986
|
+
self.eq(norm_sub_23_v2_2, sub_23_v2_2)
|
|
1982
1987
|
|
|
1983
1988
|
async def test_cpe_scrape_one_to_one(self):
|
|
1984
1989
|
|
synapse/tests/test_telepath.py
CHANGED
|
@@ -862,8 +862,7 @@ class TeleTest(s_t_utils.SynTest):
|
|
|
862
862
|
self.isin('Cell path does not exist', cm.exception.get('mesg'))
|
|
863
863
|
|
|
864
864
|
async def test_ipv6(self):
|
|
865
|
-
|
|
866
|
-
self.skip('ipv6 listener is not supported in circleci')
|
|
865
|
+
self.thisEnvMustNot('CIRCLECI') # ipv6 listener not supported in circleci
|
|
867
866
|
|
|
868
867
|
foo = Foo()
|
|
869
868
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synapse
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.218.0
|
|
4
4
|
Summary: Synapse Intelligence Analysis Framework
|
|
5
5
|
Author-email: The Vertex Project LLC <root@vertex.link>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -22,7 +22,7 @@ Requires-Dist: pyOpenSSL<24.3.0,>=24.0.0
|
|
|
22
22
|
Requires-Dist: cryptography<44.0.0,>=43.0.1
|
|
23
23
|
Requires-Dist: msgpack<1.2.0,>=1.0.5
|
|
24
24
|
Requires-Dist: xxhash<3.6.0,>=1.4.4
|
|
25
|
-
Requires-Dist: lmdb<1.
|
|
25
|
+
Requires-Dist: lmdb<1.8.0,>=1.7.0
|
|
26
26
|
Requires-Dist: tornado<7.0.0,>=6.2.0
|
|
27
27
|
Requires-Dist: regex>=2022.9.11
|
|
28
28
|
Requires-Dist: PyYAML<6.1.0,>=5.4
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
synapse/__init__.py,sha256=R2kOXlF5j-8m6G0JkHuN7rXRPg_tHLmbMxr__94mHQk,1145
|
|
2
2
|
synapse/axon.py,sha256=HtKPfSDNt3ltOaQC2P_7satXhgdxf7fO2mGAioF78Iw,66029
|
|
3
3
|
synapse/cells.py,sha256=eNvdglfAoTURVhGOLGcgMXCGpfsIX1a02SQnyiklo3E,308
|
|
4
|
-
synapse/common.py,sha256=
|
|
5
|
-
synapse/cortex.py,sha256=
|
|
4
|
+
synapse/common.py,sha256=j8b3lrZ7O-utkjJswSf_kx1nySmKRTCNsk6I8bfNPGA,37880
|
|
5
|
+
synapse/cortex.py,sha256=rfmP41UpdwK7JsMJ5TBLf4hmbzZCdnr3JJHU6SQ78HY,264192
|
|
6
6
|
synapse/cryotank.py,sha256=2-MzdTZ1AofkBp2ew3ZrZLo33rHRtNVTlr4YlXEfdrc,12130
|
|
7
7
|
synapse/daemon.py,sha256=Fpj99h0ocDl-SlXtjV9HTrKvd2WxwG10KG4Kwfl1xL4,17113
|
|
8
8
|
synapse/datamodel.py,sha256=Lc8PF4tapY6leXv35M1UZHNQ3nDLxEWbfwS4crGNTV0,40347
|
|
@@ -142,12 +142,12 @@ synapse/lib/slabseqn.py,sha256=LJ2SZEsZlROBAD3mdS-3JxNVVPXXkBW8GIJXsW0OGG8,10287
|
|
|
142
142
|
synapse/lib/snap.py,sha256=nuH6zl4cSCQ3Medo3GSbwe_x9Almle5xnl9WJc434yI,64360
|
|
143
143
|
synapse/lib/spooled.py,sha256=BQHIW-qZvEcvhEf8PpXhbDDGzq1go4TH63D6kn-1anM,6021
|
|
144
144
|
synapse/lib/storm.lark,sha256=8RxsM4xYhBpJbGpS2Yfft74eQyvFvD0FbSbaSkLcL20,27412
|
|
145
|
-
synapse/lib/storm.py,sha256=
|
|
145
|
+
synapse/lib/storm.py,sha256=Q2LAVwQpS-FF1S6_NGlQdkjcdDgqg2g3DtgD7-JPllY,206218
|
|
146
146
|
synapse/lib/storm_format.py,sha256=9cE8WNPYTcqgRakIqkmIQzOr16Hqbj_sM1QabHug3i0,4908
|
|
147
147
|
synapse/lib/stormctrl.py,sha256=3UC2LOHClC17JwYNuo8NeyntuAvIXphjenXEzVP33mY,2523
|
|
148
148
|
synapse/lib/stormhttp.py,sha256=3BdaZM6wC3iuYc4ryxtroyTdGhGhei40EoKiH4qSwIE,28877
|
|
149
149
|
synapse/lib/stormsvc.py,sha256=FURIsQUVNJmY8Z5TmhTF1O__DGXPiVg5pUiOoPM8r3g,7573
|
|
150
|
-
synapse/lib/stormtypes.py,sha256=
|
|
150
|
+
synapse/lib/stormtypes.py,sha256=uqeeNirO8DLl-tSsTP3ODJwUzABV6qIQ0wrtL61SXWQ,403616
|
|
151
151
|
synapse/lib/stormwhois.py,sha256=w7N2oCyMljNvi_sRt_bZb5BJwWwYkVGcRd7H_0oHY8Q,2554
|
|
152
152
|
synapse/lib/structlog.py,sha256=v5MK5jtJIRSF-E4y4fQuzEVKmbocu8ByFLDTY8Ybjpk,1336
|
|
153
153
|
synapse/lib/task.py,sha256=LVVM7Yr0VPUihIH6N_CrMHm3GHZR3bu-dw05SkG8zFE,6267
|
|
@@ -158,7 +158,7 @@ synapse/lib/time.py,sha256=bk_1F6_MDuCWJ1ToPJ-XHkeTWVw5b4SE7cCixBqVxXo,9435
|
|
|
158
158
|
synapse/lib/trigger.py,sha256=mnfkoBHB88JfqPoxb5oflvAaBKZpNvYdxP247YS53fE,20697
|
|
159
159
|
synapse/lib/types.py,sha256=0ILS8netSELraSJu1YfPyQf3P-bVbevYkVzSC-WigsU,70917
|
|
160
160
|
synapse/lib/urlhelp.py,sha256=ljhnF91z9ihyOLdZZ6OoQYCN1WYjOj1imukD45xiKU0,3320
|
|
161
|
-
synapse/lib/version.py,sha256=
|
|
161
|
+
synapse/lib/version.py,sha256=1ClnZCV3xJ3KkOhbFLOcUmSvj_GWPhIDmzmLlvQPL9g,7162
|
|
162
162
|
synapse/lib/view.py,sha256=9PZTDSkw002hiCF2gYIBMSUB3uRSht5UJBgFUxnh-D4,62989
|
|
163
163
|
synapse/lib/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
164
|
synapse/lib/crypto/coin.py,sha256=_dhlkzIrHT8BvHdJOWK7PDThz3sK3dDRnWAUqjRpZJc,4910
|
|
@@ -239,13 +239,13 @@ synapse/models/entity.py,sha256=loHKByGwv2xyz6cYWWUpwk12mxWNzC06BKgDgWfX6ek,1617
|
|
|
239
239
|
synapse/models/files.py,sha256=4nA0LGK2gKEjErzTnFfIX7kxNn8c_C7xWAfiwWFz5zY,34396
|
|
240
240
|
synapse/models/geopol.py,sha256=1DGxLJ60QlnSIe3WxxViYQ3KFSwm89vvGc534bbSNBo,11304
|
|
241
241
|
synapse/models/geospace.py,sha256=Ix54xGdGRZNqLI0r6r9OA1t6vqB3XM1lkoy86Vjt5XA,21155
|
|
242
|
-
synapse/models/inet.py,sha256=
|
|
242
|
+
synapse/models/inet.py,sha256=IZp-32QuHfi7u4MDrP7K-0gGQ5xNVTvDesbT_Y0J_kM,181666
|
|
243
243
|
synapse/models/infotech.py,sha256=IfxcD3Ap9W4jrBGkI55kej6UOdnTE2ZL3dH4R9f3MbI,155406
|
|
244
244
|
synapse/models/language.py,sha256=hBVVIf5kc_FSIV7HZhWnberoc9ssxuqeff4fqC9iz4o,3640
|
|
245
245
|
synapse/models/material.py,sha256=UvmnBEkbhBbdbnvWtTlgGJAJlKDrx9E-YSQ3K49ws5M,5405
|
|
246
246
|
synapse/models/math.py,sha256=5zDLSwGbOcWI6T5-KspPL20sR8Bcs59pnRK2nEELzss,1775
|
|
247
247
|
synapse/models/media.py,sha256=wdXNzLrHb4YYRZ3NlGombNwZsphwfH20oZQQ9ICq7ZQ,3604
|
|
248
|
-
synapse/models/orgs.py,sha256=
|
|
248
|
+
synapse/models/orgs.py,sha256=mip4C0vIy56zkyCLpCTF7U4IJH1snQq-UV533llOlOE,71623
|
|
249
249
|
synapse/models/person.py,sha256=HiZy_zT0Q1AoeXbpogEJWuJe436bOo_Ai4kkmA9c2ZU,28568
|
|
250
250
|
synapse/models/planning.py,sha256=vmrY4d3WRxizrNU1YBe36NGZTuuu4lhGS8KI5lCZ5yQ,7302
|
|
251
251
|
synapse/models/proj.py,sha256=vl-2uZouiWSey8t4lTNA4BxUKhX94rqm3SuLrodQUP8,9904
|
|
@@ -334,7 +334,7 @@ synapse/tests/test_lib_slaboffs.py,sha256=FHQ8mGZ27dGqVwGk6q2UJ4gkPRZN22eIVzS8hM
|
|
|
334
334
|
synapse/tests/test_lib_slabseqn.py,sha256=74V6jU7DRTsy_hqUFDuT4C6dPlJ6ObNnjmI9qhbbyVc,5230
|
|
335
335
|
synapse/tests/test_lib_snap.py,sha256=OviJtj9N5LhBV-56TySkWvRly7f8VH9d-VBcNFLAtmg,27805
|
|
336
336
|
synapse/tests/test_lib_spooled.py,sha256=Ki9UnzTPUtw7devwN_M0a8uwOst81fGQtGSVqSSh1u8,4002
|
|
337
|
-
synapse/tests/test_lib_storm.py,sha256=
|
|
337
|
+
synapse/tests/test_lib_storm.py,sha256=Hl5j3vjLtxXRLFMqqNevqXgnIke32MA2MT3hrjfAOnE,254425
|
|
338
338
|
synapse/tests/test_lib_storm_format.py,sha256=tEZgQMmKAeG8FQZE5HUjOT7bnKawVTpNaVQh_3Wa630,277
|
|
339
339
|
synapse/tests/test_lib_stormctrl.py,sha256=1vY7PGjgmz3AibgSiGcp_G4NSYl9YNifWdjPB0CDf1g,2877
|
|
340
340
|
synapse/tests/test_lib_stormhttp.py,sha256=rhZ9xLTIzLm4GlJUFDieFqAcrhE0EFTDi2erGltPm0I,46056
|
|
@@ -408,8 +408,8 @@ synapse/tests/test_model_geospace.py,sha256=8ATsx662mrcKzurMpQGbshnQPYOWqO7wxOWp
|
|
|
408
408
|
synapse/tests/test_model_gov_cn.py,sha256=FnfKNM_wnvmScLm4cYFSQXZ21kVaTPPDusiCD79awBA,675
|
|
409
409
|
synapse/tests/test_model_gov_intl.py,sha256=mHYK056C2R0aDH-5-TnUxtH0ZlKnEOoSd9ODIMasmow,780
|
|
410
410
|
synapse/tests/test_model_gov_us.py,sha256=kvZ9DudBrbKtZmqGm8X-b_IOw4oJ7XZMnvTgiDkzsrY,1525
|
|
411
|
-
synapse/tests/test_model_inet.py,sha256=
|
|
412
|
-
synapse/tests/test_model_infotech.py,sha256=
|
|
411
|
+
synapse/tests/test_model_inet.py,sha256=svw0v3_yYNpRppQGhLNwWCiHohtgvJMX8CECuqIhuMg,160698
|
|
412
|
+
synapse/tests/test_model_infotech.py,sha256=Haf6au6ZX97cZF5x4fm5c5vbQDuloWRHkTvVYu-CPJ8,115679
|
|
413
413
|
synapse/tests/test_model_language.py,sha256=49stF1B8_EwWJB67Xa5VXCG563Zfbr6S85iKN9Iom48,3046
|
|
414
414
|
synapse/tests/test_model_material.py,sha256=Hkd8BJh6FdQE0RuFMV2NO6fGqw9kOCb5AeIuTYtwCEM,2723
|
|
415
415
|
synapse/tests/test_model_math.py,sha256=x-rHBfm-59ueZdHXXzSi53eshldvVURoJeLeexWTL2U,826
|
|
@@ -428,7 +428,7 @@ synapse/tests/test_servers_cortex.py,sha256=2td41cPfC5-hJ1C6sH5NsN-ixjfXPCpnPllP
|
|
|
428
428
|
synapse/tests/test_servers_cryotank.py,sha256=vDxTcF4mUP5QQyf3xD-PKXRsYD0EvLknlkr9S3H2RKc,1185
|
|
429
429
|
synapse/tests/test_servers_stemcell.py,sha256=TJabX5aQVLbGNLffiVd3B7Uj5dH12Y-0KqAW56GM0G8,2320
|
|
430
430
|
synapse/tests/test_servers_univ.py,sha256=eXesifJL05IA91f5od-9bjuIDVhNWMdo8qWzaHEr22s,2704
|
|
431
|
-
synapse/tests/test_telepath.py,sha256=
|
|
431
|
+
synapse/tests/test_telepath.py,sha256=r871k3FjeY6qmlsZXkLhLMzisHOzLax4rArDNNnWhZ0,49475
|
|
432
432
|
synapse/tests/test_tools_aha.py,sha256=dWvXn8SJohZSjo2oFlXMH9cX9GynAb7USSBVv7K19Sg,16788
|
|
433
433
|
synapse/tests/test_tools_apikey.py,sha256=pAjOSAhZiflKksZMHmICWRi0nIO5hS9P5VcT8qUubn0,8909
|
|
434
434
|
synapse/tests/test_tools_autodoc.py,sha256=1SXQcRwB40VZG3YX8T7vGh2YRnDjnSv5AKMz8fj4V1k,9027
|
|
@@ -642,8 +642,8 @@ synapse/vendor/xrpl/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
642
642
|
synapse/vendor/xrpl/tests/test_codec.py,sha256=Zwq6A5uZUK_FWDL3BA932c5b-rL3hnC6efobWHSLC4o,6651
|
|
643
643
|
synapse/vendor/xrpl/tests/test_main.py,sha256=kZQwWk7I6HrP-PMvLdsUUN4POvWD9I-iXDHOwdeF090,4299
|
|
644
644
|
synapse/vendor/xrpl/tests/test_main_test_cases.py,sha256=vTlUM4hJD2Hd2wCIdd9rfsvcMZZZQmNHWdCTTFeGz2Y,4221
|
|
645
|
-
synapse-2.
|
|
646
|
-
synapse-2.
|
|
647
|
-
synapse-2.
|
|
648
|
-
synapse-2.
|
|
649
|
-
synapse-2.
|
|
645
|
+
synapse-2.218.0.dist-info/licenses/LICENSE,sha256=xllut76FgcGL5zbIRvuRc7aezPbvlMUTWJPsVr2Sugg,11358
|
|
646
|
+
synapse-2.218.0.dist-info/METADATA,sha256=MFfZ_nKnAiQunYlS6NqPlSE8oiLYVd4aBo8UIShF96k,4623
|
|
647
|
+
synapse-2.218.0.dist-info/WHEEL,sha256=cRWFNt_CJSuf6BnJKAdKunDXUJxjAbWvbt_kstDCs1I,93
|
|
648
|
+
synapse-2.218.0.dist-info/top_level.txt,sha256=v_1YsqjmoSCzCKs7oIhzTNmWtSYoORiBMv1TJkOhx8A,8
|
|
649
|
+
synapse-2.218.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|