feat(source-google-calendar): add OAuth flow with credentials wrapper, config migration, and Service Account auth#76066
Conversation
|
Note 📝 PR Converted to Draft More info...Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy. As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page. To skip draft status in future PRs, please include |
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
|
434dbb8 to
db48437
Compare
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit e81ea6b. |
… with granular scopes
db48437 to
4939986
Compare
|
/publish-connectors-prerelease
|
…ls wrapper and config migration - Wrap client_id, client_secret, client_refresh_token_2 under a credentials object with oneOf auth type - Add predicate_key/predicate_value to advanced_auth for proper OAuth button rendering - Update path_in_connector_config to use credentials prefix - Add config_normalization_rules with ConfigMigration to transparently migrate old top-level configs - Update authenticator references to read from config.credentials - Update documentation to reflect new config structure Co-Authored-By: gl_serhii.lazebnyi <serglazebny@gmail.com>
Co-Authored-By: gl_serhii.lazebnyi <serglazebny@gmail.com>
…into single 0.0.39 row Co-Authored-By: gl_serhii.lazebnyi <serglazebny@gmail.com>
|
/publish-connectors-prerelease
|
…tiveAuthenticator to hide OAuth fields behind button Co-Authored-By: gl_serhii.lazebnyi <serglazebny@gmail.com>
|
/publish-connectors-prerelease
|
| | `calendarid` | `string` | Calendar Id. | | | ||
|
|
||
| ## Streams | ||
| | Stream Name | Primary Key | Pagination | Supports Full Sync | Supports Incremental | |
There was a problem hiding this comment.
[markdownlint-fix] reported by reviewdog 🐶
| | Stream Name | Primary Key | Pagination | Supports Full Sync | Supports Incremental | | |
| | Stream Name | Primary Key | Pagination | Supports Full Sync | Supports Incremental | |
What
Add
oauth_connector_input_specificationwith granular scopes to support the Granular OAuth Scopes project, and restructure the connector's spec so that OAuth fields (client_id,client_secret,client_refresh_token_2) are properly hidden behind the platform's "Authenticate" button instead of being rendered as bare input fields. Also adds Service Account Key authentication as a second auth type.Also replaces the placeholder connector icon with a Google Calendar icon.
References https://github.com/airbytehq/airbyte-internal-issues/issues/16023
How
client_id,client_secret, andclient_refresh_token_2inside acredentialsobject with aoneOfauth type selector containing two options: OAuth and Service Account Key (matching the pattern used bysource-google-sheetsand other Google connectors).SelectiveAuthenticator: Replaced the inlineOAuthAuthenticatoronbase_requesterwith aSelectiveAuthenticatorthat dispatches oncredentials.auth_type:Client→oauth_authenticator(OAuth refresh-token flow)Service→jwt_profile_assertion_oauth_authenticator(JWT profile assertion via service account key)advanced_auth: Addedpredicate_key: [credentials, auth_type]andpredicate_value: Clientso the platform UI renders the OAuth button correctly. Addedoauth_connector_input_specificationwith thecalendar.readonlyscope.path_in_connector_config: Updated all OAuth output paths to point tocredentials.client_id,credentials.client_secret, andcredentials.client_refresh_token_2.config_normalization_ruleswith aConfigMigrationthat transparently moves top-level OAuth fields into the nestedcredentialsobject for existing connections (so this is non-breaking for current users).Review guide
airbyte-integrations/connectors/source-google-calendar/manifest.yaml— all functional changes (authenticators, spec, config migration, advanced_auth)airbyte-integrations/connectors/source-google-calendar/metadata.yaml— version bump to 0.0.39docs/integrations/sources/google-calendar.md— updated config table and changelogairbyte-integrations/connectors/source-google-calendar/icon.svg— new iconsource-google-sheets. Google Calendar service accounts may require domain-wide delegation with asubject(the user email to impersonate) for accessing user-specific calendars. The current implementation does not include asubjectfield — verify whether this works or if asubjectproperty needs to be added to the Service Account oneOf option.oneOfoption (Service Account) is that the platform UI does not hidecomplete_oauth_server_output_specificationfields when there is only a singleoneOfoption. Confirm via prerelease thatclient_idandclient_secretare now hidden behind the "Authenticate" button.ConfigAddFields(condition: old top-level fields exist andcredentialsis absent), thenConfigRemoveFields(condition:credentialsis present). Confirm the CDK applies these transformations sequentially on the mutated config within a singleConfigMigration.User Impact
Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/7bbf775a6ee347c9a4ee771219c3e133
Requested by: Serhii Lazebnyi (@lazebnyi)