From 734fab0f58c81db69114dc8a5a6ab3fd59450c80 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 13 Jan 2021 14:41:48 -0800 Subject: [PATCH] refactor(core-api): remove IPluginKeychain#rotateEncryptionKeys() Also remove the getEncryptionAlgorithm method. Fixes #477 Signed-off-by: Peter Somogyvari --- .../plugin/keychain/i-plugin-keychain.ts | 2 -- .../main/typescript/plugin-keychain-memory.ts | 8 ------ .../unit/plugin-keychain-memory.test.ts | 26 ------------------- 3 files changed, 36 deletions(-) diff --git a/packages/cactus-core-api/src/main/typescript/plugin/keychain/i-plugin-keychain.ts b/packages/cactus-core-api/src/main/typescript/plugin/keychain/i-plugin-keychain.ts index 03b3b029b9..525aef23b5 100644 --- a/packages/cactus-core-api/src/main/typescript/plugin/keychain/i-plugin-keychain.ts +++ b/packages/cactus-core-api/src/main/typescript/plugin/keychain/i-plugin-keychain.ts @@ -5,8 +5,6 @@ import { ICactusPlugin } from "../i-cactus-plugin"; * keychains. */ export interface IPluginKeychain extends ICactusPlugin { - rotateEncryptionKeys(): Promise; - getEncryptionAlgorithm(): string; /** * Returns the unique identifier of the keychain pointed to (or backed) by * this `IPluginKeychain` instance. diff --git a/packages/cactus-plugin-keychain-memory/src/main/typescript/plugin-keychain-memory.ts b/packages/cactus-plugin-keychain-memory/src/main/typescript/plugin-keychain-memory.ts index 3d75cf91ab..9339eb1f30 100644 --- a/packages/cactus-plugin-keychain-memory/src/main/typescript/plugin-keychain-memory.ts +++ b/packages/cactus-plugin-keychain-memory/src/main/typescript/plugin-keychain-memory.ts @@ -65,14 +65,6 @@ export class PluginKeychainMemory { return PluginAspect.KEYCHAIN; } - async rotateEncryptionKeys(): Promise { - throw new Error("Method not implemented."); - } - - public getEncryptionAlgorithm(): string { - return null as any; - } - async get(key: string): Promise { return this.backend.get(key); } diff --git a/packages/cactus-plugin-keychain-memory/src/test/typescript/unit/plugin-keychain-memory.test.ts b/packages/cactus-plugin-keychain-memory/src/test/typescript/unit/plugin-keychain-memory.test.ts index 5844578d15..376661d144 100644 --- a/packages/cactus-plugin-keychain-memory/src/test/typescript/unit/plugin-keychain-memory.test.ts +++ b/packages/cactus-plugin-keychain-memory/src/test/typescript/unit/plugin-keychain-memory.test.ts @@ -82,31 +82,5 @@ test("PluginKeychainMemory", (t1: Test) => { t.end(); }); - test("rotateEncryptionKeys() fails fast", async (t: Test) => { - const options: IPluginKeychainMemoryOptions = { - instanceId: uuidv4(), - keychainId: uuidv4(), - }; - const plugin = new PluginKeychainMemory(options); - - const promise = plugin.rotateEncryptionKeys(); - const expected = /not implemented/; - await t.rejects(promise, expected, "rotateEncryptionKeys() rejects OK"); - - t.end(); - }); - - test("getEncryptionAlgorithm() returns null", (t: Test) => { - const options: IPluginKeychainMemoryOptions = { - instanceId: uuidv4(), - keychainId: uuidv4(), - }; - const plugin = new PluginKeychainMemory(options); - - t.notok(plugin.getEncryptionAlgorithm(), "encryption algorithm falsy OK"); - - t.end(); - }); - t1.end(); });