airbyte-cdk 6.48.4__py3-none-any.whl → 6.48.5__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.
@@ -2,9 +2,10 @@
2
2
  # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
3
  #
4
4
 
5
+ import logging
5
6
  from dataclasses import InitVar, dataclass, field
6
7
  from datetime import datetime, timedelta
7
- from typing import Any, List, Mapping, MutableMapping, Optional, Union
8
+ from typing import Any, List, Mapping, Optional, Union
8
9
 
9
10
  from airbyte_cdk.sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator
10
11
  from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
@@ -19,6 +20,8 @@ from airbyte_cdk.sources.streams.http.requests_native_auth.oauth import (
19
20
  )
20
21
  from airbyte_cdk.utils.datetime_helpers import AirbyteDateTime, ab_datetime_now, ab_datetime_parse
21
22
 
23
+ logger = logging.getLogger("airbyte")
24
+
22
25
 
23
26
  @dataclass
24
27
  class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAuthenticator):
@@ -30,7 +33,7 @@ class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAut
30
33
  Attributes:
31
34
  token_refresh_endpoint (Union[InterpolatedString, str]): The endpoint to refresh the access token
32
35
  client_id (Union[InterpolatedString, str]): The client id
33
- client_secret (Union[InterpolatedString, str]): Client secret
36
+ client_secret (Union[InterpolatedString, str]): Client secret (can be empty for APIs that support this)
34
37
  refresh_token (Union[InterpolatedString, str]): The token used to refresh the access token
35
38
  access_token_name (Union[InterpolatedString, str]): THe field to extract access token from in the response
36
39
  expires_in_name (Union[InterpolatedString, str]): The field to extract expires_in from in the response
@@ -201,8 +204,11 @@ class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAut
201
204
  self._client_secret.eval(self.config) if self._client_secret else self._client_secret
202
205
  )
203
206
  if not client_secret:
204
- raise ValueError("OAuthAuthenticator was unable to evaluate client_secret parameter")
205
- return client_secret # type: ignore # value will be returned as a string, or an error will be raised
207
+ # We've seen some APIs allowing empty client_secret so we will only log here
208
+ logger.warning(
209
+ "OAuthAuthenticator was unable to evaluate client_secret parameter hence it'll be empty"
210
+ )
211
+ return client_secret # type: ignore # value will be returned as a string, which might be empty
206
212
 
207
213
  def get_refresh_token_name(self) -> str:
208
214
  return self._refresh_token_name.eval(self.config) # type: ignore # eval returns a string in this context
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.48.4
3
+ Version: 6.48.5
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -75,7 +75,7 @@ airbyte_cdk/sources/declarative/async_job/timer.py,sha256=Fb8P72CQ7jIzJyzMSSNuBf
75
75
  airbyte_cdk/sources/declarative/auth/__init__.py,sha256=e2CRrcBWGhz3sQu3Oh34d1riEIwXipGS8hrSB1pu0Oo,284
76
76
  airbyte_cdk/sources/declarative/auth/declarative_authenticator.py,sha256=nf-OmRUHYG4ORBwyb5CANzuHEssE-oNmL-Lccn41Td8,1099
77
77
  airbyte_cdk/sources/declarative/auth/jwt.py,sha256=SICqNsN2Cn_EgKadIgWuZpQxuMHyzrMZD_2-Uwy10rY,8539
78
- airbyte_cdk/sources/declarative/auth/oauth.py,sha256=Uxh3EpIV0noe23e1j8efoegjk1d5B7xyVAFSaFtbwoQ,14127
78
+ airbyte_cdk/sources/declarative/auth/oauth.py,sha256=bCwf3f3Td_CA8DZ6CXMVPNiImM9QEGDxkcLKzSo3-f0,14339
79
79
  airbyte_cdk/sources/declarative/auth/selective_authenticator.py,sha256=qGwC6YsCldr1bIeKG6Qo-A9a5cTdHw-vcOn3OtQrS4c,1540
80
80
  airbyte_cdk/sources/declarative/auth/token.py,sha256=2EnE78EhBOY9hbeZnQJ9AuFaM-G7dccU-oKo_LThRQk,11070
81
81
  airbyte_cdk/sources/declarative/auth/token_provider.py,sha256=Jzuxlmt1_-_aFC_n0OmP8L1nDOacLzbEVVx3kjdX_W8,3104
@@ -408,9 +408,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
408
408
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
409
409
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
410
410
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
411
- airbyte_cdk-6.48.4.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
412
- airbyte_cdk-6.48.4.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
413
- airbyte_cdk-6.48.4.dist-info/METADATA,sha256=hXMMplkbvREua_CfMKw1NaOIGbD43pmoz1tURhdTUWg,6343
414
- airbyte_cdk-6.48.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
415
- airbyte_cdk-6.48.4.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
416
- airbyte_cdk-6.48.4.dist-info/RECORD,,
411
+ airbyte_cdk-6.48.5.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
412
+ airbyte_cdk-6.48.5.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
413
+ airbyte_cdk-6.48.5.dist-info/METADATA,sha256=Mdbaewbo-zumcLwTUWAY8jZoF_eFt3o73JXHtAC0WDU,6343
414
+ airbyte_cdk-6.48.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
415
+ airbyte_cdk-6.48.5.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
416
+ airbyte_cdk-6.48.5.dist-info/RECORD,,