Skip to content

Add pattern validation for hashedPhoneNumber in Number Verification API #189

@ravindrapalaskar17

Description

@ravindrapalaskar17

Problem description
Currently, the hashedPhoneNumber parameter in the Number Verification API lacks pattern validation. This can lead to accepting malformed hash inputs which could cause inconsistencies or potential misuse. Unlike the phoneNumber field, which is validated using E.164 format, hashedPhoneNumber requires a different validation approach due to its hashed nature.

Expected behavior
Introduce pattern validation for hashedPhoneNumber to ensure:

  1. The value is exactly 64 characters long.
  2. It only contains valid hexadecimal characters (a-f, A-F, 0-9).

This will help maintain input consistency and improve API robustness.

Alternative solution
NA

Additional context
The change complements the existing validation on phoneNumber, but adapts it for hashed input, which cannot be validated for prefix or structure due to being irreversible. This update ensures stricter input control while maintaining flexibility in accepting hashed values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions