A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/seleniumhq/selenium/commit/e12972ec0fc02cc7bf7b8cc5a38f30bc1252e263 below:

fix alot of `mypy` complaints · SeleniumHQ/selenium@e12972e · GitHub

@@ -64,8 +64,8 @@ def __init__(self) -> None:

64 64

- isUserVerified: False

65 65

"""

66 66 67 -

self._protocol: Literal = Protocol.CTAP2

68 -

self._transport: Literal = Transport.USB

67 +

self._protocol: Protocol = Protocol.CTAP2

68 +

self._transport: Transport = Transport.USB

69 69

self._has_resident_key: bool = False

70 70

self._has_user_verification: bool = False

71 71

self._is_user_consenting: bool = True

@@ -88,38 +88,38 @@ def transport(self, transport: Transport) -> None:

88 88

self._transport = transport

89 89 90 90

@property

91 -

def has_resident_key(self) -> None:

91 +

def has_resident_key(self) -> bool:

92 92

return self._has_resident_key

93 93 94 94

@has_resident_key.setter

95 95

def has_resident_key(self, value: bool) -> None:

96 96

self._has_resident_key = value

97 97 98 98

@property

99 -

def has_user_verification(self) -> None:

99 +

def has_user_verification(self) -> bool:

100 100

return self._has_user_verification

101 101 102 102

@has_user_verification.setter

103 103

def has_user_verification(self, value: bool) -> None:

104 104

self._has_user_verification = value

105 105 106 106

@property

107 -

def is_user_consenting(self) -> None:

107 +

def is_user_consenting(self) -> bool:

108 108

return self._is_user_consenting

109 109 110 110

@is_user_consenting.setter

111 111

def is_user_consenting(self, value: bool) -> None:

112 112

self._is_user_consenting = value

113 113 114 114

@property

115 -

def is_user_verified(self) -> None:

115 +

def is_user_verified(self) -> bool:

116 116

return self._is_user_verified

117 117 118 118

@is_user_verified.setter

119 119

def is_user_verified(self, value: bool) -> None:

120 120

self._is_user_verified = value

121 121 122 -

def to_dict(self) -> dict:

122 +

def to_dict(self) -> typing.Dict[str, typing.Any]:

123 123

return {

124 124

"protocol": self.protocol,

125 125

"transport": self.transport,

@@ -131,7 +131,7 @@ def to_dict(self) -> dict:

131 131 132 132 133 133

class Credential:

134 -

def __init__(self, credential_id: bytes, is_resident_credential: bool, rp_id: str, user_handle: bytes, private_key: bytes, sign_count: int):

134 +

def __init__(self, credential_id: bytes, is_resident_credential: bool, rp_id: str, user_handle: typing.Optional[bytes], private_key: bytes, sign_count: int):

135 135

"""Constructor. A credential stored in a virtual authenticator.

136 136

https://w3c.github.io/webauthn/#credential-parameters

137 137

@@ -151,29 +151,29 @@ def __init__(self, credential_id: bytes, is_resident_credential: bool, rp_id: st

151 151

self._sign_count = sign_count

152 152 153 153

@property

154 -

def id(self):

154 +

def id(self) -> str:

155 155

return urlsafe_b64encode(self._id).decode()

156 156 157 157

@property

158 158

def is_resident_credential(self) -> bool:

159 159

return self._is_resident_credential

160 160 161 161

@property

162 -

def rp_id(self):

162 +

def rp_id(self) -> str:

163 163

return self._rp_id

164 164 165 165

@property

166 -

def user_handle(self):

166 +

def user_handle(self) -> typing.Optional[str]:

167 167

if self._user_handle:

168 168

return urlsafe_b64encode(self._user_handle).decode()

169 169

return None

170 170 171 171

@property

172 -

def private_key(self):

172 +

def private_key(self) -> str:

173 173

return urlsafe_b64encode(self._private_key).decode()

174 174 175 175

@property

176 -

def sign_count(self):

176 +

def sign_count(self) -> int:

177 177

return self._sign_count

178 178 179 179

@classmethod

@@ -192,7 +192,7 @@ def create_non_resident_credential(cls, id: bytes, rp_id: str, private_key: byte

192 192

return cls(id, False, rp_id, None, private_key, sign_count)

193 193 194 194

@classmethod

195 -

def create_resident_credential(cls, id: bytes, rp_id: str, user_handle: bytes, private_key: bytes, sign_count: int) -> 'Credential':

195 +

def create_resident_credential(cls, id: bytes, rp_id: str, user_handle: typing.Optional[bytes], private_key: bytes, sign_count: int) -> 'Credential':

196 196

"""Creates a resident (i.e. stateful) credential.

197 197 198 198

:Args:

@@ -207,7 +207,7 @@ def create_resident_credential(cls, id: bytes, rp_id: str, user_handle: bytes, p

207 207

"""

208 208

return cls(id, True, rp_id, user_handle, private_key, sign_count)

209 209 210 -

def to_dict(self):

210 +

def to_dict(self) -> typing.Dict[str, typing.Any]:

211 211

credential_data = {

212 212

'credentialId': self.id,

213 213

'isResidentCredential': self._is_resident_credential,

@@ -222,7 +222,7 @@ def to_dict(self):

222 222

return credential_data

223 223 224 224

@classmethod

225 -

def from_dict(cls, data):

225 +

def from_dict(cls, data: typing.Dict[str, typing.Any]) -> 'Credential':

226 226

_id = urlsafe_b64decode(f"{data['credentialId']}==")

227 227

is_resident_credential = bool(data['isResidentCredential'])

228 228

rp_id = data.get('rpId', None)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4