Skip to content

fix: allow credentials on common adaptor#4513

Draft
elias-ba wants to merge 4 commits intomainfrom
allow-credentials-on-common-adaptor
Draft

fix: allow credentials on common adaptor#4513
elias-ba wants to merge 4 commits intomainfrom
allow-credentials-on-common-adaptor

Conversation

@elias-ba
Copy link
Contributor

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

Description

This PR fixes credential support for the @openfn/language-common adaptor. Previously, the UI showed "This adaptor does not require credentials" and hid all credential options. We just found out that sometimes users need raw JSON credentials on common adaptor steps.

Validation steps

  1. Open a workflow and select a job using @openfn/language-common
  2. Click "Connect" to open the configure modal
  3. Verify that existing credentials (raw JSON, HTTP, OAuth, keychain) are listed
  4. Verify that adaptor-specific credentials (e.g., Salesforce) are not shown in the main list
  5. Click "New Credential" and verify the Raw JSON credential form opens without errors
  6. Save the credential and confirm it gets attached to the job
  7. Repeat steps 2-3 with a non-common adaptor (e.g., Salesforce) and confirm credential filtering still works as before

Additional notes for the reviewer

The edit credential flow is unaffected — when editing, the backend loads the existing credential which already has a valid schema stored.

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., OpenFn, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

Remove the hardcoded check that prevented credential selection for
@openfn/language-common jobs. Users need raw JSON credentials on common
adaptor steps for workflow reusability (e.g., facility-specific config).

When creating a new credential from a common adaptor job, default to
the "raw" (Raw JSON) schema since common has no dedicated schema file.
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.54%. Comparing base (5d4762c) to head (b6a5d2f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4513      +/-   ##
==========================================
- Coverage   89.55%   89.54%   -0.01%     
==========================================
  Files         425      425              
  Lines       20307    20307              
==========================================
- Hits        18185    18184       -1     
- Misses       2122     2123       +1     

☔ 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.

Copy link
Collaborator

@josephjclark josephjclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @elias-ba !

@midigofrank midigofrank marked this pull request as draft March 11, 2026 06:09
@midigofrank
Copy link
Collaborator

@elias-ba I have converted this to draft. Waiting for product decision

@midigofrank midigofrank removed their request for review March 11, 2026 06:10
@elias-ba
Copy link
Contributor Author

Thank you @midigofrank that's the right thing to do.

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

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

3 participants