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

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
  • Loading branch information
Leeyoungone committed Jul 26, 2021
1 parent 539a801 commit 4f99fc3
Show file tree
Hide file tree
Showing 32 changed files with 11,791 additions and 21 deletions.
110 changes: 109 additions & 1 deletion packages/cactus-core-api/src/main/json/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,21 @@
}
},
"GetKeychainEntryRequest": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to delete from the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"DeleteKeychainEntryRequest": {
"type": "object",
"required": [
"key"
Expand Down Expand Up @@ -586,7 +601,7 @@
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to set on the keychain.",
"description": "The key for the entry to check on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
Expand Down Expand Up @@ -614,6 +629,39 @@
"nullable": false
}
}
},
"HasKeychainEntryRequest": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key for the entry to set on the keychain.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
},
"HasKeychainEntryResponse": {
"type": "boolean"
},
"DeleteKeychainEntryResponse": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string",
"description": "The key of the entry that was deleted.",
"minLength": 1,
"maxLength": 1024,
"nullable": false
}
}
}
},
"requestBodies": {
Expand Down Expand Up @@ -671,6 +719,28 @@
}
}
}
},
"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/DeleteKeychainEntryRequest"
}
}
}
},
"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/HasKeychainEntryRequest"
}
}
}
}
},
"responses": {
Expand Down Expand Up @@ -744,6 +814,44 @@
},
"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."
},
"keychain_has_entry_200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HasKeychainEntryResponse"
}
}
}
},
"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."
}
}
},
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 DeleteKeychainEntryRequest
*/
export interface DeleteKeychainEntryRequest {
/**
* The key for the entry to get from the keychain.
* @type {string}
* @memberof DeleteKeychainEntryRequest
*/
key: string;
}
/**
*
* @export
* @interface DeleteKeychainEntryResponse
*/
export interface DeleteKeychainEntryResponse {
/**
* The key that was used to set the value on the keychain.
* @type {string}
* @memberof DeleteKeychainEntryResponse
*/
key: string;
}
/**
*
* @export
Expand Down Expand Up @@ -290,6 +316,32 @@ export interface GetKeychainEntryResponse {
*/
value: string;
}
/**
*
* @export
* @interface HasKeychainEntryRequest
*/
export interface HasKeychainEntryRequest {
/**
* The key for the entry to set on the keychain.
* @type {string}
* @memberof HasKeychainEntryRequest
*/
key: string;
}
/**
*
* @export
* @interface HasKeychainEntryResponse
*/
export interface HasKeychainEntryResponse {
/**
* The key that was used to set the value on the keychain.
* @type {string}
* @memberof HasKeychainEntryResponse
*/
key: string;
}
/**
*
* @export
Expand Down
3 changes: 3 additions & 0 deletions packages/cactus-plugin-keychain-aws-sm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@hyperledger/cactus-plugin-keychain-aws-sm`

## TO-DO
Loading

0 comments on commit 4f99fc3

Please sign in to comment.