Repository navigation
Conversation
A key-pair embedded credential with a wrong passphrase or a body that is not a PEM key saved with a 200, then broke every embedded chart (sc-130269). Completeness was the only save-time check. Add BaseEngineSpec.get_embedded_credentials_error, a hook that says why a complete credential is unusable; Snowflake decodes the key there. The database schema and the validate-parameters command call it through embedded_credentials_error, which first restores masked secrets from the stored connection so that an untouched edit still saves. The message never quotes the key or its passphrase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… logged The embedded key pair is decoded in apply_embedded_credentials, before the engine and its handle_error listener exist, so a bad key surfaced as a raw ValueError and an HTTP 500 "Issue 1011" with no admin log line (sc-130269). Catch a failure to apply the embedded credential in _get_sqla_engine, log "Embedded fallback credential rejected" with the exception class only, and raise a 400 CONNECTION_ACCESS_DENIED_ERROR, which guest redaction turns into the same generic message a rejected password gives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## hughhhh/embedded-oauth2-fallback #45889 +/- ##
===================================================================
Coverage ? 65.04%
===================================================================
Files ? 3041
Lines ? 199005
Branches ? 46444
===================================================================
Hits ? 129445
Misses ? 66642
Partials ? 2918
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
An embedded guest credential that uses a key pair could be saved broken. With a wrong passphrase, or a private key that isn't PEM, the connection saved with a 200. Every embedded chart on it then failed with HTTP 500 "Issue 1011 – unexpected error". The server log showed a raw
ValueError: Incorrect password, could not decrypt keytraceback instead of the "Embedded fallback credential rejected" line an admin looks for. A wrong password already fails cleanly, with a 400 and a readable log line.The key is decoded in
apply_embedded_credentials, before the engine and itshandle_errorlistener exist, so the error never reached the existing rejection handling. Save time only checked that the fields were filled in.At save: a new engine-spec hook,
BaseEngineSpec.get_embedded_credentials_error, says why a complete credential can't be used (it does nothing by default). Snowflake loads the key there. The database API schema and the connection dialog's validate-parameters command both call it, so a bad key is refused with:The message never quotes the key or passphrase. On an edit, unchanged secrets arrive masked, so they are restored from the stored connection before the check. An untouched credential still saves, and a new passphrase is checked against the stored key.
At query time: if a key still fails (for example, one saved before this change),
_get_sqla_enginelogsEmbedded fallback credential rejected for database X (id=N): ValueError, with the exception class only. It then raises a 400CONNECTION_ACCESS_DENIED_ERROR. Guest redaction turns that into the same "An error occurred while fetching the data." a rejected password gives.I kept the key check out of
validate_embedded_credentialson purpose. That method is also the query-time gate, so making it reject a bad key would quietly drop the credential, show "no credential configured" and skip the admin log line.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (backend only).
TESTING INSTRUCTIONS
EMBEDDED_SUPERSETandEMBEDDED_CREDENTIAL_FALLBACK. Create a Snowflake connection with an OAuth2 client and "Impersonate logged in user" on.ValueErrortraceback. After: HTTP 400 with the generic message, and one "Embedded fallback credential rejected … ValueError" warning in the log.Unit tests, all using real generated keys:
ADDITIONAL INFORMATION
EMBEDDED_SUPERSET,EMBEDDED_CREDENTIAL_FALLBACKStacked on #45068: merging this lands the fix on that PR's branch.
Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code