2.5.1 - 2022-12-04¶
- Patch Invoke so it works under Python 3.11+.
- Improve the fuzzing script, add instructions on running it, and add it as a CI job for releases.
- Change the usage of AnyStr in signer's public methods with Union[str, bytes], which is not the same, and they are not generally interchangeably like this, but for this particular usage Union makes more sense, and MyPy seems to agree with this.
- Several improvements in the CI: fixed coverage report, updated Python versions and Poetry, added fuzzing, etc.
- Update dev dependencies.
2.5.0 - 2022-07-02¶
- Add valid unsigned data to the
ExpiredSignatureErrorexception: even if the signature is expired, its unsigned value is valid and safe, so now it can be used.
- Add new linters: pylint, and perflint.
- Move docs to its own environment, due to some incompatibility between dev dependencies. This results in better handling of docs dependencies, using Poetry.
- Several docs, and docstrings improvements.
- Implement minisign to sign all release packages, and tags (using git-minisign), instead of PGP. Read more in the docs.
safetyscanner over docs dependencies too.
2.4.0 - 2022-03-27¶
- Add tests to ensure compatibility, or not, with previous versions.
max_ageto be None for the
Blake2TimestampSigner: the timestamp is then not checked (but the signature is always checked).
2.3.0 - 2022-02-23¶
- Add support for signing secret rotation: now it supports receiving a sequence of secrets instead of a single one, considering them ordered from oldest to newest, so that signatures are made with the newest secret but verifications are done using all of them.
- Add dev tool
darglintto help checking docstrings consistency with the code, and consequently improve docstrings adding missing parts.
2.2.0 - 2022-01-24¶
- Add support for BLAKE3 through third-party package
blake3, which are bindings to the homonym Rust package (ported by one of the algorithm's author).
- Several docs content improvements.
- Marginal performance improvement by changing frozen dataclasses for named tuples.
2.1.0 - 2021-12-28¶
- Unhardcode default compression level, which was hardcoded to 6. That value was set for Zlib and remained there since the old times. Make the default
Noneso we can let the compressor set the right value.
2.0.0 - 2021-06-11¶
- Allow changing encoder in every signer: previously only Blake2SerializerSigner accepted encoders other than b64, yet not totally: the signature was always b64 URL safe encoded. This required a slight refactor splitting the signers' module into bases and signers.
- Add new base32 encoder.
- Add check to ensure that the separator does not belong to the encoder alphabet.
- Add new hex (base16) encoder.
- Add check to ensure that the separator and compressor flag are ASCII characters to prevent encoding errors when converting from bytes to string.
- Add new gzip compressor.
- Add new null serializer: a serializer that doesn't actually serialize. It can be useful when you need to manage bytes or strings, but you want to compress too, therefore being able to use the Blake2SerializerSigner for this.
- Add check to ensure that the separator and compressor flag are not empty.
- Add check to ensure that the encoder alphabet is ASCII and not empty.
- Add signature timestamp to
ExpiredSignatureErrorexception in new
timestampparameter as an aware datetime object.
- Add new dump/load interface in
Blake2SerializerSignerfor file-like objects.
- Add argument to
Blake2SerializerSigner.dumps()to pass keyword arguments to the serializer.
- Add documentation with mkdocs, and a nice title with logo (many thanks to Erus).
- Add new methods to obtain data and signature separately for all signers:
- Create a security scanning job using Trivy.
- Add a job to test support for PyPy 3.7.
- Add a job to test support for Stackless Python 3.7.
- Split classes between mixins and interfaces; also serializers, compressors and encoders, which are implementations of interfaces. This smooths the way to have several implementors and to actually be able to change the entire encoding in the future (currently the signature is always b64 URL safe encoded even if the encoder is changed in Blake2SerializerSigner).
- Set default digest size for all signers to 16 bytes, so the output and functioning is more homogeneous.
- Make compression flag and ratio an instance attribute.
- Make separator an instance attribute.
- Change type annotations for secret, personalisation, separator and compression_flag to show support for bytes and string as it has always been supported.
- Improve force_bytes performance by not casting bytes to bytes, and change its signature to accept any.
compressbecause it's shorter and easier to write, and more tab-autocompletion friendly.
- Recover cause in all exceptions for easier debugging. This was not done before on purpose to hide information in case a misconfiguration in the implementor application would expose said information to the public, but the benefits of having a cause traceback to the original exception are too many to not have it.
- Split tests by module or class to avoid having a giant single file with all the tests in it.
- Marginally improve performance, around ~4% less time, to sign and unsign by removing unneeded calls to
- Prevent timestamped signatures "from the future" to pass as correct by checking the signature age to be bigger than 0.
- Create a fuzzing script using
pythonfuzzto uncover unexpected bugs.
- Fix a potential vulnerability when the
NullSerializerwas used, and the user could sign arbitrary data, then a malicious user could sign a zip bomb that when unsigned could cause at best a controlled
DecompressionErrorexception or at worst a DoS or other unknown result (depends heavily on the compressor used). This scenario is not default and probably very hard to achieve (it can't be produced with the
JSONSerializerbut it could perhaps be produced by some other custom serializer too), but nevertheless the possibility was there.
1.2.1 - 2021-05-10¶
- Add jobs to publish python packages automatically.
- Fix wrong exception being raised in
1.2.0 - 2021-04-24¶
- Add setting to allow deterministic signatures, but keep default of non-deterministic ones.
1.1.0 - 2021-04-15¶
- Add new
Blake2SerializerSigner.dumps()to expose existing capability to force data compression.
- Change execution order of steps to publish a package in Contrib, to allow room for fixes after publishing to testpypi.
- Reworded and fixed some typos in Readme.
- Change wording in
EncodeErrorto abstract them from base 64 URL safe.
Blake2TimestampSignerBase._split_timestamp()to decode the timestamp directly. It made some noise that after splitting one needed to decode the timestamp to actually use it.
- Update dev dependencies, one of which (safety) had a security vulnerability because of a dependency (urllib3).
1.0.0 - 2021-02-26¶
- Add a logo and icons for the project (many thanks to NoonSleeper).
- Add index to readme.
- Add again
flake8-annotations-complexitysince it now works in Python 3.9+.
- Updated dependencies.
- Use debian-based images in CI to run tests, preventing package building wreckage and improving run time (there's no need to build given most packages publish a wheel artifact).
0.5.1 - 2020-11-08¶
- The idea of
66ebeffwas to accept the
hasherparameter also as string, but the implementation and type hints were wrong. Fixed it and added corresponding tests (mental note: avoid releasing new versions at Saturday midnight).
0.5.0 - 2020-11-07¶
flake8-annotations-complexitybecause it is failing in Python 3.9 (there's a bug report already filled for this, and a new release should come soon).
- Create jobs to test this lib under different Python versions.
- Add usage examples in classes docstrings.
- Renamed enum
HasherChoiceand subclass it from string.
- Update dev dependencies.
- Bring back Python 3.7 compatibility by removing the use of TypedDict which was unneeded.
0.4.0 - 2020-10-11¶
- Create new parameter to set compression level in
- When compressing, check if there's a benefit to it and if not skip it in
- The signature is base64 encoded.
- The timestamp is base64 encoded.
- The salt is generated and used as base64 data to avoid needing to decode it when checking the signature.
- Use a symbol to separate composite signature from timestamp and data.
- Verify the signature before decoding.
Blake2Serializerwas renamed to
Blake2SerializerSignerbecause of reasons.
- Derive key from
personin all classes.
- Force bytes in all inputs.
- Set minimum digest size of 16 (was 8).
- Always concatenate personalisation value with the class name to prevent signed data misuse.
- Some other minor changes regarding public/private API so that the only public methods are
- Refactor exceptions to make them make sense and be more usable.
- Improve docstrings descriptions and properly document exceptions.
- Refactor classes into abstracts and mixins so that end users can create their own implementations easily.
- Change compression flag to a dot.
0.3.0 - 2020-10-05¶
- Initial release as a package.
- Use compact JSON encoding in
Blake2Serializerinterface from sign/unsign to dumps/loads.
- Move compression to dumps and mark it in the stream (this seems to prevent zip bombs).
- Force inputs as bytes.
0.2.0 - 2020-09-15¶
- Change composition order because it's easier to work with positive slices, and it's kinda a convention to have salt at the beginning rather than at the end (incentive from a Twitter thread).
0.1.2 - 2020-09-14¶
- Add basic tests (run with
python -m unittest blake2signeror your preferred runner).
- Fix digest and key size check.
0.1.1 - 2020-09-13¶
Signerclass to allow arbitrarily long strings.
- Relicense with MPL 2.0.
0.1.0 - 2020-09-12¶
- Initial release as a Gist.