feat(oauth): Add configurable token_refresh_request_type for GET-based OAuth APIs (AI-Triage PR)#919
Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
…d OAuth APIs Add token_refresh_request_type property to OAuthAuthenticator supporting: - body_data (default): POST with form-encoded body (standard OAuth2) - body_json: POST with JSON body - query_params: GET with query parameters (e.g., Marketo) This unblocks Connector Builder users from building connectors for APIs like Marketo that require GET requests to their OAuth token endpoint. Changes: - AbstractOauth2Authenticator: add get_token_refresh_request_type() and update _make_handled_request() to dispatch on request type - DeclarativeOauth2Authenticator: thread through token_refresh_request_type - declarative_component_schema.yaml: add token_refresh_request_type enum - declarative_component_schema.py: add Pydantic field - model_to_component_factory.py: wire through the new property Co-Authored-By: unknown <>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1772021224-oauth-token-refresh-request-type#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1772021224-oauth-token-refresh-request-typePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Full)3 872 tests 3 860 ✅ 11m 6s ⏱️ Results for commit fe97c73. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(oauth): Add configurable token_refresh_request_type for GET-based OAuth APIs
Summary
Adds a
token_refresh_request_typeproperty toOAuthAuthenticatorthat controls how the token refresh HTTP request is sent. Previously, the authenticator always usedPOSTwith a form-encoded body. Some APIs (e.g., Marketo's/identity/oauth/token) requireGETwith query parameters instead.Three modes are now supported:
body_data(default): POST with form-encoded body — existing behavior, fully backward-compatiblebody_json: POST with JSON bodyquery_params: GET with query parametersThe change threads through 5 files:
abstract_oauth.py— newget_token_refresh_request_type()method + request dispatch logic in_make_handled_request()declarative_component_schema.yaml— new enum property in the OAuthAuthenticator schemadeclarative_component_schema.py— corresponding Pydantic model field (hand-edited)oauth.py(declarative auth) — dataclass field + getter overridemodel_to_component_factory.py— wires the property when constructing the componentResolves https://github.com/airbytehq/oncall/issues/11436:
Review & Testing Checklist for Human
declarative_component_schema.pywas hand-edited. Verify whether this file should instead be regenerated from the YAML schema (e.g., viapoe assembleor a codegen script). Theenum=kwarg passed toField()may not enforce validation in Pydantic v2 — check that invalid values are actually rejected.token_refresh_request_type, it silently falls through to the defaultbody_data(POST form-encoded) branch. Consider whether an explicit error should be raised for unrecognized values._make_handled_request()(query_params, body_json, body_data) have no unit test coverage. Recommend adding tests that mockrequests.requestand verify the correct HTTP method and parameter encoding for each mode.token_refresh_request_typebehave identically to before (should default tobody_data/ POST with form-encoded body).Notes
ruff checkandmypy)