Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@paragonie-scott paragonie-scott released this 22 Apr 14:30
· 113 commits to master since this release
v2.0.0

Backwards compatibility breaks!

CipherSweet v2.x is mostly but not completely backwards compatible with the v1.x branch. Many of the BC breaks were introduced by @mcordingley in #42:

  • I removed all mention of the back-end from the key provider. The key providers had no reason to know about the back-end in use, but its presence meant an additional method on the interface and somewhat more complicated instantiation logic. This change made the back-end a required parameter to the CipherSweet constructor, but the additional effort of providing it there is (more than) offset by no longer having to provide it to a key provider.
  • I removed getDefaultBackend(), as a change in the environment could cause a change in back-end, thereby rendering indexes and encrypted values "invalid". Different environments with the same code could nonetheless try to run different back-ends. 🪲
  • I updated the CipherSweet constructor to make the back-end again an optional parameter. If not provided, we fall back to a default back-end. Unlike the removed factory method, this will always choose the same back-end implementation. Unless the user has specific reason otherwise, this is the back-end they will want. If the environment is unable to accommodate ModernCrypto, attempting to use it should throw an error and prompt either a code change or the installation of libsodium. Either way, the choice made will be explicit and intentional.

... snip ...

  • Removed ArrayProvider. It doesn't seem to add anything beyond what StringProvider already gives, but is less direct about it.

Additionally, some changes made by Paragon Initiative Enterprises to make the library easier to use and cleaner:

  • Invert the logic of "flat indexes" introduced in v1.10.0. The default are now "flat", and you can specify if you want typed indexes. This makes the default case slightly faster and simpler.
  • We now only support Psalm v3.x and disable these tests on PHP 7.0 and below.