Skip to content

Commit

Permalink
feat: add web services for google sm keychain hyperledger-cacti#1097
Browse files Browse the repository at this point in the history
fixes hyperledger-cacti#1097

Signed-off-by: Tommesha Wiggins <tommesha.wiggins@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Signed-off-by: Tyler Lazar <tyler.a.lazar@accenture.com>
  • Loading branch information
twiggins120 authored and Ty Lazar committed Aug 9, 2021
1 parent a496bdc commit a07e850
Show file tree
Hide file tree
Showing 13 changed files with 126,682 additions and 19,639 deletions.
104,213 changes: 104,213 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
}
},
"dependencies": {
"@google-cloud/secret-manager": "^3.7.1",
"@types/ssh2": "0.5.46",
"artillery": "1.7.2",
"cspell": "5.4.0"
Expand Down
108 changes: 108 additions & 0 deletions packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,21 @@
}
}
},
"HasKeychainEntryRequestV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key to check for presence in the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"GetKeychainEntryRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -577,6 +592,21 @@
}
}
},
"DeleteKeychainEntryRequestV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to check the presence of on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"SetKeychainEntryRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -614,6 +644,21 @@
"nullable": false
}
}
},
"DeleteKeychainEntryResponse": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was deleted from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
}
},
"requestBodies": {
Expand Down Expand Up @@ -671,6 +716,28 @@
}
}
}
},
"keychain_has_entry_request_body": {
"description": "Request body to write/update a keychain entry via its key",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryRequestV1"
}
}
}
},
"keychain_delete_entry_request_body": {
"description": "Request body to write/update a keychain entry via its key",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryRequestV1"
}
}
}
}
},
"responses": {
Expand Down Expand Up @@ -704,6 +771,28 @@
}
}
},
"keychain_has_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryRequestV1"
}
}
}
},
"keychain_has_entry_400": {
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
},
"keychain_has_entry_401": {
"description": "Authorization information is missing or invalid."
},
"keychain_has_entry_404": {
"description": "A keychain item with the specified key was not found."
},
"keychain_has_entry_500": {
"description": "Unexpected error."
},
"keychain_get_entry_200": {
"description": "OK",
"content": {
Expand Down Expand Up @@ -744,6 +833,25 @@
},
"keychain_set_entry_500": {
"description": "Unexpected error."
},
"keychain_delete_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryResponse"
}
}
}
},
"keychain_delete_entry_400": {
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
},
"keychain_delete_entry_401": {
"description": "Authorization information is missing or invalid."
},
"keychain_delete_entry_500": {
"description": "Unexpected error."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,32 @@ export enum Constants {
SocketIoConnectionPathV1 = '/api/v1/async/socket-io/connect'
}

/**
*
* @export
* @interface DeleteKeychainEntryRequestV1
*/
export interface DeleteKeychainEntryRequestV1 {
/**
* The key for the entry to check the presence of on the keychain.
* @type {string}
* @memberof DeleteKeychainEntryRequestV1
*/
key: string;
}
/**
*
* @export
* @interface DeleteKeychainEntryResponse
*/
export interface DeleteKeychainEntryResponse {
/**
* The key that was deleted from the keychain.
* @type {string}
* @memberof DeleteKeychainEntryResponse
*/
key: string;
}
/**
*
* @export
Expand Down Expand Up @@ -322,6 +348,19 @@ export interface GetObjectResponseV1 {
*/
value: string;
}
/**
*
* @export
* @interface HasKeychainEntryRequestV1
*/
export interface HasKeychainEntryRequestV1 {
/**
* The key to check for presence in the keychain.
* @type {string}
* @memberof HasKeychainEntryRequestV1
*/
key: string;
}
/**
*
* @export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,57 @@
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry",
"verbLowerCase": "post"
}
},
"operationId": "deleteKeychainEntryV1",
"summary": "Deletes an entry under a key on the keychain backend.",
"parameters": [],
"requestBody": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_delete_entry_request_body"
},
"responses": {
"200": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_delete_entry_200"
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry",
"verbLowerCase": "post"
}
},
"operationId": "hasKeychainEntryV1",
"summary": "Checks that an entry exists under a key on the keychain backend.",
"parameters": [],
"requestBody": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_has_entry_request_body"
},
"responses": {
"200": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_200"
},
"400": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_400"
},
"401": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_401"
},
"500": {
"$ref": "../../../../cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_500"
}
}
}
}
}
}
}
Loading

0 comments on commit a07e850

Please sign in to comment.