fix(cdk): improve OAuth error messages in DeclarativeOauth2Authenticator#960
Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Draft
fix(cdk): improve OAuth error messages in DeclarativeOauth2Authenticator#960devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
Remove internal class name 'OAuthAuthenticator' from user-facing error messages and warnings. Replace vague language with specific, actionable descriptions following the writing-good-error-messages guidelines. Changes: - get_client_secret(): Replace warning with clear description that client_secret resolved to empty value - get_client_id(): Replace error with descriptive message about empty client_id resolution - get_token_refresh_endpoint(): Replace error with descriptive message about empty endpoint resolution - __post_init__(): Replace validation errors to remove class name leakage Co-Authored-By: bot_apk <apk@cognition.ai>
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/1774353383-improve-oauth-error-messages#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/1774353383-improve-oauth-error-messagesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
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.
Summary
Improves user-facing error and warning messages in
DeclarativeOauth2Authenticatorby removing internal class name leakage ("OAuthAuthenticator") and replacing vague language with specific, actionable descriptions.All changes are string-only — no logic or control flow changes.
get_client_secret()(warning)"OAuthAuthenticator was unable to evaluate client_secret parameter hence it'll be empty""OAuth client_secret resolved to an empty value. If this is unexpected, verify the 'client_secret' in your connector configuration."get_client_id()"OAuthAuthenticator was unable to evaluate client_id parameter""OAuth client_id resolved to an empty value. Verify the 'client_id' in your connector configuration."get_token_refresh_endpoint()"OAuthAuthenticator was unable to evaluate token_refresh_endpoint parameter""OAuth token refresh endpoint resolved to an empty value. Verify the 'token_refresh_endpoint' in your connector configuration."__post_init__()(3 validators)"OAuthAuthenticator configuration error: ...""OAuth configuration is missing/incomplete. ..."Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/16098
Related to https://github.com/airbytehq/oncall/issues/11312
Review & Testing Checklist for Human
airbyteandairbyte-platform-internalrepos for"OAuthAuthenticator was unable"or"OAuthAuthenticator configuration error"to confirm nothing catches theseValueErrormessages by string content.client_secretwarning stays as warning-only: The issue notes that some APIs (e.g., Bing Ads public client OAuth) legitimately allow emptyclient_secret. Confirm that keeping this aslogger.warning()rather than raising an exception is the correct behavior.Notes
client_secretempty case is intentionally kept as a warning (not an error) because public OAuth client flows legitimately omit client_secret. This is unchanged behavior — only the message text was improved.Link to Devin session: https://app.devin.ai/sessions/e66ccb78189644d2a21651edfd6e08e5