Skip to content

Commit

Permalink
feat(keychain-azure-kv): complete request handler and endpoints
Browse files Browse the repository at this point in the history
Fixes hyperledger-cacti#1010

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Signed-off-by: Jeffery Ushry <jeffery.ushry@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
Leeyoungone committed Sep 16, 2021
1 parent 51792a9 commit f3dd4a4
Show file tree
Hide file tree
Showing 12 changed files with 942 additions and 125 deletions.
100 changes: 51 additions & 49 deletions packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,37 +585,60 @@
}
}
},
"SetKeychainEntryResponse": {
"DeleteKeychainEntryRequest": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to set the value on the keychain.",
"description": "The key for the entry to delete from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"DeleteKeychainEntryRequestV1": {
"HasKeychainEntryRequest": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to check the presence of on the keychain.",
"description": "The key for the entry to check on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"DeleteKeychainEntryResponseV1": {
"HasKeychainEntryResponseV1": {
"type": "object",
"required": ["key", "isPresent", "checkedAt"],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to check the presence of the value in the entry store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"checkedAt": {
"type": "string",
"description": "Date and time encoded as JSON when the presence check was performed by the plugin backend.",
"nullable": false
},
"isPresent": {
"type": "boolean",
"description": "The boolean true or false indicating the presence or absence of an entry under 'key'.",
"nullable": false
}
}
},
"SetKeychainEntryResponse": {
"type": "object",
"required": [
"key"
Expand All @@ -624,14 +647,14 @@
"properties": {
"key": {
"type": "string",
"description": "The key that was deleted from the keychain.",
"description": "The key that was used to set the value on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"HasKeychainEntryRequestV1": {
"DeleteKeychainEntryResponse": {
"type": "object",
"required": [
"key"
Expand All @@ -640,35 +663,12 @@
"properties": {
"key": {
"type": "string",
"description": "The key to check for presence in the keychain.",
"description": "The key that was used to delete the value on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"HasKeychainEntryResponseV1": {
"type": "object",
"required": ["key", "isPresent", "checkedAt"],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to check the presence of the value in the entry store.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"checkedAt": {
"type": "string",
"description": "Date and time encoded as JSON when the presence check was performed by the plugin backend.",
"nullable": false
},
"isPresent": {
"type": "boolean",
"description": "The boolean true or false indicating the presence or absence of an entry under 'key'.",
"nullable": false
}
}
}
},
"requestBodies": {
Expand Down Expand Up @@ -727,24 +727,24 @@
}
}
},
"keychain_has_entry_request_body": {
"description": "Request body for checking a keychain entry via its key",
"keychain_delete_entry_request_body": {
"description": "Request body to delete a keychain entry via its key",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryRequestV1"
"$ref": "#/components/schemas/DeleteKeychainEntryRequest"
}
}
}
},
"keychain_delete_entry_request_body": {
"description": "Request body to delete a keychain entry via its key",
},
"keychain_has_entry_request_body": {
"description": "Request body for checking a keychain entry via its key",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryRequestV1"
"$ref": "#/components/schemas/HasKeychainEntryRequest"
}
}
}
Expand Down Expand Up @@ -822,45 +822,47 @@
"keychain_set_entry_500": {
"description": "Unexpected error."
},
"keychain_has_entry_200": {
"keychain_delete_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
"$ref": "#/components/schemas/DeleteKeychainEntryResponse"
}
}
}
},
"keychain_has_entry_400": {
"keychain_delete_entry_400": {
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
},
"keychain_has_entry_401": {
"keychain_delete_entry_401": {
"description": "Authorization information is missing or invalid."
},
"keychain_has_entry_500": {
"keychain_delete_entry_500": {
"description": "Unexpected error."
},
"keychain_delete_entry_200": {
"keychain_has_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryResponseV1"
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
}
}
}
},
"keychain_delete_entry_400": {
"keychain_has_entry_400": {
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
},
"keychain_delete_entry_401": {
"keychain_has_entry_401": {
"description": "Authorization information is missing or invalid."
},
"keychain_delete_entry_500": {
"keychain_has_entry_500": {
"description": "Unexpected error."
}
}
},
"paths": {}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -265,26 +265,26 @@ export enum Constants {
/**
*
* @export
* @interface DeleteKeychainEntryRequestV1
* @interface DeleteKeychainEntryRequest
*/
export interface DeleteKeychainEntryRequestV1 {
export interface DeleteKeychainEntryRequest {
/**
* The key for the entry to check the presence of on the keychain.
* The key for the entry to delete from the keychain.
* @type {string}
* @memberof DeleteKeychainEntryRequestV1
* @memberof DeleteKeychainEntryRequest
*/
key: string;
}
/**
*
* @export
* @interface DeleteKeychainEntryResponseV1
* @interface DeleteKeychainEntryResponse
*/
export interface DeleteKeychainEntryResponseV1 {
export interface DeleteKeychainEntryResponse {
/**
* The key that was deleted from the keychain.
* The key that was used to delete the value on the keychain.
* @type {string}
* @memberof DeleteKeychainEntryResponseV1
* @memberof DeleteKeychainEntryResponse
*/
key: string;
}
Expand Down Expand Up @@ -355,13 +355,13 @@ export interface GetObjectResponseV1 {
/**
*
* @export
* @interface HasKeychainEntryRequestV1
* @interface HasKeychainEntryRequest
*/
export interface HasKeychainEntryRequestV1 {
export interface HasKeychainEntryRequest {
/**
* The key to check for presence in the keychain.
* The key for the entry to check on the keychain.
* @type {string}
* @memberof HasKeychainEntryRequestV1
* @memberof HasKeychainEntryRequest
*/
key: string;
}
Expand Down
5 changes: 5 additions & 0 deletions packages/cactus-plugin-keychain-azure-kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
"name": "Peter Somogyvari",
"email": "peter.somogyvari@accenture.com",
"url": "https://accenture.com"
},
{
"name": "Jeffrey Ushry II",
"email": "ushryaspirant@gmail.com",
"url": "https://www.linkedin.com/in/jeffrey-ushry-ii-aa7ab8183"
}
],
"license": "Apache-2.0",
Expand Down
Loading

0 comments on commit f3dd4a4

Please sign in to comment.