- Allow custom backends to override generate_message(security_code, context=None) for dynamic message generation at runtime.
- context parameter support added to send_verification() for passing additional formatting data dynamically.
- PhoneVerificationService now delegates message generation to the backend if generate_message() is implemented.
- Moved phone_settings inside __init__ for better error handling when PHONE_VERIFICATION is missing from settings.
- Optional dependencies (
twilio
,nexmo
) are now only required if explicitly used in thePHONE_VERIFICATION["BACKEND"]
setting. - Improved error messaging to guide users to install the required backend package (e.g.,
twilio
,nexmo
) only when needed. - Custom backends now raise a clear
RuntimeError
if the import fails, instead of misleading dependency errors. - Support for Python 3.11, 3.12, 3.13
- CI tests for Py{311,312,313}-Django{2x,3x,4x,5x}.
phonenumbers
dependency is replaced withphonenumberslite
to reduce the package size.
- Support for Django 4.x.
- Support for Django 3.2.
- Method
phone_verify.backends.nexmo.NexmoBackend.send_sms
changes parameter name fromnumbers
tonumber
to be consistent with rest of the inherited classes.
- Support for Python 3.8 & Python 3.9.
- CI tests for Py{36,37,38,39}-Django{20,21,22,30,31}.
- Fixed issue
generate_session_token
to handle cases in Py38, Py39 when thesession_token
is alreadystring
instead ofbytes
.
NOTE: The previous version of this library provided the security_code
in the JWT session_token
. You would have to re-verify phone_numbers
in this version to ensure they are authentically verified.
- Tests added to provide 100% coverage on the package.
- Add
nexmo.errors.ClientError
as exception class inphone_verify.backends.nexmo.NexmoBackend
&phone_verify.backends.nexmo.NexmoSandboxBackend
.
- Method signature changed for
phone_verify.backends.BaseBackend.generate_session_token
. It now accepts onlyphone_number
instead of combination ofphone_number
andsecurity_code
. - Remove the
security_code
from JWTsession_token
to avoid leaking information. - Add nonce in
session_token
to generate unique tokens for eachphone_number
. - Fixes call to
phone_verify.backends.nexmo.NexmoBackend.send_sms
method.
- Support
Nexmo
as a backend service along withTwilio
. - Add docs for writing a custom backend.
- Update
backends.base.BaseBackend.validate_security_code
to usesave()
instead ofupdate()
to allow Django to emit itspost_save()
signal.
- Add coverage report through
coveralls
. - Support for One-Time Passwords (OTP) using
VERIFY_SECURITY_CODE_ONLY_ONCE
asTrue
in the settings. - Script to support makemigrations for development.
BaseBackend
status now haveSECURITY_CODE_VERIFIED
andSESSION_TOKEN_INVALID
status to support new states.
- Rename
TWILIO_SANDBOX_TOKEN
toSANDBOX_TOKEN
. - Fix signature for
send_bulk_sms
method inTwilioBackend
andTwilioSandboxBackend
. - Response for
/api/phone/register
contains keysession_token
instead ofsession_code
. - Request payload for
/api/phone/verify
now expectssession_token
key instead ofsession_code
. - Response for
/api/phone/verify
now sends additional response ofSecurity code is already verified
in caseVERIFY_SECURITY_CODE_ONLY_ONCE
is set toTrue
. - Rename
otp
tosecurity_code
in code and docs to be more consistent. - Rename
BaseBackend
status fromVALID
,INVALID
,EXPIRED
toSECURITY_CODE_VALID
,SECURITY_CODE_INVALID
, andSECURITY_CODE_EXPIRED
respectively. - Rename
session_code
tosession_token
to be consistent in code and naming across the app. - Rename service
send_otp_and_generate_session_code
tosend_security_code_and_generate_session_token
. - Rename method
BaseBackend.generate_token
toBaseBackend.generate_security_code
. - Rename method
create_otp_and_session_token
tocreate_security_code_and_session_token
. - Rename method
BaseBackend.validate_token
toBaseBackend.validate_security_code
with an additional parameter ofsession_token
.
pre-commit-config
to maintain code quality using black and other useful tools.- Docs for integration and usage in :doc:`getting_started`
- Tox for testing on py{37}-django{20,21,22}.
- Travis CI for testing builds.
- Convert
*.md
docs to reST Markup. - Fix issue with installing required package dependencies via
install_requires
.
- README and documentation of API endpoints.
setup.cfg
to manage coverage.phone_verify
app including backends, requirements, tests.- Initial app setup.