Skip to content

feat(cdk): Add configurable OAuth scope property name (AI-Triage PR)#888

Draft
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1770023743-configurable-oauth-scopes-name
Draft

feat(cdk): Add configurable OAuth scope property name (AI-Triage PR)#888
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1770023743-configurable-oauth-scopes-name

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 2, 2026

feat(cdk): Add configurable OAuth scope property name (AI-Triage PR)

Summary

Adds a new scopes_name parameter to OAuth authenticators, allowing connector developers to configure the property name used for scopes in token refresh requests. Per RFC 6749, the default is now "scope" (singular), but some APIs require "scopes" (plural) or other custom names like the Cropster API.

Changes:

  • Added get_scopes_name() abstract method to AbstractOauth2Authenticator
  • Added scopes_name parameter to Oauth2Authenticator, SingleUseRefreshTokenOauth2Authenticator, and DeclarativeOauth2Authenticator
  • Updated declarative schema and factory to support the new parameter
  • Default value is "scope" (RFC 6749 compliant)

Updates since last revision

  • Fixed Ruff formatting in generated declarative_component_schema.py file
  • All CI checks now passing (Pytest Fast, Pytest Full across Python 3.10-3.13, MyPy, Ruff)

Review & Testing Checklist for Human

  • CRITICAL: Breaking change review - The default changed from "scopes" to "scope". Verify no existing connectors rely on the old default behavior. Search for connectors using OAuth that might break.
  • Verify the scopes_name parameter is correctly passed through all authenticator constructors (check SingleUseRefreshTokenOauth2Authenticator.__init__ passes it to super().__init__)
  • Review test changes in test_oauth.py and test_requests_native_auth.py to confirm they correctly test the new behavior

Recommended test plan:

  1. Create a test connector using OAuth with the default scopes_name and verify the token request uses "scope"
  2. Create a test connector with scopes_name: "scopes" and verify it uses "scopes" in the request
  3. Test with a real API that requires the non-standard scope parameter name

Notes

This PR was created as part of AI Triage for airbytehq/oncall#11127. Related closed issue: airbytehq/airbyte#54137.

The declarative_component_schema.py file contains formatting changes from the code generator that are unrelated to this feature - these are expected when regenerating the schema.

Link to Devin run: https://app.devin.ai/sessions/8764d877a8684a84844fd2b9c18e6ca4
Requested by: unknown ()

This change adds a new 'scopes_name' parameter to OAuth authenticators,
allowing connector developers to configure the property name used for
scopes in token refresh requests. Per RFC 6749, the default is 'scope'
(singular), but some APIs require 'scopes' (plural) or other custom names.

Changes:
- Add abstract get_scopes_name() method to AbstractOauth2Authenticator
- Add scopes_name parameter to Oauth2Authenticator (default: 'scope')
- Add scopes_name parameter to SingleUseRefreshTokenOauth2Authenticator
- Add scopes_name field to DeclarativeOauth2Authenticator
- Update declarative_component_schema.yaml with scopes_name property
- Update model_to_component_factory.py to pass scopes_name
- Update tests to reflect new default behavior

Resolves: airbytehq/oncall#11127
Related: airbytehq/airbyte#54137
Co-Authored-By: unknown <>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You 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/1770023743-configurable-oauth-scopes-name#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/1770023743-configurable-oauth-scopes-name

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

PyTest Results (Fast)

3 848 tests  ±0   3 836 ✅ ±0   6m 35s ⏱️ +7s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 11c1a0c. ± Comparison against base commit efad73e.

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

PyTest Results (Full)

3 851 tests  ±0   3 839 ✅ ±0   10m 49s ⏱️ -12s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 11c1a0c. ± Comparison against base commit efad73e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants