%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/lazr/restfulclient/authorize/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/lazr/restfulclient/authorize/__pycache__/__init__.cpython-312.pyc

�

}�;e���F�dZeZddgZddlZGd�d�ZGd�de�Zy)a	Classes to authorize lazr.restfulclient with various web services.

This module includes an authorizer classes for HTTP Basic Auth,
as well as a base-class authorizer that does nothing.

A set of classes for authorizing with OAuth is located in the 'oauth'
module.
�BasicHttpAuthorizer�HttpAuthorizer�Nc�,�eZdZdZd�Zd�Zed��Zy)ra�Handles authentication for HTTP requests.

    There are two ways to authenticate.

    The authorize_session() method is called once when the client is
    initialized. This works for authentication methods like Basic
    Auth.  The authorize_request is called for every HTTP request,
    which is useful for authentication methods like Digest and OAuth.

    The base class is a null authorizer which does not perform any
    authentication at all.
    c��y)z*Set up credentials for the entire session.N���self�clients  �G/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/__init__.py�authorizeSessionzHttpAuthorizer.authorizeSession3s���c��y)ztSet up credentials for a single request.

        This probably involves setting the Authentication header.
        Nr�r	�absolute_uri�method�body�headerss     r�authorizeRequestzHttpAuthorizer.authorizeRequest7s��
	
r
c��iS)aGAny parameters necessary to identify this user agent.

        By default this is an empty dict (because authentication
        details don't contain any information about the application
        making the request), but when a resource is protected by
        OAuth, the OAuth consumer name is part of the user agent.
        r)r	s r�user_agent_paramsz HttpAuthorizer.user_agent_params>s	���	r
N)�__name__�
__module__�__qualname__�__doc__rr�propertyrrr
rrr%s%���
�
����r
c�"�eZdZdZd�Zd�Zd�Zy)rz=Handles authentication for services that use HTTP Basic Auth.c� �||_||_y)z�Constructor.

        :param username: User to send as authorization for all requests.
        :param password: Password to send as authorization for all requests.
        N)�username�password)r	rrs   r�__init__zBasicHttpAuthorizer.__init__Ms��!��
� ��
r
c��dtj|j�d|j���j	�z|d<y)zySet up credentials for a single request.

        This sets the authorization header with the username/password.
        zBasic �:�
authorizationN)�base64�	b64encoderr�striprs     rrz$BasicHttpAuthorizer.authorizeRequestVs;��
�����=�=�$�-�-�8���e�g�
�	�� r
c�P�|j|j|j�y)N)�add_credentialsrrrs  rrz$BasicHttpAuthorizer.authorizeSessionbs�����t�}�}�d�m�m�<r
N)rrrrr rrrr
rrrJs��G�!�

�=r
)r�type�
__metaclass__�__all__r$rrrr
r�<module>r,s:��&��
�����
�"�"�J=�.�=r

Zerion Mini Shell 1.0