f >dZddlmZddlmZmZ ddlZdZddlZejejejejejejejej ej"f Zd d dZy#e$rdZ d d dZYywxYw) z&An implementation of RFC4013 SASLprep.) annotations)AnyOptionalNTcFt|ts|S|rgttj}nt}tj }tj }dj|Dcgc]}||r ||rdn|c}}tjjd|}tj}||dr,||ds tdg|tj}ng||}|D]!tfd|Dstd|Scc}w) aVAn implementation of RFC4013 SASLprep. :param data: The string to SASLprep. Unicode strings (:class:`str`) are supported. Byte strings (:class:`bytes`) are ignored. :param prohibit_unassigned_code_points: True / False. RFC 3454 and RFCs for various SASL mechanisms distinguish between `queries` (unassigned code points allowed) and `stored strings` (unassigned code points prohibited). Defaults to ``True`` (unassigned code points are prohibited). :return: The SASLprep'ed version of `data`.  NFKCrz$SASLprep: failed bidirectional checkc3.K|] }|yw)N).0in_tablechars Y/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/pymongo/saslprep.py zsaslprep..qs=h8D>=sz+SASLprep: failed prohibited character check) isinstancestr _PROHIBITED stringprep in_table_a1 in_table_c12 in_table_b1join unicodedata ucd_3_2_0 normalize in_table_d1 ValueError in_table_d2any)dataprohibit_unassigned_code_points prohibitedrreltrrs @rsaslprepr%9s $$K *?;? (>(>?J$J "..  ,, ww?C \;WZK[c*X 3 \  $$..vt< ,, tAw tBx(!!GHH?:>z'='=>J 4:3{3JD=*== !NOO 9 ]s % D3DFc<t|tr td|S)zSASLprep dummyz[The stringprep module is not available. Usernames and passwords must be instances of bytes.)rr TypeError)r!r"s rr%r%s' dC 8  )T)r!rr"zOptional[bool]returnr)__doc__ __future__rtypingrrrHAVE_STRINGPREPrrin_table_c21_c22 in_table_c3 in_table_c4 in_table_c5 in_table_c6 in_table_c7 in_table_c8 in_table_c9rr% ImportErrorr r(rr7s-" `"O ## K;G O;?  )7    sBBB