← Back
Editing: oidutil.cpython-311.pyc
� �h�^� � � � d Z g d�ZddlZddlZddlmZ ej e� � ZddgZ g d�Z d� Zdd �Zdd�Z dd�Zdd �Zd� Zd� Zd� Z G d� de� � ZdS )zOThis module contains general utility code that is used throughout the library. )�log� appendArgs�toBase64� fromBase64�autoSubmitHTML� toUnicode� N)� urlencodezdefusedxml.cElementTreezdefusedxml.ElementTree)zxml.etree.cElementTreezxml.etree.ElementTree�cElementTreezelementtree.ElementTreec �t � t | t � � r| � d� � S t | � � S )z�Returns the given argument as a unicode object. @param value: A UTF-8 encoded string or a unicode (coercable) object @type message: str or unicode @returns: Unicode object representing the input value. �utf-8)� isinstance�bytes�decode�str)�values �0/usr/lib/python3/dist-packages/openid/oidutil.pyr r s4 � � �%���� %��|�|�G�$�$�$��u�:�:�� �OpenID transaction in progressc � � t | t � � rt | d�� � } t |t � � rt |d�� � }d|�d| �d�}|S )Nr ��encodingz <html> <head> <title>z=</title> </head> <body onload="document.forms[0].submit();"> z� <script> var elements = document.forms[0].elements; for (var i = 0; i < elements.length; i++) { elements[i].style.display = "none"; } </script> </body> </html> )r r r )�form�title�htmls r r r , sh � ��$���� +��4�'�*�*�*���%���� -��E�G�,�,�,��� �u�u�d�d�d��D� �Kr c �t � | �t } t | � � S # t $ r t d| ��� � �w xY w)aj Find a working ElementTree implementation that is not vulnerable to XXE, using `defusedxml`. >>> XXESafeElementTree = importSafeElementTree() @param module_names: The names of modules to try to use as a safe ElementTree. Defaults to C{L{xxe_safe_elementtree_modules}} @returns: An ElementTree module that is not vulnerable to XXE. NzSUnable to find a ElementTree module that is not vulnerable to XXE. Tried importing )�xxe_safe_elementtree_modules�importElementTree�ImportError)�module_namess r �importSafeElementTreer D sd � � ��3��C� ��.�.�.��� C� C� C��k�2>�,�B� C� C� C�C���s � �7c �2 � | �t } | D ]z} t |dddg� � } |� d� � |c S # t t t f$ r � t � d|z � � Y �hxY w# t $ r Y �ww xY wt d| ��� � �)a: Find a working ElementTree implementation, trying the standard places that such a thing might show up. >>> ElementTree = importElementTree() @param module_names: The names of modules to try to use as ElementTree. Defaults to C{L{elementtree_modules}} @returns: An ElementTree module N�unusedz <unused/>zRNot using ElementTree library %r because it failed to parse a trivial document: %szKNo ElementTree library found. You may need to install one. Tried importing ) �elementtree_modules� __import__�XML� SystemExit�MemoryError�AssertionError�logger� exceptionr )r �mod_name�ElementTrees r r r Y s� � � ��*�� � C� C�� #�$�X�t�T�H�:�F�F�K� #�����,�,�,� #�"�"�"�� ��^�<� � � �� ?�� � �3�5=�>�?� ?� ?� ?� ?����� � � � ��D� ���� �k�2>�,�B� C� C� Cs �A7�<�6A4�7 B�Bc �<