| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.9/site-packages/ipalib/__pycache__/ |
Upload File : |
a
�ji � @ s� d dl Z d dlmZ d dlZd dlmZ d dlZd dlZd dl m
Z
d dlmZmZ d dl
mZ d dlmZ d dlmZ d d lmZ ejr�eZG d
d� de�Zdd
d�Zejefdd�Zdd� ZdS )� N)�x509)�Decimal)�LDAP_GENERALIZED_TIME_FORMAT)�capabilitiesr )�Encoding)�DN)�DNSName)� Principalc s~ e Zd ZdZdZe� Zef� fdd� Zdd� Zefdd�Z d d
� Z
dd� Zd
d� Zefdd�Z
eejfdd�Zdd� Z� ZS )�_JSONPrimera� Fast JSON primer and pre-converter
Prepare a data structure for JSON serialization. In an ideal world, priming
could be handled by the default hook of json.dumps(). Unfortunately the
hook treats Python 2 str as text while IPA considers str as bytes.
The primer uses a couple of tricks to archive maximum performance:
* O(1) type look instead of O(n) chain of costly isinstance() calls
* __missing__ and __mro__ with caching to handle subclasses
* inline code with minor code duplication (func lookup in enc_list/dict)
* avoid surplus function calls (e.g. func is _identity, obj.__class__
instead if type(obj))
* function default arguments to turn global into local lookups
* avoid re-creation of bound method objects (e.g. result.append)
* on-demand lookup of client capabilities with cached values
Depending on the client version number, the primer converts:
* bytes -> {'__base64__': b64encode}
* datetime -> {'__datetime__': LDAP_GENERALIZED_TIME}
* DNSName -> {'__dns_name__': unicode}
The _ipa_obj_hook() functions unserializes the marked JSON objects to
bytes, datetime and DNSName.
:see: _ipa_obj_hook
)�version�
_cap_datetime�_cap_dnsnamec "