1
0
mirror of synced 2025-12-22 03:21:25 -05:00
Files
airbyte/airbyte-integrations/connectors/source-zendesk-sunshine/components.py
Tope Folorunso 58f21fd534 Source Zendesk Sunshine : Migrate to Manifest-only (#47327)
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Co-authored-by: ChristoGrab <christo.grab@gmail.com>
2024-11-08 21:27:58 +02:00

23 lines
706 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from dataclasses import dataclass
from typing import Any, Mapping
from airbyte_cdk.sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator
from airbyte_cdk.sources.declarative.auth.token import BasicHttpAuthenticator, BearerAuthenticator
@dataclass
class AuthenticatorZendeskSunshine(DeclarativeAuthenticator):
config: Mapping[str, Any]
basic_auth: BasicHttpAuthenticator
oauth2: BearerAuthenticator
def __new__(cls, basic_auth, oauth2, config, *args, **kwargs):
if config["credentials"]["auth_method"] == "api_token":
return basic_auth
else:
return oauth2