Releases: Neoteroi/essentials
Releases · Neoteroi/essentials
v1.1.9
v1.1.8
- Improve the
Secretclass to always encode strings before comparing tostr. Otherwise it would throw exception for non-UTF8 strings (just likesecrets.compare_digest- poor UX!). It ignores unicode errors in secrets that are likely received from external input.
v1.1.7
- Add a
Secretclass to handle secrets in code instead of using plainstr. This
approach offers several advantages:
- It encourages loading secrets from environment variables, and discourages programmers
from hardcoding secrets in source code. - Avoids accidental exposure of secrets in logs or error messages, by overriding
str and repr. - It causes exception if someone tries to JSON encode it using the built-in JSON
module, unlikestr. - For convenience, it can be compared directly to strings. It uses constant-time
comparison to prevent timing attacks, with the built-insecrets.compare_digest. - Environment variables can be changed at runtime, using this class applications can
pick up secret changes without needing to be restarted.
- Add an
EnvironmentVariableNotFoundexception that can be used when an expected env
variable is not set. - Handle
timedeltaobjects in theFriendlyEncoderclass, by @arthurbrenno. - Improve the order of
ifstatements in theFriendlyEncoderclass to prioritize the
most frequently encountered types first, which should provide better performance in
typical use cases.
v1.1.6
- Drop Python 3.6 and Python 3.7 support.
- Use
obj.model_dumpinstead ofobj.dictfor Pydantic V2. - Add support for
DecimalinFriendlyEncoder. - Apply
black,flake8,isort,mypy. - Replace
setup.pywithpyproject.toml. - Workflow maintenance.
Contributors: @waketzheng, @tyzhnenko, @RobertoPrevato
v1.1.5
- Adds
py.typedfile - Adds
ConflictException
v1.1.4
v1.1.4 :octocat: