HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/__pycache__/iamvirtmfa.cpython-38.pyc
U

<�^��@sddZddlZddlmZddlmZddlmZdZdZdeZGd	d
�d
e�Z	Gdd�de
�ZdS)
a\
This customization makes it easier to deal with the bootstrapping
data returned by the ``iam create-virtual-mfa-device`` command.
You can choose to bootstrap via a QRCode or via a Base32String.
You specify your choice via the ``--bootstrap-method`` option
which should be either "QRCodePNG" or "Base32StringSeed".  You
then specify the path to where you would like your bootstrapping
data saved using the ``--outfile`` option.  The command will
pull the appropriate data field out of the response and write it
to the specified file.  It will also remove the two bootstrap data
fields from the response.
�N)�StatefulArgument)�resolve_given_outfile_path)�is_parsed_result_successful)Z	QRCodePNGZBase32StringSeedzMThe output path and file name where the bootstrap information will be stored.zAMethod to use to seed the virtual MFA.  Valid values are: %s | %scseZdZ�fdd�Z�ZS)�FileArgumentcst|�}tt|��||�dS)N)r�superr�
add_to_params)�selfZ
parameters�value��	__class__��B/usr/lib/python3/dist-packages/awscli/customizations/iamvirtmfa.pyr)szFileArgument.add_to_params)�__name__�
__module__�__qualname__r�
__classcell__rrr
r
r'src@s$eZdZdd�Zdd�Zdd�ZdS)�IAMVMFAWrappercCsL||_tdtdd�|_tdttdd�|_|j�d|j	�|j�d|j
�dS)N�outfileT)�	help_text�required�bootstrap-method)r�choicesrz5building-argument-table.iam.create-virtual-mfa-devicez%after-call.iam.CreateVirtualMFADevice)Z_event_handlerr�OUTPUT_HELP�_outfiler�BOOTSTRAP_HELP�CHOICES�_method�register�_add_options�
_save_file)rZ
event_handlerrrr
�__init__2s(����zIAMVMFAWrapper.__init__cKs|j|d<|j|d<dS)Nrr)rr)rZargument_table�kwargsrrr
r?s
zIAMVMFAWrapper._add_optionsc	Ks~t|�sdS|jj}|jj}||dkrz|d|}t|d��}|�t�|��W5QRXtD]}||dkr^|d|=q^dS)NZVirtualMFADevice�wb)	rrr	r�open�write�base64Z	b64decoder)rZparsedr!�methodrZbody�fpZchoicerrr
rCszIAMVMFAWrapper._save_fileN)rrrr rrrrrr
r0s
r)�__doc__r%Zawscli.customizations.argumentsrrrrrrr�objectrrrrr
�<module>
s�