Skip to content

Commit 69e7b50

Browse files
jagpreetsinghsasanpetermetz
authored andcommitted
feat(azure-kv): added keychain plugin for azure keyvault
Primary Change --- 1. Added new package cactus-plugin-keychain-azure-kv under packages/ 2. Added PluginKeychainAzureKvMock class to mock the functions of SecretClient under packages/cactus-plugin-keychain-azure-kv/src/test/typescript/mock/plugin-keychain-azure-kv-mock.ts Resolves #971 Signed-off-by: jagpreetsinghsaan <[email protected]> Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 9ca7f6e commit 69e7b50

25 files changed

+1846
-30
lines changed

packages/cactus-plugin-keychain-aws-sm/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
},
8383
"devDependencies": {
8484
"@hyperledger/cactus-test-tooling": "0.6.0",
85-
"@types/express-serve-static-core": "4.17.17",
8685
"@types/request": "2.48.5",
8786
"@types/express": "4.17.8",
8887
"internal-ip": "6.2.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@hyperledger/cactus-plugin-keychain-azure-kv`
2+
3+
# TO-DO
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3+
"spaces": 2,
4+
"generator-cli": {
5+
"version": "5.2.0"
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": "@hyperledger/cactus-plugin-keychain-azure-kv",
3+
"version": "0.6.0",
4+
"description": "A keychain implementation storing its entries in Azure key vault.",
5+
"main": "dist/lib/main/typescript/index.js",
6+
"mainMinified": "dist/cactus-plugin-keychain-azure-kv.node.umd.min.js",
7+
"browser": "dist/cactus-plugin-keychain-azure-kv.web.umd.js",
8+
"browserMinified": "dist/cactus-plugin-keychain-azure-kv.web.umd.min.js",
9+
"module": "dist/lib/main/typescript/index.js",
10+
"types": "dist/types/main/typescript/index.d.ts",
11+
"files": [
12+
"dist/*"
13+
],
14+
"scripts": {
15+
"generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/",
16+
"codegen:openapi": "npm run generate-sdk",
17+
"codegen": "run-p 'codegen:*'",
18+
"watch": "npm-watch",
19+
"webpack": "npm-run-all webpack:dev webpack:prod",
20+
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web",
21+
"webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js",
22+
"webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js",
23+
"webpack:prod": "npm-run-all webpack:prod:node webpack:prod:web",
24+
"webpack:prod:web": "webpack --env=prod --target=web --config ../../webpack.config.js",
25+
"webpack:prod:node": "webpack --env=prod --target=node --config ../../webpack.config.js"
26+
},
27+
"watch": {
28+
"codegen:openapi": {
29+
"patterns": [
30+
"./src/main/json/openapi.json"
31+
]
32+
}
33+
},
34+
"publishConfig": {
35+
"access": "public"
36+
},
37+
"engines": {
38+
"node": ">=10",
39+
"npm": ">=6"
40+
},
41+
"repository": {
42+
"type": "git",
43+
"url": "git+https://github.com/hyperledger/cactus.git"
44+
},
45+
"keywords": [
46+
"Hyperledger",
47+
"Cactus",
48+
"Integration",
49+
"Blockchain",
50+
"Distributed Ledger Technology"
51+
],
52+
"author": {
53+
"name": "Hyperledger Cactus Contributors",
54+
"email": "[email protected]",
55+
"url": "https://www.hyperledger.org/use/cactus"
56+
},
57+
"contributors": [
58+
{
59+
"name": "Please add yourself to the list of contributors",
60+
"email": "[email protected]",
61+
"url": "https://example.com"
62+
},
63+
{
64+
"name": "Peter Somogyvari",
65+
"email": "[email protected]",
66+
"url": "https://accenture.com"
67+
}
68+
],
69+
"license": "Apache-2.0",
70+
"bugs": {
71+
"url": "https://github.com/hyperledger/cactus/issues"
72+
},
73+
"homepage": "https://github.com/hyperledger/cactus#readme",
74+
"dependencies": {
75+
"@azure/identity": "1.3.0",
76+
"@azure/keyvault-secrets": "4.1.0",
77+
"@hyperledger/cactus-common": "0.6.0",
78+
"@hyperledger/cactus-core": "0.6.0",
79+
"@hyperledger/cactus-core-api": "0.6.0",
80+
"axios": "0.21.1",
81+
"http-status-codes": "2.1.4",
82+
"typescript-optional": "2.0.1"
83+
},
84+
"devDependencies": {
85+
"@hyperledger/cactus-test-tooling": "0.6.0",
86+
"@types/express": "4.17.8",
87+
"@types/request": "2.48.5",
88+
"internal-ip": "6.2.0",
89+
"express": "4.17.1",
90+
"openapi-types": "7.2.2"
91+
}
92+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Hyperledger Cactus - Keychain API",
5+
"description": "Contains/describes the Keychain API types/paths for Hyperledger Cactus.",
6+
"version": "0.3.0",
7+
"license": {
8+
"name": "Apache 2.0",
9+
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
10+
}
11+
},
12+
"components": {
13+
"schemas": {
14+
}
15+
},
16+
"paths": {
17+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry": {
18+
"post": {
19+
"x-hyperledger-cactus": {
20+
"http": {
21+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry",
22+
"verbLowerCase": "post"
23+
}
24+
},
25+
"operationId": "getKeychainEntryV1",
26+
"summary": "Retrieves the contents of a keychain entry from the backend.",
27+
"parameters": [],
28+
"requestBody": {
29+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_get_entry_request_body"
30+
},
31+
"responses": {
32+
"200": {
33+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_200"
34+
},
35+
"400": {
36+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_400"
37+
},
38+
"401": {
39+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_401"
40+
},
41+
"404": {
42+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_404"
43+
},
44+
"500": {
45+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_500"
46+
}
47+
}
48+
}
49+
},
50+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry": {
51+
"post": {
52+
"x-hyperledger-cactus": {
53+
"http": {
54+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry",
55+
"verbLowerCase": "post"
56+
}
57+
},
58+
"operationId": "setKeychainEntryV1",
59+
"summary": "Sets a value under a key on the keychain backend.",
60+
"parameters": [],
61+
"requestBody": {
62+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_set_entry_request_body"
63+
},
64+
"responses": {
65+
"200": {
66+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_200"
67+
},
68+
"400": {
69+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_400"
70+
},
71+
"401": {
72+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_401"
73+
},
74+
"500": {
75+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_500"
76+
}
77+
}
78+
}
79+
}
80+
}
81+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
24+
25+
.npmignore
26+
.gitignore
27+
git_push.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
api.ts
2+
base.ts
3+
common.ts
4+
configuration.ts
5+
index.ts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.2.0

0 commit comments

Comments
 (0)