async_postgres/pg_saslprep

Search:
Group by:

RFC 4013 SASLprep (stringprep profile for user names and passwords). Applied to passwords before SCRAM-SHA-256 PBKDF2 so that PostgreSQL, which stores pg_saslprep-normalized verifiers, accepts passwords whose Unicode form differs from the raw input (e.g. U+00A0 -> U+0020, U+FB01 "fi" ligature -> "fi", NFKC-decomposed forms).

Unassigned code points (RFC 3454 Table A.1, Unicode 3.2) are not prohibited here. This deviates from PostgreSQL's pg_saslprep, which rejects them; the A.1 table is large and the practical impact is low (such a password could not have been set via CREATE ROLE either).

Procs

proc saslprep(input: string): string {....raises: [], tags: [], forbids: [].}
Apply RFC 4013 SASLprep. On invalid UTF-8, prohibited code points, bidi violations, or an empty post-mapping result, fall back to the raw input to match libpq and PG server behavior.