Skip to content

src/dazzle_back/runtime/otp_store.py

Generated: 2026-03-30T04:38:47.714024+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

OTP (One-Time Password) store for email verification codes.

Stores hashed OTP codes in PostgreSQL with expiry and attempt limiting.

Key Exports

  • OTPRecord
  • OTPStore
  • init_db
  • create_otp
  • verify_otp
  • cleanup_expired

Dependencies

Imports

  • hashlib
  • hmac
  • secrets
  • datetime.UTC
  • datetime.datetime
  • datetime.timedelta
  • typing.Any
  • uuid.UUID
  • pydantic.BaseModel
  • pydantic.ConfigDict
  • psycopg
  • psycopg.rows.dict_row

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_otp_store.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.