Skip to content

feat: enable refresh token rotation for salesforce#1664

Open
paustint wants to merge 1 commit intomainfrom
feat/enable-refresh-token-rotation
Open

feat: enable refresh token rotation for salesforce#1664
paustint wants to merge 1 commit intomainfrom
feat/enable-refresh-token-rotation

Conversation

@paustint
Copy link
Copy Markdown
Contributor

previously, we were not using the new refresh token if one was provided

Copilot AI review requested due to automatic review settings April 14, 2026 04:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables Salesforce refresh token rotation by propagating an optionally returned refresh_token from the OAuth refresh exchange into the active ApiConnection session state, so subsequent refreshes use the latest token.

Changes:

  • Extend refresh handling to accept an optional rotated refresh token and persist it in sessionInfo.
  • Update the callout adapter refresh flow to capture refresh_token from the refresh exchange and pass it through the onRefresh callback.
  • Add structured debug/warn logs around token refresh attempts and failures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
libs/salesforce-api/src/lib/connection.ts Persist rotated refresh tokens into sessionInfo during refresh events.
libs/salesforce-api/src/lib/callout-adapter.ts Plumb rotated refresh token through refresh exchange + callback; improve refresh logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/salesforce-api/src/lib/callout-adapter.ts Outdated
Comment thread libs/salesforce-api/src/lib/connection.ts Outdated
Comment thread libs/salesforce-api/src/lib/callout-adapter.ts Outdated
Comment thread libs/salesforce-api/src/lib/callout-adapter.ts
@paustint paustint force-pushed the feat/enable-refresh-token-rotation branch 2 times, most recently from ab4bd8c to 5f7e82a Compare April 14, 2026 15:26
@paustint paustint requested a review from Copilot April 14, 2026 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/salesforce-api/src/lib/connection.ts Outdated
Comment thread libs/salesforce-api/src/lib/callout-adapter.ts Outdated
Comment thread apps/jetstream-desktop/src/utils/route.utils.ts Outdated
Comment thread apps/api/src/app/routes/route.middleware.ts Outdated
@paustint paustint force-pushed the feat/enable-refresh-token-rotation branch from 5f7e82a to 47fb96e Compare April 14, 2026 16:14
@paustint paustint requested a review from Copilot April 14, 2026 16:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/salesforce-api/src/lib/callout-adapter.ts
@paustint paustint force-pushed the feat/enable-refresh-token-rotation branch from 47fb96e to 0b20eac Compare April 15, 2026 14:36
@paustint paustint requested a review from Copilot April 15, 2026 14:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/salesforce-api/src/lib/callout-adapter.ts
Comment thread libs/salesforce-api/src/lib/connection.ts Outdated
Comment thread apps/jetstream-desktop/src/utils/route.utils.ts
@paustint paustint requested a review from Copilot April 15, 2026 15:11
@paustint paustint force-pushed the feat/enable-refresh-token-rotation branch from 0b20eac to 0beda94 Compare April 15, 2026 15:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/salesforce-api/src/lib/callout-adapter.ts Outdated
previously, we were not using the new refresh token if one was provided
@paustint paustint force-pushed the feat/enable-refresh-token-rotation branch from 0beda94 to 1a60190 Compare April 15, 2026 15:42
@paustint paustint requested a review from Copilot April 15, 2026 15:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants