Skip to content

fix: OAuth credentials invisible in Configure connection modal#4506

Merged
midigofrank merged 3 commits intomainfrom
4499-oauth-creds-invisible-in-modal
Mar 9, 2026
Merged

fix: OAuth credentials invisible in Configure connection modal#4506
midigofrank merged 3 commits intomainfrom
4499-oauth-creds-invisible-in-modal

Conversation

@elias-ba
Copy link
Copy Markdown
Contributor

@elias-ba elias-ba commented Mar 6, 2026

Description

This PR fixes a bug where OAuth credentials created in the collaborative editor don't appear in the "Configure connection" modal.

The root cause: OAuth credentials have schema: "oauth" (needed by the backend for token lifecycle management), so they fail the adaptor-name matching filter (c.schema === adaptorName). There's a "smart matching" fallback that fuzzy-matches the oauth_client_name against the adaptor name, but when the client name doesn't contain the adaptor name (e.g., "Corporate SSO Provider" for a Salesforce job) or is null, the credential falls through all filter sections and becomes invisible.

The fix treats OAuth credentials the same as http and raw — as universal credentials that appear in the "Other Credentials" section when they don't match by name. OAuth credentials that do match by name still appear in the primary "Matching Credentials" section as before.

Closes #4499

Validation steps

  1. Create a new OAuth credential in the collaborative editor (e.g., for Salesforce)
  2. After saving, open the "Configure connection" modal for the job
  3. Verify the credential appears — either in "Matching Credentials" (if the OAuth client name contains the adaptor name) or in "Other Credentials" (if it doesn't)
  4. Run cd assets && npm test -- --run ConfigureAdaptorModal — all 52 tests pass (3 new)

Additional notes for the reviewer

  1. A longer-term fix could involve adding a source_schema column to credentials so the backend can track both the auth type and the original adaptor affinity. However, this adds migration overhead and the source_schema could go stale if users change the adaptor. The universal-fallback approach is simpler and covers all cases.
  2. The normalizeString helper was also moved outside the filter callback to avoid re-creating it on every iteration — minor cleanup, no behavior change.

AI Usage

  • I have used Claude Code
  • I have used another model
  • I have not used AI

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

OAuth credentials set their schema to "oauth" instead of the adaptor
name (e.g., "salesforce"). The backend needs this for token lifecycle
management. But the Configure connection modal filtered credentials by
matching schema against the adaptor name, so "oauth" !== "salesforce"
failed silently.

There was a fuzzy fallback matching oauth_client_name against the
adaptor name, but if the name didn't contain the adaptor name (or was
null), the credential fell through every filter and became invisible.

Fix: treat unmatched OAuth credentials as universal (like HTTP and raw)
so they appear in "Other Credentials" instead of vanishing.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.54%. Comparing base (75489ef) to head (ed06e9a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4506      +/-   ##
==========================================
- Coverage   89.55%   89.54%   -0.01%     
==========================================
  Files         425      425              
  Lines       20295    20295              
==========================================
- Hits        18175    18173       -2     
- Misses       2120     2122       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@midigofrank midigofrank merged commit 5faf377 into main Mar 9, 2026
6 of 7 checks passed
@midigofrank midigofrank deleted the 4499-oauth-creds-invisible-in-modal branch March 9, 2026 05:17
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Regression: oAuth Credentials not appearing on canvas modal

2 participants