File: //usr/lib/python3.6/site-packages/ipaclient/plugins/__pycache__/otptoken_yubikey.cpython-36.pyc
3
�d[e
�
@ s" d dl Z d dlZd dlmZmZmZ d dlmZmZ d dl m
Z
mZmZ d dl
mZ d dlmZ yd dlZd dlZW n" ek
r� eed�d��Y nX 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 �&/usr/lib/python3.6/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� fdd�Z� fdd�Zdd� Zdd� Z� ZS )�otptoken_add_yubikeyzAdd a new YubiKey OTP token.zslot?�slotzYubiKey slot� � )Zcli_nameZlabel�valuesc C s t jjd�tkS )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 # s@ x| j jjj� D ]
}|V qW xtt| �j� D ]
}|V q.W d S )N)r r r �args�superr �get_args)r �arg)� __class__r r r! ] s
zotptoken_add_yubikey.get_argsc # sJ x&| j jjj� D ]}|jd
kr|V qW xtt| �j� D ]
}|V q8W d S )N�type�ipatokenvendor�
ipatokenmodel�ipatokenserial�ipatokenotpalgorithm�ipatokenhotpcounter�ipatokenotpkey�ipatokentotpclockoffset�ipatokentotptimestep� no_qrcode�qrcode�version)r$ r% r&