Skip to content

Conversation

@BGZStephen
Copy link
Contributor

Summary

This PR allows dynamic credentials resolvers to be used for storing a refreshed token assuming the credential is resolver capable and has a resolver id.

This allows refreshing of tokens, and also avoids the risk of a dynamic credential overwriting static credential data

Related Linear tickets, Github issues, and Community forum posts

PAY-4235
PAY-4317

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Dec 15, 2025
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/cli/src/credentials/dynamic-credentials-proxy.ts 23.07% 10 Missing ⚠️
packages/cli/src/credentials-helper.ts 28.57% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@blacksmith-sh

This comment has been minimized.

@currents-bot
Copy link

currents-bot bot commented Dec 15, 2025

E2E Tests: n8n tests passed after 8m 34.3s

🟢 583 · 🔴 0 · ⚪️ 27 · 🟣 3

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: 7800225

  • Spec files: 130

  • Overall tests: 610

  • Duration: 8m 34.3s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
multi-main:ui 🟢 526 · 🔴 0 · ⚪️ 27 · 🟣 2 121 / 121
multi-main:ui:isolated 🟢 57 · 🔴 0 · ⚪️ 0 · 🟣 1 9 / 9


This message was posted automatically by currents.dev | Integration Settings

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/cli/src/credentials-helper.ts">

<violation number="1" location="packages/cli/src/credentials-helper.ts:549">
P2: Rule violated: **Prefer Typeguards over Type casting**

Unnecessary type cast using `as`. The `toCredentialContext` function already returns a properly typed `ICredentialContext`. Instead of casting, use the `ICredentialContext` type directly or import and use `ICredentialContextV1` from &#39;n8n-workflow&#39; if the specific V1 shape is needed.</violation>
</file>

<file name="packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts">

<violation number="1" location="packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1633">
P2: Rule violated: **Prefer Typeguards over Type casting**

Use a type guard instead of `as` for type narrowing. Since `contentBody` has type `Exclude&lt;IN8nHttpResponse, Buffer&gt;`, using `contentBody as string` violates the rule against using `as` for type narrowing. Consider adding a type guard check or refactoring the variable declaration to have the correct type from assignment.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
Contributor

@guillaumejacquart guillaumejacquart left a comment

Choose a reason for hiding this comment

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

Looks good to me

@BGZStephen BGZStephen merged commit 0f17bef into master Dec 15, 2025
41 of 42 checks passed
@BGZStephen BGZStephen deleted the PAY-4235-handle-oauth-refresh branch December 15, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants