synapse 2.205.0__py311-none-any.whl → 2.206.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/axon.py CHANGED
@@ -138,8 +138,8 @@ class AxonFileHandler(AxonHandlerMixin, s_httpapi.Handler):
138
138
 
139
139
  self.blobsize = await self.getAxon().size(sha256b)
140
140
  if self.blobsize is None:
141
- self.set_status(404)
142
- self.sendRestErr('NoSuchFile', f'SHA-256 not found: {s_common.ehex(sha256b)}')
141
+ self.sendRestErr('NoSuchFile', f'SHA-256 not found: {s_common.ehex(sha256b)}',
142
+ status_code=s_httpapi.HTTPStatus.NOT_FOUND)
143
143
  return False
144
144
 
145
145
  status = 200
@@ -260,8 +260,8 @@ class AxonHttpBySha256V1(AxonFileHandler):
260
260
 
261
261
  sha256b = s_common.uhex(sha256)
262
262
  if not await self.getAxon().has(sha256b):
263
- self.set_status(404)
264
- self.sendRestErr('NoSuchFile', f'SHA-256 not found: {sha256}')
263
+ self.sendRestErr('NoSuchFile', f'SHA-256 not found: {sha256}',
264
+ status_code=s_httpapi.HTTPStatus.NOT_FOUND)
265
265
  return
266
266
 
267
267
  resp = await self.getAxon().del_(sha256b)
synapse/cortex.py CHANGED
@@ -815,7 +815,7 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
815
815
  },
816
816
  'modules': {
817
817
  'default': [],
818
- 'description': 'A list of module classes to load.',
818
+ 'description': 'Deprecated. A list of module classes to load.',
819
819
  'type': 'array'
820
820
  },
821
821
  'storm:log': {
@@ -1397,6 +1397,16 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
1397
1397
  {'perm': ('node', 'del', '<form>'), 'gate': 'layer',
1398
1398
  'desc': 'Controls removing a specific form of node in a layer.'},
1399
1399
 
1400
+ {'perm': ('node', 'edge', 'add'), 'gate': 'layer',
1401
+ 'desc': 'Controls adding light edges to a node.'},
1402
+ {'perm': ('node', 'edge', 'del'), 'gate': 'layer',
1403
+ 'desc': 'Controls adding light edges to a node.'},
1404
+
1405
+ {'perm': ('node', 'edge', 'add', '<verb>'), 'gate': 'layer',
1406
+ 'desc': 'Controls adding a specific light edge to a node.'},
1407
+ {'perm': ('node', 'edge', 'del', '<verb>'), 'gate': 'layer',
1408
+ 'desc': 'Controls adding a specific light edge to a node.'},
1409
+
1400
1410
  {'perm': ('node', 'tag'), 'gate': 'layer',
1401
1411
  'desc': 'Controls editing any tag on any node in a layer.'},
1402
1412
  {'perm': ('node', 'tag', 'add'), 'gate': 'layer',
@@ -6372,6 +6382,9 @@ class Cortex(s_oauth.OAuthMixin, s_cell.Cell): # type: ignore
6372
6382
  if isinstance(ctor, (list, tuple)):
6373
6383
  ctor, conf = ctor
6374
6384
 
6385
+ if not ctor.startswith(('synapse.tests', 'synapse.models')):
6386
+ s_common.deprecated("'modules' Cortex config value", curv='2.206.0')
6387
+
6375
6388
  modu = self._loadCoreModule(ctor, conf=conf)
6376
6389
  if modu is None:
6377
6390
  return
synapse/lib/aha.py CHANGED
@@ -79,12 +79,9 @@ class AhaProvisionServiceV1(s_httpapi.Handler):
79
79
  url = await self.cell.addAhaSvcProv(name, provinfo=provinfo)
80
80
  except asyncio.CancelledError: # pragma: no cover
81
81
  raise
82
- except s_exc.SynErr as e:
83
- logger.exception(f'Error provisioning {name}')
84
- return self.sendRestErr(e.__class__.__name__, e.get('mesg', str(e)))
85
- except Exception as e: # pragma: no cover
82
+ except Exception as e:
86
83
  logger.exception(f'Error provisioning {name}')
87
- return self.sendRestErr(e.__class__.__name__, str(e))
84
+ return self.sendRestExc(e, status_code=s_httpapi.HTTPStatus.BAD_REQUEST)
88
85
  return self.sendRestRetn({'url': url})
89
86
 
90
87
  _getAhaSvcSchema = {
@@ -175,6 +172,7 @@ class AhaApi(s_cell.CellApi):
175
172
  if network is None:
176
173
  await self._reqUserAllowed(('aha', 'service', 'get'))
177
174
  else:
175
+ s_common.deprecated('getAhaSvcs() network argument', curv='v2.206.0')
178
176
  await self._reqUserAllowed(('aha', 'service', 'get', network))
179
177
 
180
178
  async for info in self.cell.getAhaSvcs(network=network):
@@ -187,6 +185,8 @@ class AhaApi(s_cell.CellApi):
187
185
  NOTE: In order for the service to remain marked "up" a caller
188
186
  must maintain the telepath link.
189
187
  '''
188
+ if network is not None:
189
+ s_common.deprecated('addAhaSvc() network argument', curv='v2.206.0')
190
190
  svcname, svcnetw, svcfull = self.cell._nameAndNetwork(name, network)
191
191
 
192
192
  await self._reqUserAllowed(('aha', 'service', 'add', svcnetw, svcname))
@@ -253,26 +253,31 @@ class AhaApi(s_cell.CellApi):
253
253
  '''
254
254
  Remove an AHA service entry.
255
255
  '''
256
+ if network is not None:
257
+ s_common.deprecated('delAhaSvc() network argument', curv='v2.206.0')
256
258
  svcname, svcnetw, svcfull = self.cell._nameAndNetwork(name, network)
257
259
  await self._reqUserAllowed(('aha', 'service', 'del', svcnetw, svcname))
258
260
  return await self.cell.delAhaSvc(name, network=network)
259
261
 
260
262
  async def getCaCert(self, network):
261
-
263
+ s_common.deprecated('getCaCert() will no longer accept a network argument', curv='v2.206.0')
262
264
  await self._reqUserAllowed(('aha', 'ca', 'get'))
263
265
  return await self.cell.getCaCert(network)
264
266
 
265
267
  async def genCaCert(self, network):
266
-
268
+ s_common.deprecated('genCaCert()', curv='v2.206.0')
267
269
  await self._reqUserAllowed(('aha', 'ca', 'gen'))
268
270
  return await self.cell.genCaCert(network)
269
271
 
270
272
  async def signHostCsr(self, csrtext, signas=None, sans=None):
271
-
273
+ if signas is not None:
274
+ s_common.deprecated('signHostCsr() signas argument', curv='v2.206.0')
272
275
  await self._reqUserAllowed(('aha', 'csr', 'host'))
273
276
  return await self.cell.signHostCsr(csrtext, signas=signas, sans=sans)
274
277
 
275
278
  async def signUserCsr(self, csrtext, signas=None):
279
+ if signas is not None:
280
+ s_common.deprecated('signUserCsr() signas argument', curv='v2.206.0')
276
281
  await self._reqUserAllowed(('aha', 'csr', 'user'))
277
282
  return await self.cell.signUserCsr(csrtext, signas=signas)
278
283