File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/libcloud/common/__pycache__/openstack_identity.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlZddlmZ ddlmZ ddlmZmZm Z ddl mZmZm Z ddlmZ zddlZW n ey? ddlZY nw dZd Zg d �ZdZg d�ZG d d� d�Zedg d��ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�ZG dd� d�Z G dd � d �Z!G d!d"� d"�Z"G d#d$� d$�Z#G d%d&� d&�Z$G d'd(� d(e�Z%G d)d*� d*e�Z&G d+d,� d,e&�Z'G d-d.� d.e&�Z(G d/d0� d0e&�Z)G d1d2� d2e&�Z*G d3d4� d4e*�Z+G d5d6� d6e*�Z,G d7d8� d8e&e �Z-d9d:� Z.dS );za Common / shared code for handling authentication against OpenStack identity service (Keystone). � N)� namedtuple)�httplib)�Response�ConnectionUserAndKey�CertificateConnection)� LibcloudError�InvalidCredsError�MalformedResponseError)� parse_date�1.1zX-Auth-Token) r �2.0� 2.0_apikey�2.0_password�2.0_voms�3.0�3.x_password�3.x_appcred�3.x_oidc_access_token� )�OpenStackAuthenticationCache�OpenStackAuthenticationCacheKey�OpenStackAuthenticationContext�OpenStackIdentityVersion�OpenStackIdentityDomain�OpenStackIdentityProject�OpenStackIdentityUser�OpenStackIdentityRole�OpenStackServiceCatalog�OpenStackServiceCatalogEntry�$OpenStackServiceCatalogEntryEndpoint�OpenStackIdentityEndpointType�OpenStackIdentityConnection� OpenStackIdentity_1_0_Connection� OpenStackIdentity_1_1_Connection� OpenStackIdentity_2_0_Connection�%OpenStackIdentity_2_0_Connection_VOMS� OpenStackIdentity_3_0_Connection�(OpenStackIdentity_3_0_Connection_AppCred�2OpenStackIdentity_3_0_Connection_OIDC_access_token�get_class_for_auth_versionc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) r a� Base class for external OpenStack authentication caches. Authentication tokens are always cached in memory in :class:`OpenStackIdentityConnection`.auth_token and related fields. These tokens are lost when the driver is garbage collected. To share tokens among multiple drivers, processes, or systems, use an :class:`OpenStackAuthenticationCache` in OpenStackIdentityConnection.auth_cache. Cache implementers should inherit this class and define the methods below. c C � t �)a( Get an authentication context from the cache. :param key: Key to fetch. :type key: :class:`.OpenStackAuthenticationCacheKey` :return: The cached context for the given key, if present; None if not. :rtype: :class:`OpenStackAuthenticationContext` ��NotImplementedError��self�key� r0 �V/opt/saltstack/salt/lib/python3.10/site-packages/libcloud/common/openstack_identity.py�get` � z OpenStackAuthenticationCache.getc C r* )a& Put an authentication context into the cache. :param key: Key where the context will be stored. :type key: :class:`.OpenStackAuthenticationCacheKey` :param context: The context to cache. :type context: :class:`.OpenStackAuthenticationContext` r+ )r. r/ �contextr0 r0 r1 �putl r3 z OpenStackAuthenticationCache.putc C r* )z� Clear an authentication context from the cache. :param key: Key to clear. :type key: :class:`.OpenStackAuthenticationCacheKey` r+ r- r0 r0 r1 �clearx s z"OpenStackAuthenticationCache.clearN)�__name__� __module__�__qualname__�__doc__r2 r5 r6 r0 r0 r0 r1 r R s r r )�auth_url�user_id�token_scope�tenant_name�domain_name�tenant_domain_idc @ s e Zd ZdZddd�ZdS )r z6 An authentication token and related context. Nc C �"