feat(Salesforce Trigger Node): Add OAuth2 JWT authentication support (#32257)

Co-authored-by: Dimitri Lavrenük <20122620+dlavrenuek@users.noreply.github.com>
This commit is contained in:
Rohit Gahlawat 2026-08-07 18:17:06 +05:30 committed by GitHub
parent ad6e10943d
commit eda249642c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 55 additions and 0 deletions

View File

@ -37,12 +37,43 @@ export class SalesforceTrigger implements INodeType {
{
name: 'salesforceOAuth2Api',
required: true,
displayOptions: {
show: {
authentication: ['oAuth2'],
},
},
},
{
name: 'salesforceJwtApi',
required: true,
displayOptions: {
show: {
authentication: ['jwt'],
},
},
},
],
polling: true,
inputs: [],
outputs: [NodeConnectionTypes.Main],
properties: [
{
displayName: 'Authentication',
name: 'authentication',
type: 'options',
options: [
{
name: 'OAuth2',
value: 'oAuth2',
},
{
name: 'OAuth2 JWT',
value: 'jwt',
},
],
default: 'oAuth2',
description: 'OAuth Authorization Flow',
},
{
displayName: 'Trigger On',
name: 'triggerOn',

View File

@ -128,6 +128,30 @@ describe('SalesforceTrigger', () => {
});
});
describe('Authentication', () => {
it('should offer both OAuth2 and JWT credentials', () => {
const credentials = trigger.description.credentials ?? [];
const oAuth2 = credentials.find((c) => c.name === 'salesforceOAuth2Api');
const jwt = credentials.find((c) => c.name === 'salesforceJwtApi');
expect(oAuth2?.displayOptions?.show?.authentication).toEqual(['oAuth2']);
expect(jwt?.displayOptions?.show?.authentication).toEqual(['jwt']);
});
it('should expose an authentication selector defaulting to OAuth2', () => {
const authentication = trigger.description.properties.find(
(p) => p.name === 'authentication',
);
expect(authentication?.default).toBe('oAuth2');
expect(authentication?.options).toEqual([
{ name: 'OAuth2', value: 'oAuth2' },
{ name: 'OAuth2 JWT', value: 'jwt' },
]);
});
});
describe('Poll Function - Parameter Setup', () => {
beforeEach(() => {
mockPollFunctions.getNodeParameter.mockImplementation((paramName: string) => {