Skip to content

Commit

Permalink
Merge branch 'master' into feat_docker_vtxbim
Browse files Browse the repository at this point in the history
  • Loading branch information
vEpiphyte committed Mar 16, 2022
2 parents dd7a47e + 15ae6f2 commit 94d1ff0
Show file tree
Hide file tree
Showing 40 changed files with 805 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.85.1
current_version = 2.86.0
commit = True
tag = True
tag_message =
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,76 @@ Synapse Changelog
*****************


v2.86.0 - 2022-03-09
====================

Automatic Migrations
--------------------
- Migrate secondary properties in Cortex nodes which use ``hugenum`` type to
account for updated ranges. See :ref:`devops-general-migrations` for more
information about automatic migrations.

Features and Enhancements
-------------------------
- Extend the number of decimal places the ``hugenum`` type can store to 24
places, with a new maximum value of 730750818665451459101842.
(`#2584 <https://github.com/vertexproject/synapse/pull/2584>`_)
(`#2586 <https://github.com/vertexproject/synapse/pull/2586>`_)
- Update ``fastjsonschema`` to version ``2.15.3``.
(`#2581 <https://github.com/vertexproject/synapse/pull/2581>`_)

Bugfixes
--------
- Add missing read-only flags to secondary properties of Comp type forms which
were computed from the primary property of the node. This includes the
following:
(`#2587 <https://github.com/vertexproject/synapse/pull/2587>`_)

- ``crypto:currency:address:coin``
- ``crypto:currency:address:iden``
- ``crypto:currency:block:coin``
- ``crypto:currency:block:offset``
- ``crypto:currency:client:coinaddr``
- ``crypto:currency:client:inetaddr``
- ``crypto:currency:smart:token:contract``
- ``crypto:currency:smart:token:tokenid``
- ``crypto:x509:revoked:crl``
- ``crypto:x509:revoked:cert``
- ``crypto:x509:signedfile:cert``
- ``crypto:x509:signedfile:file``
- ``econ:acquired:item``
- ``econ:acquired:purchase``
- ``inet:dns:query:client``
- ``inet:dns:query:name``
- ``inet:dns:query:type``
- ``inet:whois:contact:type``
- ``inet:wifi:ap:bssid``
- ``inet:wifi:ap:ssid``
- ``mat:itemimage:file``
- ``mat:itemimage:item``
- ``mat:specimage:file``
- ``mat:specimage:spec``
- ``ou:id:number:type``
- ``ou:id:number:value``
- ``ou:hasgoal:goal``
- ``ou:hasgoal:org``
- ``tel:mob:cell:carrier``
- ``tel:mob:cell:carrier:mcc``
- ``tel:mob:cell:carrier:mnc``
- ``tel:mob:cell:cid``
- ``tel:mob:cell:lac``

- Fix an issue where Layers configured with writeback mirrors did not properly
handle results which did not have any changes.
(`#2583 <https://github.com/vertexproject/synapse/pull/2583>`_)

Documentation
-------------
- Fix spelling issues in documentation and API docstrings.
(`#2582 <https://github.com/vertexproject/synapse/pull/2582>`_)
(`#2585 <https://github.com/vertexproject/synapse/pull/2585>`_)


v2.85.1 - 2022-03-03
====================

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages
from setuptools.command.install import install

VERSION = '2.85.1'
VERSION = '2.86.0'

class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
Expand Down
4 changes: 2 additions & 2 deletions synapse/axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ def _initAxonHttpApi(self):
self.addHttpApi('/api/v1/axon/files/has/sha256/([0-9a-fA-F]{64}$)', AxonHttpHasV1, {'cell': self})
self.addHttpApi('/api/v1/axon/files/by/sha256/([0-9a-fA-F]{64}$)', AxonHttpBySha256V1, {'cell': self})

def _addSyncItem(self, item):
self.axonhist.add(item)
def _addSyncItem(self, item, tick=None):
self.axonhist.add(item, tick=tick)
self.axonseqn.add(item)

async def history(self, tick, tock=None):
Expand Down
21 changes: 20 additions & 1 deletion synapse/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,32 @@ def intify(x):
except (TypeError, ValueError):
return None

hugectx = decimal.Context(prec=15)
hugectx = decimal.Context(prec=48)
def hugenum(valu):
'''
Return a decimal.Decimal with proper precision for use as a synapse hugenum.
'''
return decimal.Decimal(valu, context=hugectx)

def hugeadd(x, y):
'''
Add two decimal.Decimal with proper precision to support synapse hugenums.
'''
return hugectx.add(x, y)

def hugesub(x, y):
'''
Subtract two decimal.Decimal with proper precision to support synapse hugenums.
'''
return hugectx.subtract(x, y)

hugeexp = decimal.Decimal('1E-24')
def hugeround(x):
'''
Round a decimal.Decimal with proper precision for synapse hugenums.
'''
return hugectx.quantize(x, hugeexp)

def vertup(vstr):
'''
Convert a version string to a tuple.
Expand Down
2 changes: 1 addition & 1 deletion synapse/cortex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3812,7 +3812,7 @@ async def _addLayer(self, ldef, nexsitem):
await user.setAdmin(True, gateiden=iden, logged=False)

# forward wind the new layer to the current model version
await layr.setModelVers(s_modelrev.maxvers)
await layr._setModelVers(s_modelrev.maxvers)

if self.isactive:
await layr.initLayerActive()
Expand Down
4 changes: 2 additions & 2 deletions synapse/datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def __init__(self):
item = s_types.NodeProp(self, 'nodeprop', info, {})
self.addBaseType(item)

info = {'doc': 'A potentially huge/tiny number. [x] <= 170141183460469231731687 with a fractional '
'precision of 15 decimal digits.'}
info = {'doc': 'A potentially huge/tiny number. [x] <= 730750818665451459101842 with a fractional '
'precision of 24 decimal digits.'}
item = s_types.HugeNum(self, 'hugenum', info, {})
self.addBaseType(item)

Expand Down
9 changes: 3 additions & 6 deletions synapse/lib/certdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,12 @@ def __init__(self, path=None):

def addCertPath(self, *path):

fullpath = s_common.gendir(*path)
fullpath = s_common.genpath(*path)
self.pathrefs[fullpath] += 1

if self.pathrefs[fullpath] == 1:

self.certdirs.append(fullpath)

s_common.gendir(fullpath, 'cas')
s_common.gendir(fullpath, 'hosts')
s_common.gendir(fullpath, 'users')

def delCertPath(self, *path):
fullpath = s_common.gendir(*path)
self.pathrefs[fullpath] -= 1
Expand Down Expand Up @@ -700,6 +695,8 @@ def importFile(self, path, mode, outp=None):
if os.path.isfile(newpath):
raise s_exc.FileExists(mesg=f'File {newpath} already exists', path=path)

s_common.gendir(os.path.dirname(newpath))

shutil.copy(path, newpath)
if outp is not None:
outp.printf('copied %s to %s' % (path, newpath))
Expand Down

0 comments on commit 94d1ff0

Please sign in to comment.