pydantic-extra-types icon indicating copy to clipboard operation
pydantic-extra-types copied to clipboard

Add OTP Type to Types

Open yezz123 opened this issue 2 years ago • 4 comments

https://github.com/pydantic/pydantic/pull/5011

yezz123 avatar Feb 07 '23 20:02 yezz123

Does this requires more specificity in the naming, as there are more than one type of OTP? For example: HOTP and TOTP

The “H” in HOTP stands for Hash-based Message Authentication Code (HMAC). Put in layman’s terms, HMAC-based One-time Password algorithm (HOTP) is an event-based OTP where the moving factor in each code is based on a counter.

Time-based One-time Password (TOTP) is a time-based OTP. The seed for TOTP is static, just like in HOTP, but the moving factor in a TOTP is time-based rather than counter-based.

kkirsche avatar Jul 14 '23 17:07 kkirsche

Does this requires more specificity in the naming, as there are more than one type of OTP? For example: HOTP and TOTP

The “H” in HOTP stands for Hash-based Message Authentication Code (HMAC). Put in layman’s terms, HMAC-based One-time Password algorithm (HOTP) is an event-based OTP where the moving factor in each code is based on a counter.

Time-based One-time Password (TOTP) is a time-based OTP. The seed for TOTP is static, just like in HOTP, but the moving factor in a TOTP is time-based rather than counter-based.

Basically, currently we are planning to support only One-time password using PyOTP

yezz123 avatar Jul 20 '23 06:07 yezz123

Can someone clarify if pydantic_extra_types will work on pydantic v1.

I am unable to migrate due to dependency issues at the moment

XChikuX avatar Jan 10 '25 11:01 XChikuX

Can someone clarify if pydantic_extra_types will work on pydantic v1.

I am unable to migrate due to dependency issues at the moment

Hello @XChikuX 👋🏻

No, it can't work with pydantic v1, because we depend on pydantic-core on different parts that's why, you can also check the pinned dependencies

https://github.com/pydantic/pydantic-extra-types/blob/01866e60a06e12ada2332bf137a54b246ba8c12e/pyproject.toml#L42

yezz123 avatar Jan 10 '25 11:01 yezz123