mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(HTTP Request Node): Support generic credentials when using pagination (#7686)
Github issue / Community forum post (link here to close automatically): fixes #7653 Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
parent
0a0798e485
commit
48b240b026
|
@ -1695,10 +1695,10 @@ export async function requestWithAuthentication(
|
||||||
try {
|
try {
|
||||||
const parentTypes = additionalData.credentialsHelper.getParentTypes(credentialsType);
|
const parentTypes = additionalData.credentialsHelper.getParentTypes(credentialsType);
|
||||||
|
|
||||||
if (parentTypes.includes('oAuth1Api')) {
|
if (credentialsType === 'oAuth1Api' || parentTypes.includes('oAuth1Api')) {
|
||||||
return await requestOAuth1.call(this, credentialsType, requestOptions, false);
|
return await requestOAuth1.call(this, credentialsType, requestOptions, false);
|
||||||
}
|
}
|
||||||
if (parentTypes.includes('oAuth2Api')) {
|
if (credentialsType === 'oAuth2Api' || parentTypes.includes('oAuth2Api')) {
|
||||||
return await requestOAuth2.call(
|
return await requestOAuth2.call(
|
||||||
this,
|
this,
|
||||||
credentialsType,
|
credentialsType,
|
||||||
|
|
|
@ -1203,36 +1203,37 @@ export class HttpRequestV3 implements INodeType {
|
||||||
let httpCustomAuth;
|
let httpCustomAuth;
|
||||||
let oAuth1Api;
|
let oAuth1Api;
|
||||||
let oAuth2Api;
|
let oAuth2Api;
|
||||||
let nodeCredentialType;
|
let nodeCredentialType: string | undefined;
|
||||||
|
let genericCredentialType: string | undefined;
|
||||||
|
|
||||||
if (authentication === 'genericCredentialType') {
|
if (authentication === 'genericCredentialType') {
|
||||||
const genericAuthType = this.getNodeParameter('genericAuthType', 0) as string;
|
genericCredentialType = this.getNodeParameter('genericAuthType', 0) as string;
|
||||||
|
|
||||||
if (genericAuthType === 'httpBasicAuth') {
|
if (genericCredentialType === 'httpBasicAuth') {
|
||||||
try {
|
try {
|
||||||
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'httpDigestAuth') {
|
} else if (genericCredentialType === 'httpDigestAuth') {
|
||||||
try {
|
try {
|
||||||
httpDigestAuth = await this.getCredentials('httpDigestAuth');
|
httpDigestAuth = await this.getCredentials('httpDigestAuth');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'httpHeaderAuth') {
|
} else if (genericCredentialType === 'httpHeaderAuth') {
|
||||||
try {
|
try {
|
||||||
httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
|
httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'httpQueryAuth') {
|
} else if (genericCredentialType === 'httpQueryAuth') {
|
||||||
try {
|
try {
|
||||||
httpQueryAuth = await this.getCredentials('httpQueryAuth');
|
httpQueryAuth = await this.getCredentials('httpQueryAuth');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'httpCustomAuth') {
|
} else if (genericCredentialType === 'httpCustomAuth') {
|
||||||
try {
|
try {
|
||||||
httpCustomAuth = await this.getCredentials('httpCustomAuth');
|
httpCustomAuth = await this.getCredentials('httpCustomAuth');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'oAuth1Api') {
|
} else if (genericCredentialType === 'oAuth1Api') {
|
||||||
try {
|
try {
|
||||||
oAuth1Api = await this.getCredentials('oAuth1Api');
|
oAuth1Api = await this.getCredentials('oAuth1Api');
|
||||||
} catch {}
|
} catch {}
|
||||||
} else if (genericAuthType === 'oAuth2Api') {
|
} else if (genericCredentialType === 'oAuth2Api') {
|
||||||
try {
|
try {
|
||||||
oAuth2Api = await this.getCredentials('oAuth2Api');
|
oAuth2Api = await this.getCredentials('oAuth2Api');
|
||||||
} catch {}
|
} catch {}
|
||||||
|
@ -1682,7 +1683,7 @@ export class HttpRequestV3 implements INodeType {
|
||||||
requestOptions,
|
requestOptions,
|
||||||
itemIndex,
|
itemIndex,
|
||||||
paginationData,
|
paginationData,
|
||||||
nodeCredentialType,
|
nodeCredentialType ?? genericCredentialType,
|
||||||
);
|
);
|
||||||
requestPromises.push(requestPromise);
|
requestPromises.push(requestPromise);
|
||||||
} else if (authentication === 'genericCredentialType' || authentication === 'none') {
|
} else if (authentication === 'genericCredentialType' || authentication === 'none') {
|
||||||
|
|
Loading…
Reference in a new issue