Skip to content

Commit

Permalink
refactor(core-api): remove IPluginKeychain#rotateEncryptionKeys()
Browse files Browse the repository at this point in the history
Also remove the getEncryptionAlgorithm method.

Fixes #477

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Jan 14, 2021
1 parent 416b82e commit 734fab0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { ICactusPlugin } from "../i-cactus-plugin";
* keychains.
*/
export interface IPluginKeychain extends ICactusPlugin {
rotateEncryptionKeys(): Promise<void>;
getEncryptionAlgorithm(): string;
/**
* Returns the unique identifier of the keychain pointed to (or backed) by
* this `IPluginKeychain` instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ export class PluginKeychainMemory {
return PluginAspect.KEYCHAIN;
}

async rotateEncryptionKeys(): Promise<void> {
throw new Error("Method not implemented.");
}

public getEncryptionAlgorithm(): string {
return null as any;
}

async get<T>(key: string): Promise<T> {
return this.backend.get(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit 734fab0

Please sign in to comment.