-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(google-sm): added keychain plugin for google secret manager
Primary Change --- 1. Added new package cactus-plugin-keychain-google-sm under packages/ 2. Added PluginKeychainGoogleSmMock class to mock the functions of SecretManagerServiceClient under packages/cactus-plugin-keychain-google-sm/src/test/typescript/mock/ Resolves #983 Signed-off-by: jagpreetsinghsaan <jagpreet.singh.sasan@accenture.com>
- Loading branch information
1 parent
43be168
commit 1419b2c
Showing
22 changed files
with
1,254 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `@hyperledger/cactus-plugin-keychain-google-sm` | ||
|
||
# TO-DO |
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,7 @@ | ||
{ | ||
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "5.2.0" | ||
} | ||
} |
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,91 @@ | ||
{ | ||
"name": "@hyperledger/cactus-plugin-keychain-google-sm", | ||
"version": "0.6.0", | ||
"description": "A keychain implementation storing its entries in Azure key vault.", | ||
"main": "dist/lib/main/typescript/index.js", | ||
"mainMinified": "dist/cactus-plugin-keychain-google-sm.node.umd.min.js", | ||
"browser": "dist/cactus-plugin-keychain-google-sm.web.umd.js", | ||
"browserMinified": "dist/cactus-plugin-keychain-google-sm.web.umd.min.js", | ||
"module": "dist/lib/main/typescript/index.js", | ||
"types": "dist/types/main/typescript/index.d.ts", | ||
"files": [ | ||
"dist/*" | ||
], | ||
"scripts": { | ||
"generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/", | ||
"codegen:openapi": "npm run generate-sdk", | ||
"codegen": "run-p 'codegen:*'", | ||
"watch": "npm-watch", | ||
"webpack": "npm-run-all webpack:dev webpack:prod", | ||
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", | ||
"webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js", | ||
"webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", | ||
"webpack:prod": "npm-run-all webpack:prod:node webpack:prod:web", | ||
"webpack:prod:web": "webpack --env=prod --target=web --config ../../webpack.config.js", | ||
"webpack:prod:node": "webpack --env=prod --target=node --config ../../webpack.config.js" | ||
}, | ||
"watch": { | ||
"codegen:openapi": { | ||
"patterns": [ | ||
"./src/main/json/openapi.json" | ||
] | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"engines": { | ||
"node": ">=10", | ||
"npm": ">=6" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hyperledger/cactus.git" | ||
}, | ||
"keywords": [ | ||
"Hyperledger", | ||
"Cactus", | ||
"Integration", | ||
"Blockchain", | ||
"Distributed Ledger Technology" | ||
], | ||
"author": { | ||
"name": "Hyperledger Cactus Contributors", | ||
"email": "cactus@lists.hyperledger.org", | ||
"url": "https://www.hyperledger.org/use/cactus" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Please add yourself to the list of contributors", | ||
"email": "your.name@example.com", | ||
"url": "https://example.com" | ||
}, | ||
{ | ||
"name": "Peter Somogyvari", | ||
"email": "peter.somogyvari@accenture.com", | ||
"url": "https://accenture.com" | ||
} | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/hyperledger/cactus/issues" | ||
}, | ||
"homepage": "https://github.com/hyperledger/cactus#readme", | ||
"dependencies": { | ||
"@google-cloud/secret-manager": "3.7.1", | ||
"@hyperledger/cactus-common": "0.6.0", | ||
"@hyperledger/cactus-core": "0.6.0", | ||
"@hyperledger/cactus-core-api": "0.6.0", | ||
"axios": "0.21.1", | ||
"http-status-codes": "2.1.4", | ||
"typescript-optional": "2.0.1" | ||
}, | ||
"devDependencies": { | ||
"@hyperledger/cactus-test-tooling": "0.6.0", | ||
"@types/express": "4.17.8", | ||
"@types/request": "2.48.5", | ||
"express": "4.17.1", | ||
"internal-ip": "6.2.0", | ||
"openapi-types": "7.2.2" | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
packages/cactus-plugin-keychain-google-sm/src/main/json/openapi.json
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,81 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Hyperledger Cactus - Keychain API", | ||
"description": "Contains/describes the Keychain API types/paths for Hyperledger Cactus.", | ||
"version": "0.3.0", | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
} | ||
}, | ||
"paths": { | ||
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry": { | ||
"post": { | ||
"x-hyperledger-cactus": { | ||
"http": { | ||
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry", | ||
"verbLowerCase": "post" | ||
} | ||
}, | ||
"operationId": "getKeychainEntryV1", | ||
"summary": "Retrieves the contents of a keychain entry from the backend.", | ||
"parameters": [], | ||
"requestBody": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_get_entry_request_body" | ||
}, | ||
"responses": { | ||
"200": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_200" | ||
}, | ||
"400": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_400" | ||
}, | ||
"401": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_401" | ||
}, | ||
"404": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_404" | ||
}, | ||
"500": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_500" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry": { | ||
"post": { | ||
"x-hyperledger-cactus": { | ||
"http": { | ||
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry", | ||
"verbLowerCase": "post" | ||
} | ||
}, | ||
"operationId": "setKeychainEntryV1", | ||
"summary": "Sets a value under a key on the keychain backend.", | ||
"parameters": [], | ||
"requestBody": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_set_entry_request_body" | ||
}, | ||
"responses": { | ||
"200": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_200" | ||
}, | ||
"400": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_400" | ||
}, | ||
"401": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_401" | ||
}, | ||
"500": { | ||
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_500" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...oogle-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator-ignore
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,27 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md | ||
|
||
.npmignore | ||
.gitignore | ||
git_push.sh |
5 changes: 5 additions & 0 deletions
5
...google-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES
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,5 @@ | ||
api.ts | ||
base.ts | ||
common.ts | ||
configuration.ts | ||
index.ts |
1 change: 1 addition & 0 deletions
1
...ogle-sm/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION
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 @@ | ||
5.2.0 |
Oops, something went wrong.