Skip to content

fix(auth): per-project credential activation (#51152) - #52674

Closed
JerryLiu369 wants to merge 1 commit into
anomalyco:devfrom
JerryLiu369:fix/51152-autofix
Closed

JerryLiu369 wants to merge 1 commit into
anomalyco:devfrom
JerryLiu369:fix/51152-autofix

Conversation

@JerryLiu369

@JerryLiu369 JerryLiu369 commented Oct 2, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #51152

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Allows project/folder configuration (providers.<id>.auth) to pin which stored credential (by ID or label) is active for sessions under that directory, with the global active account serving as fallback.
  • Adds per-location credential pinning to Integration.Service (connection.pin, unpin), ensuring GET /api/integration/{id} connection ordering and active connection resolution vary by project location rather than leaking machine-wide.
  • Extends Credential.Service to store multiple credentials per integration with explicit activation (activate) and promotion upon deletion, maintaining global active credential fallback.
  • Documents precedence rules: pinned credential > global active credential > environment connection, with stored/env connection taking precedence over explicit settings.apiKey.
  • Adds regression unit tests in packages/core covering multi-credential storage, activation, promotion, location pinning, and config integration.

How did you verify your code works?

  • Tested with bun test test/config/provider.test.ts test/credential.test.ts test/integration.test.ts in packages/core. All 15 tests pass cleanly.

Screenshots / recordings

N/A

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth: per-project credential activation (provider profile per folder)

2 participants