carconnectivity-connector-seatcupra 0.1.1__py3-none-any.whl → 0.1.2a2__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.2a2.dist-info}/METADATA +1 -1
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a2.dist-info}/RECORD +8 -8
- carconnectivity_connectors/seatcupra/_version.py +2 -2
- carconnectivity_connectors/seatcupra/auth/my_cupra_session.py +44 -23
- carconnectivity_connectors/seatcupra/auth/openid_session.py +2 -1
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a2.dist-info}/LICENSE +0 -0
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a2.dist-info}/WHEEL +0 -0
- {carconnectivity_connector_seatcupra-0.1.1.dist-info → carconnectivity_connector_seatcupra-0.1.2a2.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=kcEtUNV1MoltjNNCJ9JNa96CeRbiBTa6E9OHH2z9yL4,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=VF_9U8fESLkndVaPn2W1ZxZwNr9-ndeaegeTVT5FyYk,13904
|
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.2a2.dist-info/LICENSE,sha256=PIwI1alwDyOfvEQHdGCm2u9uf_mGE8030xZDfun0xTo,1071
|
18
|
+
carconnectivity_connector_seatcupra-0.1.2a2.dist-info/METADATA,sha256=Ob6zTmVEXHtW9XDNsSnm2um03RT0sARJVYkNcS1E7no,5473
|
19
|
+
carconnectivity_connector_seatcupra-0.1.2a2.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
20
|
+
carconnectivity_connector_seatcupra-0.1.2a2.dist-info/top_level.txt,sha256=KqA8GviZsDH4PtmnwSQsz0HB_w-TWkeEHLIRNo5dTaI,27
|
21
|
+
carconnectivity_connector_seatcupra-0.1.2a2.dist-info/RECORD,,
|
@@ -46,6 +46,7 @@ class MyCupraSession(VWWebSession):
|
|
46
46
|
|
47
47
|
self.headers = CaseInsensitiveDict({
|
48
48
|
'accept': '*/*',
|
49
|
+
'connection': 'keep-alive',
|
49
50
|
'content-type': 'application/json',
|
50
51
|
'user-agent': 'SEATApp/2.5.0 (com.seat.myseat.ola; build:202410171614; iOS 15.8.3) Alamofire/5.7.0 Mobile',
|
51
52
|
'accept-language': 'de-de',
|
@@ -62,6 +63,7 @@ class MyCupraSession(VWWebSession):
|
|
62
63
|
|
63
64
|
self.headers = CaseInsensitiveDict({
|
64
65
|
'accept': '*/*',
|
66
|
+
'connection': 'keep-alive',
|
65
67
|
'content-type': 'application/json',
|
66
68
|
'user-agent': 'CUPRAApp%20-%20Store/20220503 CFNetwork/1333.0.4 Darwin/21.5.0',
|
67
69
|
'accept-language': 'de-de',
|
@@ -72,12 +74,15 @@ class MyCupraSession(VWWebSession):
|
|
72
74
|
super(MyCupraSession, self).login()
|
73
75
|
# retrieve authorization URL
|
74
76
|
authorization_url_str: str = self.authorization_url(url='https://identity.vwgroup.io/oidc/v1/authorize')
|
75
|
-
|
76
|
-
|
77
|
+
if self.redirect_uri is not None and authorization_url_str.startswith(self.redirect_uri):
|
78
|
+
response = authorization_url_str.replace(self.redirect_uri + '#', 'https://egal?')
|
79
|
+
else:
|
80
|
+
# perform web authentication
|
81
|
+
response = self.do_web_auth(authorization_url_str)
|
77
82
|
# fetch tokens from web authentication response
|
78
83
|
if self.is_seat:
|
79
|
-
|
80
|
-
|
84
|
+
self.fetch_tokens('https://ola.prod.code.seat.cloud.vwgroup.com/authorization/api/v1/token',
|
85
|
+
authorization_response=response)
|
81
86
|
else:
|
82
87
|
self.fetch_tokens('https://identity.vwgroup.io/oidc/v1/token',
|
83
88
|
authorization_response=response)
|
@@ -217,27 +222,43 @@ class MyCupraSession(VWWebSession):
|
|
217
222
|
if headers is None:
|
218
223
|
headers = dict(self.headers)
|
219
224
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
225
|
+
if self.is_seat:
|
226
|
+
body: Dict[str, str] = {
|
227
|
+
'client_id': self.client_id,
|
228
|
+
'grant_type': 'refresh_token',
|
229
|
+
'refresh_token': self.refresh_token
|
230
|
+
}
|
231
|
+
else:
|
232
|
+
body: Dict[str, str] = {
|
233
|
+
'client_id': self.client_id,
|
234
|
+
'client_secret': 'eb8814e641c81a2640ad62eeccec11c98effc9bccd4269ab7af338b50a94b3a2',
|
235
|
+
'grant_type': 'refresh_token',
|
236
|
+
'refresh_token': self.refresh_token
|
237
|
+
}
|
226
238
|
|
227
239
|
headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'
|
228
240
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
+
tries = 0
|
242
|
+
while True:
|
243
|
+
try:
|
244
|
+
# Request new tokens using the refresh token
|
245
|
+
token_response = self.post(
|
246
|
+
token_url,
|
247
|
+
data=body,
|
248
|
+
auth=auth,
|
249
|
+
timeout=timeout,
|
250
|
+
headers=headers,
|
251
|
+
verify=verify,
|
252
|
+
withhold_token=False, # pyright: ignore reportCallIssue
|
253
|
+
proxies=proxies,
|
254
|
+
access_type=AccessType.NONE # pyright: ignore reportCallIssue
|
255
|
+
)
|
256
|
+
except requests.exceptions.RequestException as err:
|
257
|
+
tries += 1
|
258
|
+
if tries >= 3:
|
259
|
+
raise TemporaryAuthenticationError('Token could not be refreshed due to temporary MyCupra failure') from err
|
260
|
+
else:
|
261
|
+
break
|
241
262
|
if token_response.status_code == requests.codes['unauthorized']:
|
242
263
|
raise AuthenticationError('Refreshing tokens failed: Server requests new authorization')
|
243
264
|
elif token_response.status_code in (requests.codes['internal_server_error'], requests.codes['service_unavailable'], requests.codes['gateway_timeout']):
|
@@ -263,7 +284,7 @@ class MyCupraSession(VWWebSession):
|
|
263
284
|
token=None,
|
264
285
|
timeout=None,
|
265
286
|
**kwargs
|
266
|
-
):
|
287
|
+
) -> requests.Response:
|
267
288
|
"""Intercept all requests and add userId if present."""
|
268
289
|
if not is_secure_transport(url):
|
269
290
|
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
|