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

Signed-off-by: Tommesha Wiggins <[email protected]>
Signed-off-by: Peter Somogyvari <[email protected]>
Signed-off-by: Tyler Lazar <[email protected]>
Signed-off-by: Youngone Lee <[email protected]>
  • Loading branch information
Leeyoungone committed Aug 25, 2021
1 parent d9c977c commit 8da0ecb
Show file tree
Hide file tree
Showing 14 changed files with 1,103 additions and 75 deletions.
131 changes: 131 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,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 @@ -577,6 +615,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 +667,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 +739,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 +794,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 @@ -744,6 +856,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,44 @@ 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
* @interface HasKeychainEntryResponseV1
*/
export interface HasKeychainEntryResponseV1 {
/**
* The key that was used to check the presence of the value in the entry store.
* @type {string}
* @memberof HasKeychainEntryResponseV1
*/
key: string;
/**
* Date and time encoded as JSON when the presence check was performed by the plugin backend.
* @type {string}
* @memberof HasKeychainEntryResponseV1
*/
checkedAt: string;
/**
* The boolean true or false indicating the presence or absence of an entry under \'key\'.
* @type {boolean}
* @memberof HasKeychainEntryResponseV1
*/
isPresent: boolean;
}
/**
*
* @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 8da0ecb

Please sign in to comment.