mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Create TOTP node (#5901)
* ✨ Create TOTP node * ♻️ Apply feedback * ♻️ Recreate `pnpm-lock.yaml` * ♻️ Apply Giulio's feedback * 🚧 WIP node tests * ✅ Finish node test setup * ⏪ Restore test command * ⚡ linter fixes, tweaks * ♻️ Address Michael's feedback --------- Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -30,6 +30,24 @@ import path from 'path';
|
||||
import { tmpdir } from 'os';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
import { FAKE_CREDENTIALS_DATA } from './FakeCredentialsMap';
|
||||
|
||||
const getFakeDecryptedCredentials = (
|
||||
nodeCredentials: INodeCredentialsDetails,
|
||||
type: string,
|
||||
fakeCredentialsMap: IDataObject,
|
||||
) => {
|
||||
if (nodeCredentials && fakeCredentialsMap[JSON.stringify(nodeCredentials)]) {
|
||||
return fakeCredentialsMap[JSON.stringify(nodeCredentials)] as ICredentialDataDecryptedObject;
|
||||
}
|
||||
|
||||
if (type && fakeCredentialsMap[type]) {
|
||||
return fakeCredentialsMap[type] as ICredentialDataDecryptedObject;
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
export class CredentialsHelper extends ICredentialsHelper {
|
||||
async authenticate(
|
||||
credentials: ICredentialDataDecryptedObject,
|
||||
@@ -57,7 +75,7 @@ export class CredentialsHelper extends ICredentialsHelper {
|
||||
nodeCredentials: INodeCredentialsDetails,
|
||||
type: string,
|
||||
): Promise<ICredentialDataDecryptedObject> {
|
||||
return {};
|
||||
return getFakeDecryptedCredentials(nodeCredentials, type, FAKE_CREDENTIALS_DATA);
|
||||
}
|
||||
|
||||
async getCredentials(
|
||||
|
||||
Reference in New Issue
Block a user