Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions airbyte_cdk/sources/declarative/auth/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import logging
from dataclasses import InitVar, dataclass, field
from datetime import datetime, timedelta
from typing import Any, List, Mapping, MutableMapping, Optional, Union
from typing import Any, List, Mapping, Optional, Union

from airbyte_cdk.sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator
from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
Expand All @@ -19,6 +20,8 @@
)
from airbyte_cdk.utils.datetime_helpers import AirbyteDateTime, ab_datetime_now, ab_datetime_parse

logger = logging.getLogger("airbyte")


@dataclass
class DeclarativeOauth2Authenticator(AbstractOauth2Authenticator, DeclarativeAuthenticator):
Expand Down Expand Up @@ -201,7 +204,10 @@ def get_client_secret(self) -> str:
self._client_secret.eval(self.config) if self._client_secret else self._client_secret
)
if not client_secret:
raise ValueError("OAuthAuthenticator was unable to evaluate client_secret parameter")
# We've seen some APIs allowing empty client_secret so we will only log here
logger.warning(
"OAuthAuthenticator was unable to evaluate client_secret parameter hence it'll be empty"
)
return client_secret # type: ignore # value will be returned as a string, or an error will be raised

def get_refresh_token_name(self) -> str:
Expand Down
Loading