carconnectivity-connector-seatcupra 0.1.1__py3-none-any.whl → 0.1.2a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a1.dist-info}/METADATA +1 -1
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a1.dist-info}/RECORD +8 -8
- carconnectivity_connectors/seatcupra/_version.py +2 -2
- carconnectivity_connectors/seatcupra/auth/my_cupra_session.py +29 -17
- carconnectivity_connectors/seatcupra/auth/openid_session.py +2 -1
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a1.dist-info}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a1.dist-info}/WHEEL +0 -0
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a1.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
carconnectivity_connectors/seatcupra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
carconnectivity_connectors/seatcupra/_version.py,sha256=
|
2
|
+
carconnectivity_connectors/seatcupra/_version.py,sha256=VzTjVbsUC2B6Y5R_ncX3UCI-1y_cf0-27tYAHy1JsEY,513
|
3
3
|
carconnectivity_connectors/seatcupra/capability.py,sha256=936V06hOX8AuAMxL_S9wVyVa36Xw1bo9081X0xf5f94,5064
|
4
4
|
carconnectivity_connectors/seatcupra/charging.py,sha256=BJe_5GEB0JkP78tpU6kyKpwuwjDZHvm-kt3PTlpQHeU,3336
|
5
5
|
carconnectivity_connectors/seatcupra/climatization.py,sha256=0xxWlxrheAPzkVT8WRQtbm6ExZmVdgW7lUdOXyS_qWY,1695
|
@@ -8,14 +8,14 @@ carconnectivity_connectors/seatcupra/connector.py,sha256=llxFhVdpnL5MxmHbOej1wMi
|
|
8
8
|
carconnectivity_connectors/seatcupra/vehicle.py,sha256=s0G-HqG5qcwStDxD3649KgLMa3lKPZ4TOGWRJEuQzsQ,3403
|
9
9
|
carconnectivity_connectors/seatcupra/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
carconnectivity_connectors/seatcupra/auth/auth_util.py,sha256=Y81h8fGOMSMgPtE4wI_TI9WgE_s43uaPjRLBBINhj4g,4433
|
11
|
-
carconnectivity_connectors/seatcupra/auth/my_cupra_session.py,sha256=
|
12
|
-
carconnectivity_connectors/seatcupra/auth/openid_session.py,sha256=
|
11
|
+
carconnectivity_connectors/seatcupra/auth/my_cupra_session.py,sha256=SXO_77diYSmHN3KNSccDASk95Ko8uK5WWKSjIJNHrUA,13558
|
12
|
+
carconnectivity_connectors/seatcupra/auth/openid_session.py,sha256=pGdTSt2zMtPWD4EY8MoZTj8lT6_krfa1Xt3Fyh877FA,16972
|
13
13
|
carconnectivity_connectors/seatcupra/auth/session_manager.py,sha256=ZIDvC848T3fy6PgGqCl8A2SzaNhu2YG19Xam5kgp7SA,5635
|
14
14
|
carconnectivity_connectors/seatcupra/auth/vw_web_session.py,sha256=CcI6m68IyRs6WsMDu-IsW3Dj85vyGiMmxvFqNETMHO0,10929
|
15
15
|
carconnectivity_connectors/seatcupra/auth/helpers/blacklist_retry.py,sha256=f3wsiY5bpHDBxp7Va1Mv9nKJ4u3qnCHZZmDu78_AhMk,1251
|
16
16
|
carconnectivity_connectors/seatcupra/ui/connector_ui.py,sha256=SNYnlcGJpbWhuLiIHD2l6H9IfSiMz3IgmvXsdossDnE,1412
|
17
|
-
carconnectivity_connector_seatcupra-0.1.
|
18
|
-
carconnectivity_connector_seatcupra-0.1.
|
19
|
-
carconnectivity_connector_seatcupra-0.1.
|
20
|
-
carconnectivity_connector_seatcupra-0.1.
|
21
|
-
carconnectivity_connector_seatcupra-0.1.
|
17
|
+
carconnectivity_connector_seatcupra-0.1.2a1.dist-info/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
|
18
|
+
carconnectivity_connector_seatcupra-0.1.2a1.dist-info/METADATA,sha256=ii6XPx0SHu1N2SEXwPeDC-Pei__53Le9BlV08yKzRUw,5473
|
19
|
+
carconnectivity_connector_seatcupra-0.1.2a1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
20
|
+
carconnectivity_connector_seatcupra-0.1.2a1.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
|
21
|
+
carconnectivity_connector_seatcupra-0.1.2a1.dist-info/RECORD,,
|
@@ -72,12 +72,15 @@ class MyCupraSession(VWWebSession):
|
|
72
72
|
super(MyCupraSession, self).login()
|
73
73
|
# retrieve authorization URL
|
74
74
|
authorization_url_str: str = self.authorization_url(url='https://identity.vwgroup.io/oidc/v1/authorize')
|
75
|
-
|
76
|
-
|
75
|
+
if self.redirect_uri is not None and authorization_url_str.startswith(self.redirect_uri):
|
76
|
+
response = authorization_url_str.replace(self.redirect_uri + '#', 'https://egal?')
|
77
|
+
else:
|
78
|
+
# perform web authentication
|
79
|
+
response = self.do_web_auth(authorization_url_str)
|
77
80
|
# fetch tokens from web authentication response
|
78
81
|
if self.is_seat:
|
79
|
-
|
80
|
-
|
82
|
+
self.fetch_tokens('https://ola.prod.code.seat.cloud.vwgroup.com/authorization/api/v1/token',
|
83
|
+
authorization_response=response)
|
81
84
|
else:
|
82
85
|
self.fetch_tokens('https://identity.vwgroup.io/oidc/v1/token',
|
83
86
|
authorization_response=response)
|
@@ -226,18 +229,27 @@ class MyCupraSession(VWWebSession):
|
|
226
229
|
|
227
230
|
headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'
|
228
231
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
232
|
+
tries = 0
|
233
|
+
while True:
|
234
|
+
try:
|
235
|
+
# Request new tokens using the refresh token
|
236
|
+
token_response = self.post(
|
237
|
+
token_url,
|
238
|
+
data=body,
|
239
|
+
auth=auth,
|
240
|
+
timeout=timeout,
|
241
|
+
headers=headers,
|
242
|
+
verify=verify,
|
243
|
+
withhold_token=False, # pyright: ignore reportCallIssue
|
244
|
+
proxies=proxies,
|
245
|
+
access_type=AccessType.NONE # pyright: ignore reportCallIssue
|
246
|
+
)
|
247
|
+
except requests.exceptions.RequestException as err:
|
248
|
+
tries += 1
|
249
|
+
if tries >= 3:
|
250
|
+
raise TemporaryAuthenticationError('Token could not be refreshed due to temporary MyCupra failure') from err
|
251
|
+
else:
|
252
|
+
break
|
241
253
|
if token_response.status_code == requests.codes['unauthorized']:
|
242
254
|
raise AuthenticationError('Refreshing tokens failed: Server requests new authorization')
|
243
255
|
elif token_response.status_code in (requests.codes['internal_server_error'], requests.codes['service_unavailable'], requests.codes['gateway_timeout']):
|
@@ -263,7 +275,7 @@ class MyCupraSession(VWWebSession):
|
|
263
275
|
token=None,
|
264
276
|
timeout=None,
|
265
277
|
**kwargs
|
266
|
-
):
|
278
|
+
) -> requests.Response:
|
267
279
|
"""Intercept all requests and add userId if present."""
|
268
280
|
if not is_secure_transport(url):
|
269
281
|
raise InsecureTransportError()
|
@@ -116,7 +116,8 @@ class OpenIDSession(requests.Session):
|
|
116
116
|
backoff_factor=0.1,
|
117
117
|
status_forcelist=[500],
|
118
118
|
status_blacklist=[429],
|
119
|
-
raise_on_status=False
|
119
|
+
raise_on_status=False,
|
120
|
+
allowed_methods=None) # set allowed_methods to None to retry on all methods
|
120
121
|
self.mount('https://', HTTPAdapter(max_retries=retries))
|
121
122
|
|
122
123
|
@property
|
File without changes
|
File without changes
|