Skip to content

v0.8.46 — India DPDP PII: INDIA_MOBILE + PAN entity-char gate

Choose a tag to compare

@sattyamjjain sattyamjjain released this 13 Jul 04:35
8255d3d

India DPDP PII additions

Driven by the DPDP Consent-Manager rules (effective 2026-11-14). Extends the existing opt-in Indic PII path (pii_locales=["in"]) on the same SensitiveDataType registry — no parallel system, no new preset. (Aadhaar / PAN / UPI / IFSC / Verhoeff / india_dpdp_2023_policy() already shipped in v0.8.9.)

Added

  • SensitiveDataType.INDIA_MOBILE — a +91 / 91 / trunk-0 prefixed 10-digit number starting 6-9, masked to +91-XXXXX-<last3>. Prefix-required by design: a bare 10-digit run is already masked by the US-shaped PHONE detector, so INDIA_MOBILE only claims the +91 forms and never shares a span with it.
  • PAN 4th-char entity-type gate — under the "in" locale, a PAN-shaped match whose 4th character is not a valid holder-type code (P/C/H/F/A/T/B/L/J/G) is dropped, cutting false positives on random [A-Z]{5}[0-9]{4}[A-Z] strings. Mirrors the Aadhaar Verhoeff gate; off by default.
  • Both wired into india_dpdp_2023_policy() / apply_india_dpdp_2023() via _INDIA_LOCALE_PII_TYPES.

Changed

  • README documents 13 PII types (was 12). Locale-context examples/tests moved off the placeholder ABCDE1234F (whose 4th char D is not a valid PAN entity code, now correctly dropped) to a valid ABCPE1234F — identical mask output.

Full test suite: 3,409 tests · 85.36% coverage.