v2.0.0 MAJOR - Added KeyManager class, refactored crypto module, documentation changes, packaging changes and more!
There have been many, many changes since version 1.0, so I've decided it's about time that we finally bump our major version to version 2.0.0
While this release isn't really a breaking change from 1.5.0, there have been so many breaking changes introduced in the 1.x.x series, as well as major new features such as a cache abstraction layer and a cryptography module, it's worth having a clean semver slate with 2.0.0
Docs
- Added documentation for
byteifyandstringify - Added documentation for the
cryptomodule - Added documentation for the
setuppymodule - Updated the custom sphinx CSS to allow for a sensible 5th nesting level in the navigation
- Adjusted the sphinx templates for
autosummary/class.rstandautosummary/module.rst- Insert toctree directive automatically into generated files, so sub-components automatically have their RST stubs for navigation generated,
instead of having to manually modify the generate files afterwards.:toctree:is automatically added for module functions+classes:toctree:is automatically added for class methods+attributes
- The headings "Methods" and "Attributes" are automatically added for classes, for display in the navigation bar.
- Insert toctree directive automatically into generated files, so sub-components automatically have their RST stubs for navigation generated,
- Added
sphinx_rtd_themeas an import and in the extension list inconf.py(the README says to do this, so maybe it will prevent issues in the future?)
Packaging
- Added
extras_requireto setup.py, allowing "extras" to be specified when installing privex-helpers, instead of
having to specify optional dependencies directly in your requirements.txt - Excluded the
testsmodule from the package
Unit Tests
- Created
TestKeyManagerclass inside oftests/test_crypto.pywhich tests the new asymmetric key system- Tests generation of RSA, ECDSA and Ed25519 keys by checking the public/private key length, as well as looking for strings in their output format
- Tests loading of RSA, ECDSA, and Ed25519 keys
- Tests loading invalid keys correctly raises an exception (otherwise how do we know that the previous loading attempts weren't just being ignored?)
- Tests signing and verifying messages for RSA, ECDSA and Ed25519 keys
- Tests encryption and decryption for RSA keys (other algorithms don't support encryption/decryption)
Code
cryptomodule is now a folder python module- Moved EncryptHelper into crypto/EncryptHelper.py
- Created crypto/base.py with helper functions such as
is_base64andauto_b64decode - Created crypto/KeyManager.py
- Generates Asymmetric keys in RSA, ECDSA and Ed25519 format
- Serialize public/private keys into various formats, default: PEM+PKCS8 for private, OpenSSH for public
- Load public/private keys in most formats, with auto detection
- Ability to load a key from a file
- Automatically interpolate public key when loading a private key
- Ability to output generated keys to private and public file
- Signing messages with RSA, ECDSA, and Ed25519
- Verifying messages with RSA, ECDSA, and Ed25519
- Encrypting messages/data with RSA
- Decrypting messages/data with RSA
- Lots of PyDoc blocks, clearly documenting how everything works
- New
setuppymodule with various packaging related helpers, such as parsing requirements files and handling importing other requirements files - Added
InvalidFormatexception, used by the crypto module commonmodule- New
byteifyfunction - convert a value into bytes if it isn't already bytes - New
stringifyfunction - decode bytes into a string, if it isn't already a string
- New