| Server IP : 172.67.201.108 / Your IP : 216.73.216.55 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7 System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.9/site-packages/cfnbootstrap/__pycache__/ |
Upload File : |
a
��Rj�, � @ s� d Z ddlZddlZddlmZ e�d�ZdZG dd� de�Z e
h d��Zeed �d
d�Z
eed �dd
�Zeed �dd�Zed�dd�Zdd�dd�Zedd�dd�Zedd�dd�Zee d�dd�ZdS )a0
OS dispatcher for the override CA install/trust subsystem.
Public surface:
ensure_ca_override_installed() -- safe + cheap to call from every cfn-*
entrypoint at process startup. Idempotent.
Linux: no-op (the existing _certs path
points the stdlib ssl module at the
override PEM file directly). Windows:
delegates to _ca_install_win.install_or_rotate
which installs/rotates trust in the
Windows cert stores via certutil.exe
subprocess calls.
CaOverrideError -- the single exception class raised by this
subsystem. Distinguish failure modes via
the .kind string attribute (NOT subclass).
cfn-* entrypoints MUST NOT catch this
error -- letting it terminate the process
with full traceback is the documented
behaviour so on-call sees the root cause.
Hard invariants enforced here:
* Never imports `ssl` or `OpenSSL`. The Windows path uses subprocess only.
* Linux behaviour is byte-for-byte unchanged: PEM absent => no-op; PEM
present => no-op (the request-time _certs.resolve_ca_bundle() already
hands the PEM to the stdlib ssl module).
* The no-override commercial Windows path is byte-for-byte unchanged:
missing PEM short-circuits BEFORE any hashing or install work.
* Inclusive language only (per the Inclusive Tech word list).
� N)�Optionalzcfn.initz[CaOverrideInstall]c sD e Zd ZdZeh d��Zeedd�� fdd�Zed�dd �Z� Z S )
�CaOverrideErrora� Single exception class for every failure in the override-CA subsystem.
Distinguish failure modes via the ``.kind`` string attribute (one of the
values listed in the design's section 4). Callers MUST NOT branch on the
exception subclass; branch on ``.kind`` only.
Attributes:
kind: One of the canonical kind strings.
message: Human-readable message. By convention starts with
``[CaOverrideInstall]`` and ends with operator-actionable guidance.
> Zclassify�concurrent_installZfipsZ
certutil_callZcert_not_foundZ pem_parseZcertutil_not_found�marker_writeZstate_fsZstore_not_writable�budget_exceededZ
pem_not_foundN)�kind�message�returnc s t � �|� || _|| _dS )z�Construct a CaOverrideError.
Args:
kind: Canonical kind string (see ``KINDS``).
message: Human-readable diagnostic for the operator.
N)�super�__init__r r )�selfr r �� __class__� �</usr/lib/python3.9/site-packages/cfnbootstrap/_ca_install.pyr [ s zCaOverrideError.__init__�r c C s d| j | jf S )Nz$CaOverrideError(kind=%r, message=%r))r r )r r r r �__repr__f s zCaOverrideError.__repr__)
�__name__�
__module__�__qualname__�__doc__� frozensetZKINDS�strr r �
__classcell__r r r
r r <