File: //usr/lib/python3.9/site-packages/ipaclient/plugins/__pycache__/otptoken_yubikey.cpython-39.pyc
a
}�f� � @ s d dl Z d dlZd dlmZmZmZ d dlmZmZ d dl m
Z
mZmZ d dl
mZ d dlmZ zd dlZd dlZW n ey� eed�d��Y n0 ejr�eZed �ed
� ed� ed� ed
� Ze� ZdZedd�G dd� de��Zedd�G dd� de��Ze� G dd� de
��ZdS )� N)�_�api�IntEnum)�NotFound�SkipPluginModule)�Command�Method�Object)�Registry)�
classpropertyzpython-yubico is not installed.��reasonz
YubiKey Tokens
z
Manage YubiKey tokens.
zt
This code is an extension to the otptoken plugin and provides support for
reading/writing YubiKey tokens directly.
z
EXAMPLES:
zP
Add a new token:
ipa otptoken-add-yubikey --owner=jdoe --desc="My YubiKey"
ZotpT)Zno_failc @ s e Zd ZdZdS )�_fake_otptokenZotptokenN)�__name__�
__module__�__qualname__�name� r r �F/usr/lib/python3.9/site-packages/ipaclient/plugins/otptoken_yubikey.pyr ; s r c @ s e Zd ZdZdZdS )�_fake_otptoken_add�otptoken_addTN)r r r r �NO_CLIr r r r r @ s r c s� e Zd Zed�Zedded�dd�fZeZedd� �Z e
e �Zed d
� �Z
� fdd�Z� fd
d�Z� fdd�Zdd� Zdd� Z� ZS )�otptoken_add_yubikeyzAdd a new YubiKey OTP token.zslot?�slotzYubiKey slot)� � )Zcli_nameZlabel�valuesc C s t j�d�tu S )Nr )r r Z
get_pluginr )�clsr r r Z__NO_CLI_getterS s z$otptoken_add_yubikey.__NO_CLI_getterc C s | j jjjS �N)r r r �api_version��selfr r r r Y s z otptoken_add_yubikey.api_versionc # s8 | j jj�� D ]
}|V qtt| ��� D ]
}|V q(d S r )r r r �args�superr �get_args)r! �arg�� __class__r r r$ ] s zotptoken_add_yubikey.get_argsc # sB | j jj�� D ]}|jdvr|V qtt| ��� D ]
}|V q2d S )N)�type�ipatokenvendor�
ipatokenmodel�ipatokenserial�ipatokenotpalgorithm�ipatokenhotpcounter�ipatokenotpkeyZipatokentotpclockoffsetZipatokentotptimestep� no_qrcodeZqrcode�version)r r r �optionsr r# r �get_options)r! �optionr&