Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,20 @@
"proxy": {
"whitelist": [
{
"url": "https://(.*).salesforce.com/services/.*",
"url": "__salesforce_instance_url__/services/.*",
"methods": ["GET", "POST", "PUT", "DELETE", "PATCH"],
"timeout": 30
"timeout": 30,
"settingsInjection": {
"client_key": {
"body": ["client_id"]
},
"client_secret": {
"body": ["client_secret"]
},
"global_access_token": {
"body": ["refresh_token"]
}
}
Comment on lines +151 to +161
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The settingsInjection configuration appears to inject credentials into the request body for all requests to Salesforce services. However, examining src/api/api.ts lines 350-362, the OAuth token refresh logic already manually constructs a URL-encoded body with these credentials using placeholder syntax:

body: `grant_type=refresh_token&client_id=__client_key__&client_secret=__client_secret__&refresh_token=__global_access_token.json("[refreshToken]")__`

This creates a conflict where:

  1. The refresh token endpoint expects application/x-www-form-urlencoded content (line 355)
  2. Most other API calls use application/json content (line 329)
  3. The settingsInjection will inject into the body as JSON fields for all requests

This means regular API calls will have unnecessary credentials injected into their JSON bodies, and the OAuth refresh endpoint may receive duplicate or incorrectly formatted credentials. Consider restricting settingsInjection to specific endpoints or removing it if the manual placeholder approach in the code is the intended mechanism.

Suggested change
"settingsInjection": {
"client_key": {
"body": ["client_id"]
},
"client_secret": {
"body": ["client_secret"]
},
"global_access_token": {
"body": ["refresh_token"]
}
}
// Removed settingsInjection to prevent credentials from being injected into all requests

Copilot uses AI. Check for mistakes.
}
]
}
Expand Down
Loading