brynq-sdk-acerta 1.1.1__py3-none-any.whl → 1.1.3__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.
@@ -39,7 +39,7 @@ class Acerta(BrynQ):
39
39
 
40
40
  # Extract credentials and configure OAuth2 session with automatic token renewal
41
41
  credentials = self.interfaces.credentials.get(
42
- system="acerta-acceptance",
42
+ system="acerta",
43
43
  system_type=system_type,
44
44
  )
45
45
  data = credentials.get("data", {})
@@ -66,6 +66,8 @@ class Acerta(BrynQ):
66
66
  include_client_id=True,
67
67
  )
68
68
 
69
+ self._refreshing_token = False
70
+
69
71
  # Keep access_token attribute for backward compatibility
70
72
  self.access_token = token.get("access_token")
71
73
 
@@ -101,17 +103,23 @@ class Acerta(BrynQ):
101
103
 
102
104
  def _ensure_valid_token(self):
103
105
  """Ensure the OAuth token exists and is not about to expire."""
106
+ if self._refreshing_token:
107
+ return
104
108
  tok = getattr(self.session, "token", {}) or {}
105
109
  expires_at = tok.get("expires_at")
106
110
  # Refresh if missing or expiring within 30 seconds
107
111
  if not expires_at or (expires_at - time.time()) < 30:
108
- new_token = self.session.fetch_token(
109
- token_url=self._token_url,
110
- client_id=self._client_id,
111
- client_secret=self._client_secret,
112
- include_client_id=True,
113
- )
114
- self.access_token = new_token.get("access_token")
112
+ self._refreshing_token = True
113
+ try:
114
+ new_token = self.session.fetch_token(
115
+ token_url=self._token_url,
116
+ client_id=self._client_id,
117
+ client_secret=self._client_secret,
118
+ include_client_id=True,
119
+ )
120
+ self.access_token = new_token.get("access_token")
121
+ finally:
122
+ self._refreshing_token = False
115
123
 
116
124
  def _request_with_pre_expiry(self, method, url, **kwargs):
117
125
  self._ensure_valid_token()
@@ -47,6 +47,9 @@ class Addresses:
47
47
  params=params,
48
48
  timeout=self.acerta.TIMEOUT,
49
49
  )
50
+
51
+ if response.status_code == 404:
52
+ continue
50
53
  response.raise_for_status()
51
54
  content = response.json()
52
55
  df = pd.json_normalize(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brynq_sdk_acerta
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: Acerta wrapper from BrynQ
5
5
  Author: BrynQ
6
6
  Author-email: support@brynq.com
@@ -1,6 +1,6 @@
1
1
  brynq_sdk_acerta/__init__.py,sha256=uxM4dKGu7ANRxzliEsBxa13g9AqGJdM8_agTAzWL4-Y,490
2
- brynq_sdk_acerta/acerta.py,sha256=kFbyYeZ5rW3uDznrG-2e7XrhuSHX24MD8Bas1ucz4a0,4496
3
- brynq_sdk_acerta/addresses.py,sha256=9O7pfIMpqPA2usA3BsufPygE1JiKYhmTeYD3zAbzFQo,3127
2
+ brynq_sdk_acerta/acerta.py,sha256=fCEbzEiqVbw1fovrx85KdlhBSw_i3a3Gah0a5OtetTQ,4734
3
+ brynq_sdk_acerta/addresses.py,sha256=nmOEK_QitKIAvmg_842xxDlGknSaV7brOuj19TnKVPk,3176
4
4
  brynq_sdk_acerta/agreements.py,sha256=AvWDzPs5bzX0CzahmaariPBOAwa4-h6wOfdLtQlv2hA,15366
5
5
  brynq_sdk_acerta/bank_accounts.py,sha256=IU0sP55wB7IFieniZHli16Rmb5QsBvYf43gQlQQABh0,3322
6
6
  brynq_sdk_acerta/code_lists.py,sha256=W1vJOvX5TTawhEMihHm8_Si40F05CoY8bQ4-28WHbu4,9161
@@ -28,7 +28,7 @@ brynq_sdk_acerta/schemas/in_service.py,sha256=wIdDvPuICj4EM1oDjEEXO1htgaT7O4Qw4F
28
28
  brynq_sdk_acerta/schemas/in_service_config.py,sha256=tco-OeuIU5AQ8Yyop2r2rzxTLitCIPoXXNTZ2XRseH8,953
29
29
  brynq_sdk_acerta/schemas/planning.py,sha256=mdCtEkAcQc18EdtTTuiMUcH8_XXROqIUyvFhsV933Gg,1283
30
30
  brynq_sdk_acerta/schemas/salaries.py,sha256=om4C5GBDj4nW96CWN6VZhbdJ0BQ6YogKBqqTn4ogSBc,5490
31
- brynq_sdk_acerta-1.1.1.dist-info/METADATA,sha256=beVj3va00BkmTBeoLMvffyc3-AF-R_meqFV_wKEPOyk,534
32
- brynq_sdk_acerta-1.1.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
33
- brynq_sdk_acerta-1.1.1.dist-info/top_level.txt,sha256=y501RQac1VmGHCF0Web7Dydy_Vyt_7YoenN39HiVDtE,17
34
- brynq_sdk_acerta-1.1.1.dist-info/RECORD,,
31
+ brynq_sdk_acerta-1.1.3.dist-info/METADATA,sha256=UO039X898LrbVhsKp0VgdldXSaxPfQ70mV-reuWz5Sw,534
32
+ brynq_sdk_acerta-1.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
33
+ brynq_sdk_acerta-1.1.3.dist-info/top_level.txt,sha256=y501RQac1VmGHCF0Web7Dydy_Vyt_7YoenN39HiVDtE,17
34
+ brynq_sdk_acerta-1.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5