Skip to content

Commit 4b6c856

Browse files
committed
mlc: allow empty secrets (bing-ads)
1 parent a1dd40b commit 4b6c856

File tree

1 file changed

+5
-2
lines changed
  • airbyte_cdk/sources/declarative/auth

1 file changed

+5
-2
lines changed

airbyte_cdk/sources/declarative/auth/oauth.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
33
#
44

5+
import logging
56
from dataclasses import InitVar, dataclass, field
67
from datetime import datetime, timedelta
7-
from typing import Any, List, Mapping, MutableMapping, Optional, Union
8+
from typing import Any, List, Mapping, Optional, Union
89

910
from airbyte_cdk.sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator
1011
from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
@@ -19,6 +20,7 @@
1920
)
2021
from airbyte_cdk.utils.datetime_helpers import AirbyteDateTime, ab_datetime_now, ab_datetime_parse
2122

23+
logger = logging.getLogger("airbyte")
2224

2325
@dataclass
2426
class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAuthenticator):
@@ -201,7 +203,8 @@ def get_client_secret(self) -> str:
201203
self._client_secret.eval(self.config) if self._client_secret else self._client_secret
202204
)
203205
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")
205208
return client_secret # type: ignore # value will be returned as a string, or an error will be raised
206209

207210
def get_refresh_token_name(self) -> str:

0 commit comments

Comments
 (0)