o
    sh|                     @   s@   d dl mZ d dlZG dd deZG dd dZeddZdS )	    )OptionalNc                   @   s   e Zd ZdS )FeatureNotEnabledErrorN)__name__
__module____qualname__ r   r   I/var/www/html/env_mimamsha/lib/python3.10/site-packages/fido2/features.pyr   "   s    r   c                   @   s^   e Zd ZdedefddZedefddZejdedd	fd
dZddddZ	dddZ
d	S )_Featurenamedescc                 C   s   d | _ || _|| _d S )N)_enabled_name_desc)selfr
   r   r   r   r   __init__'   s   
z_Feature.__init__returnc                 C   s   |    | jdu S )NT)warnr   r   r   r   r   enabled,   s   
z_Feature.enabledvalueNc                 C   s*   | j d urt| j d| j  || _ d S )Nz" has already been configured with )r   
ValueErrorr   )r   r   r   r   r   r   1   s
   

Tc                 C   s,   | j |kr|   td| j d| d S )NzUsage requires z.enabled = )r   r   r   r   )r   stater   r   r   require9   s   
z_Feature.requirec                 C   s@   | j d u rtd| j d| j d| j d| j d	t d S d S )NzDeprecated use of a2  .

You are using deprecated functionality which will change in the next major version of
python-fido2. You can opt-in to use the new functionality now by adding the following
to your code somewhere where it gets executed prior to using the affected functionality:

  import fido2.features
  fido2.features.zy.enabled = True

To silence this warning but retain the current behavior, instead set enabled to False:
  fido2.features.z.enabled = False

z
            )r   warningsr   r   r   DeprecationWarningr   r   r   r   r   @   s   


z_Feature.warn)T)r   N)r   r   r   strr   propertyboolr   setterr   r   r   r   r   r   r	   &   s    r	   webauthn_json_mappinga  JSON values for WebAuthn data class Mapping interface.

This changes the keys and values used by the webauthn data classes when accessed using
the Mapping (dict) interface (eg. user_entity["id"] and the from_dict() methods) to be
JSON-friendly and align with the current draft of the next WebAuthn Level specification.
For the most part, this means that binary values (bytes) are represented as URL-safe
base64 encoded strings instead.
)typingr   r   	Exceptionr   r	   r   r   r   r   r   <module>   s   0