diff --git a/CHANGELOG.md b/CHANGELOG.md index de56cf59..b14b04de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 4.4.0 + +* Use ``dict`` and ``set`` in pynamo models rather than ``{}`` and ``set()``, + to avoid potential corrupted data in model saves. Based on how confidant + currently uses the pynamo models, the default arguments can't lead to data + corruption, but to avoid potential future issues, we're fixing the default + args to not be mutable. + +## 4.3.1 + +* Packaging fix + +## 4.3.0 + +* Case insentive sort for service and credential list API responses + ## 4.2.0 * Don't in-memory cache the USERS\_FILE, but re-read it every time, so that diff --git a/confidant/models/blind_credential.py b/confidant/models/blind_credential.py index cac8e951..1296722c 100644 --- a/confidant/models/blind_credential.py +++ b/confidant/models/blind_credential.py @@ -42,12 +42,12 @@ class Meta: data_type_date_index = DataTypeDateIndex() name = UnicodeAttribute() credential_pairs = JSONAttribute() - credential_keys = NonNullUnicodeSetAttribute(default=set([]), null=True) + credential_keys = NonNullUnicodeSetAttribute(default=set, null=True) enabled = BooleanAttribute(default=True) data_key = JSONAttribute() cipher_version = NumberAttribute() cipher_type = UnicodeAttribute() - metadata = JSONAttribute(default={}, null=True) + metadata = JSONAttribute(default=dict, null=True) modified_date = UTCDateTimeAttribute(default=datetime.now) modified_by = UnicodeAttribute() documentation = UnicodeAttribute(null=True) diff --git a/confidant/models/credential.py b/confidant/models/credential.py index bdf38b2d..6ae3fb70 100644 --- a/confidant/models/credential.py +++ b/confidant/models/credential.py @@ -44,7 +44,7 @@ class Meta: data_key = BinaryAttribute() # TODO: add cipher_type cipher_version = NumberAttribute(null=True) - metadata = JSONAttribute(default={}, null=True) + metadata = JSONAttribute(default=dict, null=True) modified_date = UTCDateTimeAttribute(default=datetime.now) modified_by = UnicodeAttribute() documentation = UnicodeAttribute(null=True) diff --git a/confidant/models/service.py b/confidant/models/service.py index 704f0348..f45d176f 100644 --- a/confidant/models/service.py +++ b/confidant/models/service.py @@ -40,8 +40,8 @@ class Meta: data_type_date_index = DataTypeDateIndex() revision = NumberAttribute() enabled = BooleanAttribute(default=True) - credentials = NonNullUnicodeSetAttribute(default=set()) - blind_credentials = NonNullUnicodeSetAttribute(default=set()) + credentials = NonNullUnicodeSetAttribute(default=set) + blind_credentials = NonNullUnicodeSetAttribute(default=set) account = UnicodeAttribute(null=True) modified_date = UTCDateTimeAttribute(default=datetime.now) modified_by = UnicodeAttribute() diff --git a/setup.py b/setup.py index 500f2cab..53354a33 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( name="confidant", - version="4.3.1", + version="4.4.0", packages=find_packages(exclude=["test*"]), include_package_data=True, zip_safe=False,