
    O                     d    d Z ddlZddlmZ ddlmZ ddlmZ d Z G d dej                        Zy)	z3Interface to handle end to end flow of U2F signing.    N)baseauthenticator)customauthenticator)localauthenticatorc                 l    t        j                  |       t        j                  |       g}t	        |      S N)r   CustomAuthenticatorr   LocalAuthenticatorCompositeAuthenticator)originauthenticatorss     2lib/third_party/pyu2f/convenience/authenticator.pyCreateCompositeAuthenticatorr      s1    ';;FC&99&AC.		//    c                   N    e Zd ZdZd Zej                  j                  fdZd Z	y)r
   zComposes multiple authenticators into a single authenticator.

  Priority is based on the order of the list initialized with the instance.
  c                     || _         y r   )r   )selfr   s     r   __init__zCompositeAuthenticator.__init__$   s
    (Dr   c                     | j                   D ])  }|j                         s|j                  |||      }|c S  t        d      )See base class.zNo valid authenticators found)r   IsAvailableAuthenticate
ValueError)r   app_idchallenge_dataprint_callbackauthenticatorresults         r   r   z#CompositeAuthenticator.Authenticate'   sM     ,,		"	"	$++F,:,:<  - 4
55r   c                      y)r   T )r   s    r   r   z"CompositeAuthenticator.IsAvailable3   s    r   N)
__name__
__module____qualname____doc__r   sysstderrwriter   r   r   r   r   r
   r
      s%    
) #&**"2"2
6r   r
   )	r#   r$   pyu2f.conveniencer   r   r   r   BaseAuthenticatorr
   r   r   r   <module>r)      s.    : 
 / 1 00.@@ r   