Skip to content

Commit

Permalink
feat(azure-kv): added keychain plugin for azure keyvault
Browse files Browse the repository at this point in the history
	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 <jagpreet.singh.sasan@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
jagpreetsinghsasan authored and petermetz committed Jul 29, 2021
1 parent 9ca7f6e commit 69e7b50
Showing 25 changed files with 1,846 additions and 30 deletions.
1 change: 0 additions & 1 deletion packages/cactus-plugin-keychain-aws-sm/package.json
Original file line number Diff line number Diff line change
@@ -82,7 +82,6 @@
},
"devDependencies": {
"@hyperledger/cactus-test-tooling": "0.6.0",
"@types/express-serve-static-core": "4.17.17",
"@types/request": "2.48.5",
"@types/express": "4.17.8",
"internal-ip": "6.2.0",
3 changes: 3 additions & 0 deletions packages/cactus-plugin-keychain-azure-kv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@hyperledger/cactus-plugin-keychain-azure-kv`

# TO-DO
7 changes: 7 additions & 0 deletions packages/cactus-plugin-keychain-azure-kv/openapitools.json
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"
}
}
92 changes: 92 additions & 0 deletions packages/cactus-plugin-keychain-azure-kv/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"name": "@hyperledger/cactus-plugin-keychain-azure-kv",
"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-azure-kv.node.umd.min.js",
"browser": "dist/cactus-plugin-keychain-azure-kv.web.umd.js",
"browserMinified": "dist/cactus-plugin-keychain-azure-kv.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": {
"@azure/identity": "1.3.0",
"@azure/keyvault-secrets": "4.1.0",
"@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",
"internal-ip": "6.2.0",
"express": "4.17.1",
"openapi-types": "7.2.2"
}
}
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-azure-kv/get-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/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-azure-kv/set-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/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"
}
}
}
}
}
}
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
api.ts
base.ts
common.ts
configuration.ts
index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2.0
Loading

0 comments on commit 69e7b50

Please sign in to comment.