Skip to content

Commit

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

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>
Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
  • Loading branch information
Leeyoungone committed Sep 23, 2021
1 parent e2fc14f commit 4050410
Show file tree
Hide file tree
Showing 14 changed files with 921 additions and 23,282 deletions.
161 changes: 82 additions & 79 deletions packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,44 @@
}
}
},
"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
}
}
},
"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
}
}
},
"GetKeychainEntryRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -561,61 +599,46 @@
}
}
},
"SetKeychainEntryRequest": {
"DeleteKeychainEntryRequestV1": {
"type": "object",
"required": [
"key",
"value"
"key"
],
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to set on the keychain.",
"description": "The key for the entry to check the presence of on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
},
"value": {
"type": "string",
"description": "The value that will be associated with the key on the keychain.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
"SetKeychainEntryResponse": {
"SetKeychainEntryRequest": {
"type": "object",
"required": [
"key"
"key",
"value"
],
"properties": {
"key": {
"type": "string",
"description": "The key that was used to set the value on the keychain.",
"description": "The key for the entry to set on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"DeleteKeychainEntryRequestV1": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
},
"value": {
"type": "string",
"description": "The key for the entry to check the presence of on the keychain.",
"minLength": 1,
"maxLength": 1024,
"description": "The value that will be associated with the key on the keychain.",
"minLength": 0,
"maxLength": 10485760,
"nullable": false
}
}
},
"DeleteKeychainEntryResponseV1": {
"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 deleted from 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 @@ -728,7 +728,7 @@
}
},
"keychain_has_entry_request_body": {
"description": "Request body for checking a keychain entry via its key",
"description": "Request body to write/update a keychain entry via its key",
"required": true,
"content": {
"application/json": {
Expand All @@ -739,7 +739,7 @@
}
},
"keychain_delete_entry_request_body": {
"description": "Request body to delete a keychain entry via its key",
"description": "Request body to write/update a keychain entry via its key",
"required": true,
"content": {
"application/json": {
Expand Down Expand Up @@ -781,6 +781,28 @@
}
}
},
"keychain_has_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
}
}
}
},
"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 @@ -822,34 +844,15 @@
"keychain_set_entry_500": {
"description": "Unexpected error."
},
"keychain_has_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
}
}
}
},
"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_500": {
"description": "Unexpected error."
},
"keychain_delete_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteKeychainEntryResponseV1"
}
"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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ export interface DeleteKeychainEntryRequestV1 {
/**
*
* @export
* @interface DeleteKeychainEntryResponseV1
* @interface DeleteKeychainEntryResponse
*/
export interface DeleteKeychainEntryResponseV1 {
export interface DeleteKeychainEntryResponse {
/**
* The key that was deleted from the keychain.
* @type {string}
* @memberof DeleteKeychainEntryResponseV1
* @memberof DeleteKeychainEntryResponse
*/
key: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"summary": "Retrieves the contents of a keychain entry from the backend.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_get_entry_request_body"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_get_entry_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_200"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_200"
},
"400": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_400"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_400"
},
"401": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_401"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_401"
},
"404": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_404"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_404"
},
"500": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_500"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_get_entry_500"
}
}
}
Expand All @@ -59,23 +59,74 @@
"summary": "Sets a value under a key on the keychain backend.",
"parameters": [],
"requestBody": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_set_entry_request_body"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/requestBodies/keychain_set_entry_request_body"
},
"responses": {
"200": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_200"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_200"
},
"400": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_400"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_400"
},
"401": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_401"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_401"
},
"500": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_500"
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.9.0/packages/cactus-core-api/src/main/json/openapi.json#/components/responses/keychain_set_entry_500"
}
}
}
},
"/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": "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"
}
}
}
},
"/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": "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 4050410

Please sign in to comment.