zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
U
[±dŒ<ã@s¬ddlmZddlmZmZddlmZddlZddlZGdd„de    ƒZ
Gdd    „d    ej ƒZ Gd
d „d ej ƒZ Gd d „d ej ƒZeGdd„dƒƒZeGdd„dƒƒZd@dddœdd„Zddœdd„Zdddœdd„ZdAddddddœdd „Zddd!œd"d#„Zdddd$œd%d&„Zdd'd(d)œd*d+„Zdd,d!œd-d.„Zdd'dd)œd/d0„Zddd!œd1d2„Zdd3dd4œd5d6„Zdd3dd7œd8d9„Zed:ƒeGd;d<„d<ƒƒƒZed=ƒeGd>d?„d?ƒƒƒZdS)Bé)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassNcs>eZdZddœdd„Zedddœdd„ƒZ‡fdd    „Z‡ZS)
ÚAuthenticatorIdÚstr©ÚreturncCs|S©N©©Úselfr r úhd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v112/web_authn.pyÚto_jsonszAuthenticatorId.to_json©Újsonr
cCs||ƒSr r ©Úclsrr r rÚ    from_jsonszAuthenticatorId.from_jsoncsd tƒ ¡¡S)NzAuthenticatorId({}))ÚformatÚsuperÚ__repr__r ©Ú    __class__r rrszAuthenticatorId.__repr__)Ú__name__Ú
__module__Ú __qualname__rÚ classmethodrrÚ __classcell__r r rrr src@s(eZdZdZdZdd„Zedd„ƒZdS)ÚAuthenticatorProtocolZu2fZctap2cCs|jSr ©Úvaluer r r rrszAuthenticatorProtocol.to_jsoncCs||ƒSr r rr r rr szAuthenticatorProtocol.from_jsonN)rrrZU2FZCTAP2rrrr r r rr s
r c@s(eZdZdZdZdd„Zedd„ƒZdS)Ú Ctap2VersionZctap2_0Zctap2_1cCs|jSr r!r r r rr)szCtap2Version.to_jsoncCs||ƒSr r rr r rr,szCtap2Version.from_jsonN)rrrZCTAP2_0ZCTAP2_1rrrr r r rr#%s
r#c@s4eZdZdZdZdZdZdZdd„Ze    dd    „ƒZ
d
S) ÚAuthenticatorTransportZusbZnfcZbleZcableZinternalcCs|jSr r!r r r rr8szAuthenticatorTransport.to_jsoncCs||ƒSr r rr r rr;sz AuthenticatorTransport.from_jsonN) rrrZUSBÚNFCZBLEZCABLEZINTERNALrrrr r r rr$1sr$c@sžeZdZUded<ded<dZded<dZded    <dZded
<dZded <dZded <dZ    ded <dZ
ded<dZ ded<dZ ded<dd„Z edd„ƒZdS)ÚVirtualAuthenticatorOptionsr Úprotocolr$Ú    transportNztyping.Optional[Ctap2Version]Ú ctap2_versionútyping.Optional[bool]Úhas_resident_keyÚhas_user_verificationÚhas_large_blobÚ has_cred_blobÚhas_min_pin_lengthÚhas_prfÚautomatic_presence_simulationÚis_user_verifiedcCsÞtƒ}|j ¡|d<|j ¡|d<|jdk    r:|j ¡|d<|jdk    rN|j|d<|jdk    rb|j|d<|jdk    rv|j|d<|jdk    rŠ|j|d<|j    dk    rž|j    |d<|j
dk    r²|j
|d    <|j dk    rÆ|j |d
<|j dk    rÚ|j |d <|S) Nr'r(Ú ctap2VersionÚhasResidentKeyÚhasUserVerificationÚ hasLargeBlobÚ hasCredBlobÚhasMinPinLengthÚhasPrfÚautomaticPresenceSimulationÚisUserVerified) Údictr'rr(r)r+r,r-r.r/r0r1r2©rrr r rrks,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
z#VirtualAuthenticatorOptions.to_jsoncCsè|t |d¡t |d¡d|kr0t |d¡ndd|krFt|dƒndd|kr\t|dƒndd|krrt|dƒndd|krˆt|dƒndd|kržt|dƒndd    |kr´t|d    ƒndd
|krÊt|d
ƒndd |kràt|d ƒndd  S) Nr'r(r3r4r5r6r7r8r9r:r;) r'r(r)r+r,r-r.r/r0r1r2)r rr$r#Úboolrr r rrƒs  õz%VirtualAuthenticatorOptions.from_json)rrrÚ__annotations__r)r+r,r-r.r/r0r1r2rrrr r r rr&@s
         r&c@sfeZdZUded<ded<ded<ded<dZd    ed
<dZd    ed <dZd    ed <d d„Zedd„ƒZ    dS)Ú
CredentialrÚ credential_idr>Úis_resident_credentialÚ private_keyÚintÚ
sign_countNztyping.Optional[str]Úrp_idÚ user_handleÚ
large_blobcCsntƒ}|j|d<|j|d<|j|d<|j|d<|jdk    rB|j|d<|jdk    rV|j|d<|jdk    rj|j|d<|S)NÚ credentialIdÚisResidentCredentialÚ
privateKeyÚ    signCountÚrpIdÚ
userHandleÚ    largeBlob)r<rArBrCrErFrGrHr=r r rr®s
 
 
 
 
 
 
 
 
 
zCredential.to_jsonc
Csr|t|dƒt|dƒt|dƒt|dƒd|kr>t|dƒndd|krTt|dƒndd|krjt|dƒnddS)    NrIrJrKrLrMrNrO)rArBrCrErFrGrH)rr>rDrr r rr¼s
 
 
 
ùzCredential.from_json)
rrrr?rFrGrHrrrr r r rr@”s
   r@r*z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Ú    enable_uir
ccs*tƒ}|dk    r||d<d|dœ}|V}dS)a¾
    Enable the WebAuthn domain and start intercepting credential storage and
    retrieval with a virtual authenticator.
 
    :param enable_ui: *(Optional)* Whether to enable the WebAuthn user interface. Enabling the UI is recommended for debugging and demo purposes, as it is closer to the real experience. Disabling the UI is recommended for automated testing. Supported at the embedder's discretion if UI is available. Defaults to false.
    NZenableUIzWebAuthn.enable©ÚmethodÚparams)r<)rPrSÚcmd_dictrr r rÚenableÉs    þrUr    ccsddi}|V}dS)z&
    Disable the WebAuthn domain.
    rRzWebAuthn.disableNr )rTrr r rÚdisableÜsÿrVz;typing.Generator[T_JSON_DICT, T_JSON_DICT, AuthenticatorId])Úoptionsr
ccs0tƒ}| ¡|d<d|dœ}|V}t |d¡S)zW
    Creates and adds a virtual authenticator.
 
    :param options:
    :returns: 
    rWz WebAuthn.addVirtualAuthenticatorrQÚauthenticatorId)r<rrr)rWrSrTrr r rÚadd_virtual_authenticatoræs     þrY)Úauthenticator_idÚis_bogus_signatureÚ    is_bad_uvÚ    is_bad_upr
ccsVtƒ}| ¡|d<|dk    r"||d<|dk    r2||d<|dk    rB||d<d|dœ}|V}dS)aE
    Resets parameters isBogusSignature, isBadUV, isBadUP to false if they are not present.
 
    :param authenticator_id:
    :param is_bogus_signature: *(Optional)* If isBogusSignature is set, overrides the signature in the authenticator response to be zero. Defaults to false.
    :param is_bad_uv: *(Optional)* If isBadUV is set, overrides the UV bit in the flags in the authenticator response to be zero. Defaults to false.
    :param is_bad_up: *(Optional)* If isBadUP is set, overrides the UP bit in the flags in the authenticator response to be zero. Defaults to false.
    rXNZisBogusSignatureZisBadUVZisBadUPz WebAuthn.setResponseOverrideBitsrQ©r<r)rZr[r\r]rSrTrr r rÚset_response_override_bitsùs þr_)rZr
ccs&tƒ}| ¡|d<d|dœ}|V}dS)zH
    Removes the given authenticator.
 
    :param authenticator_id:
    rXz#WebAuthn.removeVirtualAuthenticatorrQNr^©rZrSrTrr r rÚremove_virtual_authenticators  þra)rZÚ
credentialr
ccs2tƒ}| ¡|d<| ¡|d<d|dœ}|V}dS)zr
    Adds the credential to the specified authenticator.
 
    :param authenticator_id:
    :param credential:
    rXrbzWebAuthn.addCredentialrQNr^)rZrbrSrTrr r rÚadd_credential's
  þrcrz6typing.Generator[T_JSON_DICT, T_JSON_DICT, Credential])rZrAr
ccs8tƒ}| ¡|d<||d<d|dœ}|V}t |d¡S)zº
    Returns a single credential stored in the given virtual authenticator that
    matches the credential ID.
 
    :param authenticator_id:
    :param credential_id:
    :returns: 
    rXrIzWebAuthn.getCredentialrQrb)r<rr@r©rZrArSrTrr r rÚget_credential;s  þrezCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Credential]]ccs4tƒ}| ¡|d<d|dœ}|V}dd„|dDƒS)z}
    Returns all the credentials stored in the given virtual authenticator.
 
    :param authenticator_id:
    :returns: 
    rXzWebAuthn.getCredentialsrQcSsg|]}t |¡‘qSr )r@r)Ú.0Úir r rÚ
<listcomp>bsz#get_credentials.<locals>.<listcomp>Ú credentialsr^r`r r rÚget_credentialsRs     þrjccs.tƒ}| ¡|d<||d<d|dœ}|V}dS)zn
    Removes a credential from the authenticator.
 
    :param authenticator_id:
    :param credential_id:
    rXrIzWebAuthn.removeCredentialrQNr^rdr r rÚremove_credentiales
 þrkccs&tƒ}| ¡|d<d|dœ}|V}dS)z]
    Clears all the credentials from the specified device.
 
    :param authenticator_id:
    rXzWebAuthn.clearCredentialsrQNr^r`r r rÚclear_credentialsys  þrlr>)rZr2r
ccs.tƒ}| ¡|d<||d<d|dœ}|V}dS)z¤
    Sets whether User Verification succeeds or fails for an authenticator.
    The default is true.
 
    :param authenticator_id:
    :param is_user_verified:
    rXr;zWebAuthn.setUserVerifiedrQNr^)rZr2rSrTrr r rÚset_user_verifiedŠs  þrm)rZÚenabledr
ccs.tƒ}| ¡|d<||d<d|dœ}|V}dS)zÏ
    Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator.
    The default is true.
 
    :param authenticator_id:
    :param enabled:
    rXrnz'WebAuthn.setAutomaticPresenceSimulationrQNr^)rZrnrSrTrr r rÚ!set_automatic_presence_simulationŸs  þrozWebAuthn.credentialAddedc@s6eZdZUdZded<ded<edddœdd    „ƒZd
S) ÚCredentialAddedzC
    Triggered when a credential is added to an authenticator.
    rrZr@rbrrcCs |t |d¡t |d¡dS©NrXrb)rZrb©rrr@rr r rr½s  þzCredentialAdded.from_jsonN©rrrÚ__doc__r?rrr r r rrp´s
 
rpzWebAuthn.credentialAssertedc@s6eZdZUdZded<ded<edddœdd    „ƒZd
S) ÚCredentialAssertedzF
    Triggered when a credential is used in a webauthn assertion.
    rrZr@rbrrcCs |t |d¡t |d¡dSrqrrrr r rrÎs  þzCredentialAsserted.from_jsonNrsr r r rruÅs
 
ru)N)NNN)Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingrrÚEnumr r#r$r&r@rUrVrYr_rarcrerjrkrlrmrorprur r r rÚ<module>sD     S5ÿ
ü