File: //usr/lib/python3.9/site-packages/ipalib/__pycache__/rpc.cpython-39.opt-1.pyc
a
}�f�� � @ sV d Z ddlmZ ddlmZ ddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlmZ ddlmZ ddlZddlmZ ddlZddlmZ dd lmZ dd
lmZmZmZm Z m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z' dd
l(m)Z* ddl+m,Z, ddl+m-Z- ddl.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE ddl"mFZF ddlGmHZHmIZI z4ddlJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZT W nD eU�y, ddlVmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZT Y n0 ejW�rDddlXmYZY nddlZm[ZY ejW�r\e\Z]e�^e_�Z`dZadZbdd � Zcd!d"� Zdd#d$� Zed%d&� ZfdEd(d)�ZgdFd+d,�ZhdGd-d.�ZidHd/d0�ZjG d1d2� d2�ZkG d3d4� d4eQ�ZlG d5d6� d6el�ZmG d7d8� d8em�ZnG d9d:� d:en�ZoG d;d<� d<eo�ZpG d=d>� d>e�ZqG d?d@� d@eq�ZrG dAdB� dB�ZsG dCdD� dDeq�ZtdS )Ia`
RPC client and shared RPC client/server functionality.
This module adds some additional functionality on top of the ``xmlrpc.client``
module in the Python standard library (``xmlrpclib`` in Python 2).
For documentation on the ``xmlrpclib`` module, see:
http://docs.python.org/2/library/xmlrpclib.html
Also see the `ipaserver.rpcserver` module.
� )�absolute_import)�DecimalN)�SSLError)�x509)�DNSException)�Connectible)�LDAP_GENERALIZED_TIME_FORMAT)�errors_by_code�UnknownError�NetworkError�XMLRPCMarshallError� JSONError)�errors�capabilities)�context�
Connection)�Encoding)�ipautil)�session_storage)�Cookie)�DNSName� query_srv)�_)�create_https_connection)�KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN�KRB5KRB_AP_ERR_TKT_EXPIRED�
KRB5_FCC_PERM�KRB5_FCC_NOFILE�KRB5_CC_FORMAT�KRB5_REALM_CANT_RESOLVE�KRB5_CC_NOTFOUND�
get_principal)�DN)� Principal)�VERSION_WITHOUT_CAPABILITIES)�api)�json_encode_binary�json_decode_binary)
�Binary�Fault�DateTime�dumps�loads�ServerProxy� Transport�
ProtocolError�MININT�MAXINT)�RemoteDisconnected)�
BadStatusLineZipa_sessionzX-IPA-Session-Cookiec
C sH zt �| t|� W n0 tyB } ztt|���W Y d}~n
d}~0 0 dS )z�
Given a principal create or update the session data for that
principal in the persistent secure storage.
Raises ValueError if unable to perform the action for any reason.
N)r Z
store_data�CCACHE_COOKIE_KEY� Exception�
ValueError�str)� principal�data�e� r; �./usr/lib/python3.9/site-packages/ipalib/rpc.py�%update_persistent_client_session_data� s r= c
C sD zt �| t�W S ty> } ztt|���W Y d}~n
d}~0 0 dS )z�
Given a principal return the stored session data for that
principal from the persistent secure storage.
Raises ValueError if unable to perform the action for any reason.
N)r �get_datar4 r5 r6 r7 �r8 r: r; r; r<