Skip to content

Commit f031d2e

Browse files
committed
feat(keychain-aws-sm): complete request handler and endpoint
Fixes hyperledger-cacti#967 Depends on hyperledger-cacti#1349 Signed-off-by: Youngone Lee <[email protected]>
1 parent 126450f commit f031d2e

File tree

16 files changed

+1939
-1285
lines changed

16 files changed

+1939
-1285
lines changed

packages/cactus-core-api/src/main/json/openapi.json

+48-71
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@
530530
"properties": {
531531
"key": {
532532
"type": "string",
533-
"description": "The key for the entry to get from the keychain.",
533+
"description": "The key for the entry to delete from the keychain.",
534534
"minLength": 1,
535535
"maxLength": 1024,
536536
"nullable": false
@@ -540,24 +540,16 @@
540540
"GetKeychainEntryResponseV1": {
541541
"type": "object",
542542
"required": [
543-
"key",
544-
"value"
543+
"key"
545544
],
546545
"additionalProperties": false,
547546
"properties": {
548547
"key": {
549548
"type": "string",
550-
"description": "The key that was used to retrieve the value from the keychain.",
549+
"description": "The key for the entry to get from the keychain.",
551550
"minLength": 1,
552551
"maxLength": 1024,
553552
"nullable": false
554-
},
555-
"value": {
556-
"type": "string",
557-
"description": "The value associated with the requested key on the keychain.",
558-
"minLength": 0,
559-
"maxLength": 10485760,
560-
"nullable": false
561553
}
562554
}
563555
},
@@ -571,51 +563,21 @@
571563
"properties": {
572564
"key": {
573565
"type": "string",
574-
"description": "The key for the entry to set on the keychain.",
566+
"description": "The key that was used to retrieve the value from the keychain.",
575567
"minLength": 1,
576568
"maxLength": 1024,
577569
"nullable": false
578570
},
579571
"value": {
580572
"type": "string",
581-
"description": "The value that will be associated with the key on the keychain.",
573+
"description": "The value associated with the requested key on the keychain.",
582574
"minLength": 0,
583575
"maxLength": 10485760,
584576
"nullable": false
585577
}
586578
}
587579
},
588580
"SetKeychainEntryResponseV1": {
589-
"type": "object",
590-
"required": [
591-
"key"
592-
],
593-
"properties": {
594-
"key": {
595-
"type": "string",
596-
"description": "The key that was used to set the value on the keychain.",
597-
"minLength": 1,
598-
"maxLength": 1024,
599-
"nullable": false
600-
}
601-
}
602-
},
603-
"DeleteKeychainEntryRequestV1": {
604-
"type": "object",
605-
"required": [
606-
"key"
607-
],
608-
"properties": {
609-
"key": {
610-
"type": "string",
611-
"description": "The key for the entry to check the presence of on the keychain.",
612-
"minLength": 1,
613-
"maxLength": 1024,
614-
"nullable": false
615-
}
616-
}
617-
},
618-
"DeleteKeychainEntryResponseV1": {
619581
"type": "object",
620582
"required": [
621583
"key"
@@ -624,13 +586,13 @@
624586
"properties": {
625587
"key": {
626588
"type": "string",
627-
"description": "The key that was deleted from the keychain.",
589+
"description": "The key that was used to set the value on the keychain.",
628590
"minLength": 1,
629591
"maxLength": 1024,
630592
"nullable": false
631593
}
632594
}
633-
},
595+
},
634596
"HasKeychainEntryRequestV1": {
635597
"type": "object",
636598
"required": [
@@ -640,7 +602,7 @@
640602
"properties": {
641603
"key": {
642604
"type": "string",
643-
"description": "The key to check for presence in the keychain.",
605+
"description": "The key to check for presence in the keychain",
644606
"minLength": 1,
645607
"maxLength": 1024,
646608
"nullable": false
@@ -669,6 +631,21 @@
669631
"nullable": false
670632
}
671633
}
634+
},
635+
"DeleteKeychainEntryResponseV1": {
636+
"type": "object",
637+
"required": [
638+
"key"
639+
],
640+
"properties": {
641+
"key": {
642+
"type": "string",
643+
"description": "The key that was deleted from the keychain.",
644+
"minLength": 1,
645+
"maxLength": 1024,
646+
"nullable": false
647+
}
648+
}
672649
}
673650
},
674651
"requestBodies": {
@@ -726,25 +703,25 @@
726703
}
727704
}
728705
}
729-
},
730-
"keychain_has_entry_request_body": {
731-
"description": "Request body for checking a keychain entry via its key",
706+
},
707+
"keychain_delete_entry_request_body": {
708+
"description": "Request body to delete a keychain entry via its key",
732709
"required": true,
733710
"content": {
734711
"application/json": {
735712
"schema": {
736-
"$ref": "#/components/schemas/HasKeychainEntryRequestV1"
713+
"$ref": "#/components/schemas/DeleteKeychainEntryRequestV1"
737714
}
738715
}
739716
}
740-
},
741-
"keychain_delete_entry_request_body": {
742-
"description": "Request body to delete a keychain entry via its key",
717+
},
718+
"keychain_has_entry_request_body": {
719+
"description": "Request body for checking a keychain entry via its key",
743720
"required": true,
744721
"content": {
745722
"application/json": {
746723
"schema": {
747-
"$ref": "#/components/schemas/DeleteKeychainEntryRequestV1"
724+
"$ref": "#/components/schemas/HasKeychainEntryRequestV1"
748725
}
749726
}
750727
}
@@ -822,42 +799,42 @@
822799
"keychain_set_entry_500": {
823800
"description": "Unexpected error."
824801
},
825-
"keychain_has_entry_200": {
802+
"keychain_delete_entry_200": {
826803
"description": "OK",
827804
"content": {
828805
"application/json": {
829-
"schema": {
830-
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
831-
}
806+
"schema": {
807+
"$ref": "#/components/schemas/DeleteKeychainEntryResponseV1"
808+
}
832809
}
833-
}
810+
}
834811
},
835-
"keychain_has_entry_400": {
812+
"keychain_delete_entry_400": {
836813
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
837814
},
838-
"keychain_has_entry_401": {
815+
"keychain_delete_entry_401": {
839816
"description": "Authorization information is missing or invalid."
840817
},
841-
"keychain_has_entry_500": {
818+
"keychain_delete_entry_500": {
842819
"description": "Unexpected error."
843-
},
844-
"keychain_delete_entry_200": {
820+
},
821+
"keychain_has_entry_200": {
845822
"description": "OK",
846823
"content": {
847824
"application/json": {
848-
"schema": {
849-
"$ref": "#/components/schemas/DeleteKeychainEntryResponseV1"
850-
}
825+
"schema": {
826+
"$ref": "#/components/schemas/HasKeychainEntryResponseV1"
827+
}
851828
}
852-
}
829+
}
853830
},
854-
"keychain_delete_entry_400": {
831+
"keychain_has_entry_400": {
855832
"description": "Bad request. Key must be a string and longer than 0, shorter than 1024 characters."
856833
},
857-
"keychain_delete_entry_401": {
834+
"keychain_has_entry_401": {
858835
"description": "Authorization information is missing or invalid."
859836
},
860-
"keychain_delete_entry_500": {
837+
"keychain_has_entry_500": {
861838
"description": "Unexpected error."
862839
}
863840
}

packages/cactus-core-api/src/main/typescript/generated/openapi/typescript-axios/api.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export enum Constants {
269269
*/
270270
export interface DeleteKeychainEntryRequestV1 {
271271
/**
272-
* The key for the entry to check the presence of on the keychain.
272+
* The key for the entry to get from the keychain.
273273
* @type {string}
274274
* @memberof DeleteKeychainEntryRequestV1
275275
*/
@@ -295,7 +295,7 @@ export interface DeleteKeychainEntryResponseV1 {
295295
*/
296296
export interface GetKeychainEntryRequestV1 {
297297
/**
298-
* The key for the entry to get from the keychain.
298+
* The key for the entry to delete from the keychain.
299299
* @type {string}
300300
* @memberof GetKeychainEntryRequestV1
301301
*/
@@ -359,7 +359,7 @@ export interface GetObjectResponseV1 {
359359
*/
360360
export interface HasKeychainEntryRequestV1 {
361361
/**
362-
* The key to check for presence in the keychain.
362+
* The key to check for presence in the keychain
363363
* @type {string}
364364
* @memberof HasKeychainEntryRequestV1
365365
*/
@@ -576,7 +576,7 @@ export interface PluginInstance {
576576
*/
577577
export interface SetKeychainEntryRequestV1 {
578578
/**
579-
* The key for the entry to set on the keychain.
579+
* The key for the entry to check on the keychain.
580580
* @type {string}
581581
* @memberof SetKeychainEntryRequestV1
582582
*/

packages/cactus-plugin-keychain-aws-sm/src/main/json/openapi.json

+63-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"verbLowerCase": "post"
3232
}
3333
},
34-
"operationId": "getKeychainEntry",
34+
"operationId": "getKeychainEntryV1",
3535
"summary": "Retrieves the contents of a keychain entry from the backend.",
3636
"parameters": [],
3737
"requestBody": {
@@ -64,7 +64,7 @@
6464
"verbLowerCase": "post"
6565
}
6666
},
67-
"operationId": "setKeychainEntry",
67+
"operationId": "setKeychainEntryV1",
6868
"summary": "Sets a value under a key on the keychain backend.",
6969
"parameters": [],
7070
"requestBody": {
@@ -85,6 +85,66 @@
8585
}
8686
}
8787
}
88+
},
89+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry": {
90+
"post": {
91+
"x-hyperledger-cactus": {
92+
"http": {
93+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry",
94+
"verbLowerCase": "post"
95+
}
96+
},
97+
"operationId": "deleteKeychainEntryV1",
98+
"summary": "Deletes an entry under a key on the keychain backend.",
99+
"parameters": [],
100+
"requestBody": {
101+
"$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"
102+
},
103+
"responses": {
104+
"200": {
105+
"$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"
106+
},
107+
"400": {
108+
"$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"
109+
},
110+
"401": {
111+
"$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"
112+
},
113+
"500": {
114+
"$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"
115+
}
116+
}
117+
}
118+
},
119+
"/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry": {
120+
"post": {
121+
"x-hyperledger-cactus": {
122+
"http": {
123+
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry",
124+
"verbLowerCase": "post"
125+
}
126+
},
127+
"operationId": "hasKeychainEntryV1",
128+
"summary": "Checks that an entry exists under a key on the keychain backend",
129+
"parameters": [],
130+
"requestBody": {
131+
"$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"
132+
},
133+
"responses": {
134+
"200": {
135+
"$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"
136+
},
137+
"400": {
138+
"$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"
139+
},
140+
"401": {
141+
"$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"
142+
},
143+
"500": {
144+
"$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"
145+
}
146+
}
147+
}
88148
}
89149
}
90-
}
150+
}

0 commit comments

Comments
 (0)