Skip to content

Commit

Permalink
feat(keychain-aws-sm): complete request handler and endpoint
Browse files Browse the repository at this point in the history
Fixes hyperledger-cacti#967
Depends on hyperledger-cacti#1349

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
  • Loading branch information
Leeyoungone committed Oct 4, 2021
1 parent 126450f commit f031d2e
Show file tree
Hide file tree
Showing 16 changed files with 1,939 additions and 1,285 deletions.
119 changes: 48 additions & 71 deletions packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to get from the keychain.",
"description": "The key for the entry to delete from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
Expand All @@ -540,24 +540,16 @@
"GetKeychainEntryResponseV1": {
"type": "object",
"required": [
"key",
"value"
"key"
],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"description": "The key that was used to retrieve the value from the keychain.",
"description": "The key for the entry to get from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"value": {
"type": "string",
"description": "The value associated with the requested key on the keychain.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
Expand All @@ -571,51 +563,21 @@
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to set on the keychain.",
"description": "The key that was used to retrieve the value from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"value": {
"type": "string",
"description": "The value that will be associated with the key on the keychain.",
"description": "The value associated with the requested key on the keychain.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
"SetKeychainEntryResponseV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to set the value on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"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
}
}
},
"DeleteKeychainEntryResponseV1": {
"type": "object",
"required": [
"key"
Expand All @@ -624,13 +586,13 @@
"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": {
"type": "object",
"required": [
Expand All @@ -640,7 +602,7 @@
"properties": {
"key": {
"type": "string",
"description": "The key to check for presence in the keychain.",
"description": "The key to check for presence in the keychain",
"minLength": 1,
"maxLength": 1024,
"nullable": false
Expand Down Expand Up @@ -669,6 +631,21 @@
"nullable": false
}
}
},
"DeleteKeychainEntryResponseV1": {
"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 @@ -726,25 +703,25 @@
}
}
}
},
"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/DeleteKeychainEntryRequestV1"
}
}
}
},
"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/HasKeychainEntryRequestV1"
}
}
}
Expand Down Expand Up @@ -822,42 +799,42 @@
"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"
}
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryResponseV1"
}
}
}
}
},
"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"
}
"schema": {
"$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."
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export enum Constants {
*/
export interface DeleteKeychainEntryRequestV1 {
/**
* The key for the entry to check the presence of on the keychain.
* The key for the entry to get from the keychain.
* @type {string}
* @memberof DeleteKeychainEntryRequestV1
*/
Expand All @@ -295,7 +295,7 @@ export interface DeleteKeychainEntryResponseV1 {
*/
export interface GetKeychainEntryRequestV1 {
/**
* The key for the entry to get from the keychain.
* The key for the entry to delete from the keychain.
* @type {string}
* @memberof GetKeychainEntryRequestV1
*/
Expand Down Expand Up @@ -359,7 +359,7 @@ export interface GetObjectResponseV1 {
*/
export interface HasKeychainEntryRequestV1 {
/**
* The key to check for presence in the keychain.
* The key to check for presence in the keychain
* @type {string}
* @memberof HasKeychainEntryRequestV1
*/
Expand Down Expand Up @@ -576,7 +576,7 @@ export interface PluginInstance {
*/
export interface SetKeychainEntryRequestV1 {
/**
* The key for the entry to set on the keychain.
* The key for the entry to check on the keychain.
* @type {string}
* @memberof SetKeychainEntryRequestV1
*/
Expand Down
66 changes: 63 additions & 3 deletions packages/cactus-plugin-keychain-aws-sm/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"verbLowerCase": "post"
}
},
"operationId": "getKeychainEntry",
"operationId": "getKeychainEntryV1",
"summary": "Retrieves the contents of a keychain entry from the backend.",
"parameters": [],
"requestBody": {
Expand Down Expand Up @@ -64,7 +64,7 @@
"verbLowerCase": "post"
}
},
"operationId": "setKeychainEntry",
"operationId": "setKeychainEntryV1",
"summary": "Sets a value under a key on the keychain backend.",
"parameters": [],
"requestBody": {
Expand All @@ -85,6 +85,66 @@
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry",
"verbLowerCase": "post"
}
},
"operationId": "deleteKeychainEntryV1",
"summary": "Deletes an entry under a key on the keychain backend.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_delete_entry_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_delete_entry_200"
},
"400": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_delete_entry_400"
},
"401": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_delete_entry_401"
},
"500": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_delete_entry_500"
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry": {
"post": {
"x-hyperledger-cactus": {
"http": {
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry",
"verbLowerCase": "post"
}
},
"operationId": "hasKeychainEntryV1",
"summary": "Checks that an entry exists under a key on the keychain backend",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_has_entry_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_200"
},
"400": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_400"
},
"401": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_401"
},
"500": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_has_entry_500"
}
}
}
}
}
}
}
Loading

0 comments on commit f031d2e

Please sign in to comment.