Skip to content

Commit ed6db9e

Browse files
jagpreetsinghsasanpetermetz
authored andcommitted
feat(aws-sm): added keychain plugin for aws secret manager
Primary Change --- 1. Added new package cactus-plugin-keychain-aws-sm under packages/ 2. Added Localstack under cactus-test-tooling/src/main/typescript for local aws secret manager deployment and testing Refactorings that were also necessary to incorporate 1) and 2) --- 3. Updated public-api.ts under packages/cactus-test-tooling/src/main/typescript for exporting LocalStack class, its interfaces and constants Resolves #912 Signed-off-by: jagpreetsinghsaan <[email protected]>
1 parent 539a801 commit ed6db9e

File tree

27 files changed

+1641
-2
lines changed

27 files changed

+1641
-2
lines changed

.cspell.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
"uuidv",
9292
"vscc",
9393
"wasm",
94-
"Xdai"
94+
"Xdai",
95+
"parameterizable"
9596
],
9697
"dictionaries": [
9798
"typescript,node,npm,go,rust"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@hyperledger/cactus-plugin-keychain-aws-sm`
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,91 @@
1+
{
2+
"name": "@hyperledger/cactus-plugin-keychain-aws-sm",
3+
"version": "0.6.0",
4+
"description": "A keychain implementation storing its entries in AWS Secret Manger.",
5+
"main": "dist/lib/main/typescript/index.js",
6+
"mainMinified": "dist/cactus-plugin-keychain-aws-sm.node.umd.min.js",
7+
"browser": "dist/cactus-plugin-keychain-aws-sm.web.umd.js",
8+
"browserMinified": "dist/cactus-plugin-keychain-aws-sm.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": "Jagpreet Singh Sasan",
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+
"@hyperledger/cactus-common": "0.6.0",
76+
"@hyperledger/cactus-core": "0.6.0",
77+
"@hyperledger/cactus-core-api": "0.6.0",
78+
"aws-sdk": "2.903.0",
79+
"axios": "0.21.1",
80+
"http-status-codes": "2.1.4",
81+
"typescript-optional": "2.0.1"
82+
},
83+
"devDependencies": {
84+
"@hyperledger/cactus-test-tooling": "0.6.0",
85+
"@types/express-serve-static-core": "4.17.17",
86+
"@types/request": "2.48.5",
87+
"@types/express": "4.17.8",
88+
"internal-ip": "6.2.0",
89+
"openapi-types": "7.2.2"
90+
}
91+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
"GetSecretRequest": {
15+
"type": "string",
16+
"nullable": false
17+
},
18+
"GetSecretResponse": {
19+
"type": "string",
20+
"nullable": false
21+
}
22+
}
23+
},
24+
"paths": {
25+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry": {
26+
"post": {
27+
"x-hyperledger-cactus": {
28+
"http": {
29+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry",
30+
"verbLowerCase": "post"
31+
}
32+
},
33+
"operationId": "getKeychainEntry",
34+
"summary": "Retrieves the contents of a keychain entry from the backend.",
35+
"parameters": [],
36+
"requestBody": {
37+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_get_entry_request_body"
38+
},
39+
"responses": {
40+
"200": {
41+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_200"
42+
},
43+
"400": {
44+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_400"
45+
},
46+
"401": {
47+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_401"
48+
},
49+
"404": {
50+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_404"
51+
},
52+
"500": {
53+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_500"
54+
}
55+
}
56+
}
57+
},
58+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry": {
59+
"post": {
60+
"x-hyperledger-cactus": {
61+
"http": {
62+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry",
63+
"verbLowerCase": "post"
64+
}
65+
},
66+
"operationId": "setKeychainEntry",
67+
"summary": "Sets a value under a key on the keychain backend.",
68+
"parameters": [],
69+
"requestBody": {
70+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_set_entry_request_body"
71+
},
72+
"responses": {
73+
"200": {
74+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_200"
75+
},
76+
"400": {
77+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_400"
78+
},
79+
"401": {
80+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_401"
81+
},
82+
"500": {
83+
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_500"
84+
}
85+
}
86+
}
87+
}
88+
}
89+
}
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)