Skip to content

Commit

Permalink
🐛 CDK: replace data with json when making OAuth calls (#27350)
Browse files Browse the repository at this point in the history
* Connector health: source hubspot, gitlab, snapchat-marketing: fix builds

* Airbyte CDK: replace data with json when making OAuth calls
  • Loading branch information
davydov-d authored Jun 14, 2023
1 parent ce5170d commit 780f441
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _get_refresh_access_token_response(self):
response = requests.request(
method="POST",
url=self.get_token_refresh_endpoint(),
data=self.build_refresh_request_body(),
json=self.build_refresh_request_body(),
headers={"Content-Type": "application/json"},
)
response.raise_for_status()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_set_token_expiry_date_no_format(self, mocker, expires_in_response, next
assert oauth.get_token_expiry_date() == pendulum.parse(next_day)


def mock_request(method, url, data, headers):
def mock_request(method, url, json, headers):
if url == "refresh_end" and headers == {"Content-Type": "application/json"}:
return resp
raise Exception(f"Error while refreshing access token with request: {method}, {url}, {data}, {headers}")
raise Exception(f"Error while refreshing access token with request: {method}, {url}, {json}, {headers}")
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def test_refresh_access_token(self, mocker, connector_config):
assert authenticator.refresh_access_token() == ("new_access_token", "42", "new_refresh_token")


def mock_request(method, url, data, headers):
def mock_request(method, url, json, headers):
if url == "refresh_end" and headers == {"Content-Type": "application/json"}:
return resp
raise Exception(f"Error while refreshing access token with request: {method}, {url}, {data}, {headers}")
raise Exception(f"Error while refreshing access token with request: {method}, {url}, {json}, {headers}")

0 comments on commit 780f441

Please sign in to comment.