Skip to content

Commit

Permalink
Reoved a duplicate method probably caused by merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rpopov committed Feb 8, 2025
1 parent 338d117 commit fabc665
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions unit_tests/sources/declarative/auth/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,45 +482,6 @@ def test_profile_assertion(self, mocker):
filtered = filter_secrets("access_token")
assert filtered == "****"

def test_profile_assertion(self, mocker):
with HttpMocker() as http_mocker:
jwt = JwtAuthenticator(
config={},
parameters={},
secret_key="test",
algorithm="HS256",
token_duration=1000,
typ="JWT",
iss="iss",
)

mocker.patch(
"airbyte_cdk.sources.declarative.auth.jwt.JwtAuthenticator.token",
new_callable=lambda: "token",
)

oauth = DeclarativeOauth2Authenticator(
token_refresh_endpoint="https://refresh_endpoint.com/",
config=config,
parameters={},
profile_assertion=jwt,
use_profile_assertion=True,
)
http_mocker.post(
HttpRequest(
url="https://refresh_endpoint.com/",
body="grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=token",
),
HttpResponse(body=json.dumps({"access_token": "access_token", "expires_in": 1000})),
)

token = oauth.refresh_access_token()

assert ("access_token", 1000) == token

filtered = filter_secrets("access_token")
assert filtered == "****"

def test_error_handling(self, mocker):
oauth = DeclarativeOauth2Authenticator(
token_refresh_endpoint="{{ config['refresh_endpoint'] }}",
Expand Down

0 comments on commit fabc665

Please sign in to comment.