|
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 | 20 | ) |
20 | 21 | from airbyte_cdk.utils.datetime_helpers import AirbyteDateTime, ab_datetime_now, ab_datetime_parse |
21 | 22 |
|
| 23 | +logger = logging.getLogger("airbyte") |
22 | 24 |
|
23 | 25 | @dataclass |
24 | 26 | class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAuthenticator): |
@@ -201,7 +203,8 @@ def get_client_secret(self) -> str: |
201 | 203 | self._client_secret.eval(self.config) if self._client_secret else self._client_secret |
202 | 204 | ) |
203 | 205 | if not client_secret: |
204 | | - raise ValueError("OAuthAuthenticator was unable to evaluate client_secret parameter") |
| 206 | + # We've seen some APIs allowing empty client_secret so we will only log here |
| 207 | + logger.warning("OAuthAuthenticator was unable to evaluate client_secret parameter hence it'll be empty") |
205 | 208 | return client_secret # type: ignore # value will be returned as a string, or an error will be raised |
206 | 209 |
|
207 | 210 | def get_refresh_token_name(self) -> str: |
|
0 commit comments