mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): OAuth1 authentication fix for Clever Cloud API (#6847)
This commit is contained in:
@@ -1334,7 +1334,18 @@ export async function requestOAuth1(
|
||||
},
|
||||
signature_method: credentials.signatureMethod as string,
|
||||
hash_function(base, key) {
|
||||
const algorithm = credentials.signatureMethod === 'HMAC-SHA1' ? 'sha1' : 'sha256';
|
||||
let algorithm: string;
|
||||
switch (credentials.signatureMethod) {
|
||||
case 'HMAC-SHA256':
|
||||
algorithm = 'sha256';
|
||||
break;
|
||||
case 'HMAC-SHA512':
|
||||
algorithm = 'sha512';
|
||||
break;
|
||||
default:
|
||||
algorithm = 'sha1';
|
||||
break;
|
||||
}
|
||||
return createHmac(algorithm, key).update(base).digest('base64');
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user