-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛Source Auth0 - Fix low code migration bugs (#29804)
Co-authored-by: marcosmarxm <[email protected]> Co-authored-by: sajarin <[email protected]>
- Loading branch information
1 parent
e82178f
commit db7a93e
Showing
7 changed files
with
115 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
airbyte-integrations/connectors/source-auth0/integration_tests/expected_records.jsonl
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
TEST_REQUIREMENTS = [ | ||
"pytest~=6.2", | ||
"pytest-mock~=3.6.1", | ||
"connector-acceptance-test", | ||
] | ||
|
||
setup( | ||
|
26 changes: 26 additions & 0 deletions
26
airbyte-integrations/connectors/source-auth0/source_auth0/components.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
from dataclasses import dataclass | ||
from typing import Any, Mapping | ||
|
||
from airbyte_cdk.sources.declarative.auth import DeclarativeOauth2Authenticator | ||
from airbyte_cdk.sources.declarative.auth.declarative_authenticator import DeclarativeAuthenticator | ||
from airbyte_cdk.sources.declarative.auth.token import BearerAuthenticator | ||
|
||
|
||
@dataclass | ||
class AuthenticatorAuth0(DeclarativeAuthenticator): | ||
config: Mapping[str, Any] | ||
bearer: BearerAuthenticator | ||
oauth: DeclarativeOauth2Authenticator | ||
|
||
def __new__(cls, bearer, oauth, config, *args, **kwargs): | ||
auth_type = config.get("credentials", {}).get("auth_type") | ||
if auth_type == "oauth2_access_token": | ||
return bearer | ||
elif auth_type == "oauth2_confidential_application": | ||
return oauth | ||
else: | ||
raise Exception("Not possible configure Auth method") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters