forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(keychain-azure-kv): complete request handler and endpoints
Fixes hyperledger-cacti#1010 Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
- Loading branch information
1 parent
951b9f1
commit 15dc7e6
Showing
4 changed files
with
63 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...-plugin-keychain-azure-kv/src/test/typescript/integration/plugin-keychain-factory.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { PluginRegistry } from "@hyperledger/cactus-core"; | ||
import { | ||
IPluginFactoryOptions, | ||
PluginImportType, | ||
} from "@hyperledger/cactus-core-api"; | ||
import test, { Test } from "tape-promise/tape"; | ||
import { PluginFactoryKeychain } from "../../../main/typescript/plugin-factory-keychain"; | ||
import { | ||
AzureCredentialType, | ||
PluginKeychainAzureKv, | ||
} from "../../../main/typescript/plugin-keychain-azure-kv"; | ||
import { v4 as uuidv4 } from "uuid"; | ||
|
||
test("get,set,has,delete alters state as expected", async (t: Test) => { | ||
const iPluginFactoryOptions1: IPluginFactoryOptions = { | ||
pluginImportType: PluginImportType.Local, | ||
}; | ||
|
||
const invalid: IPluginFactoryOptions = { | ||
pluginImportType: (null as unknown) as PluginImportType, | ||
}; | ||
|
||
const pluginRegistry = new PluginRegistry(); | ||
const iPluginKeychainAzureKvOptions = { | ||
instanceId: uuidv4(), | ||
keychainId: uuidv4(), | ||
pluginRegistry, | ||
azureEndpoint: "true", | ||
azureRegion: "us-east-1", | ||
azureProfile: "default", | ||
azureCredentialType: AzureCredentialType.InMemory, | ||
azureAccessKeyId: "fake", | ||
azureSecretAccessKey: "fake", | ||
logLevel: "TRACE", | ||
}; | ||
|
||
const pluginFactoryKeychain1 = new PluginFactoryKeychain( | ||
iPluginFactoryOptions1, | ||
); | ||
|
||
const pluginFactoryKeychain3 = new PluginFactoryKeychain(invalid); | ||
|
||
const pluginKeychainAzureKv = await pluginFactoryKeychain1.create( | ||
iPluginKeychainAzureKvOptions, | ||
); | ||
|
||
t.true( | ||
pluginKeychainAzureKv instanceof PluginKeychainAzureKv, | ||
"pluginImportType.Local results in pluginKeychainAzureKv", | ||
); | ||
|
||
await t.rejects( | ||
pluginFactoryKeychain3.create({ | ||
invalid, | ||
}), | ||
); | ||
|
||
t.end(); | ||
}); |
210 changes: 0 additions & 210 deletions
210
packages/cactus-plugin-keychain-azure-kv/src/test/typescript/unit/webservice-tests.test.ts
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
packages/cactus-plugin-keychain-azure-kv/src/test/typescript/unit/webservices2.test.ts
This file was deleted.
Oops, something went wrong.