@sphereon/ssi-sdk.kms-rest-client 0.34.1-next.299 → 0.34.1-next.322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +94 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -57
- package/dist/index.d.ts +102 -57
- package/dist/index.js +94 -58
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/plugin.schema.json +92 -57
- package/src/agent/KmsRestClient.ts +6 -7
- package/src/types/IKmsRestClient.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.kms-rest-client",
|
|
3
3
|
"description": "contains the client side to call REST endpoints of a KMS server",
|
|
4
|
-
"version": "0.34.1-next.
|
|
4
|
+
"version": "0.34.1-next.322+78f8dd31",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"generate-plugin-schema": "tsx ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sphereon/ssi-types": "0.34.1-next.
|
|
31
|
+
"@sphereon/ssi-types": "0.34.1-next.322+78f8dd31",
|
|
32
32
|
"cross-fetch": "^3.1.8"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"KMS",
|
|
57
57
|
"REST"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "78f8dd3157066ae8cf11d2ae50c8c3d8f43b8ed0"
|
|
60
60
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"IKmsRestClient": {
|
|
3
3
|
"components": {
|
|
4
4
|
"schemas": {
|
|
5
|
-
"
|
|
5
|
+
"KmsClientCreateRawSignatureArgs": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
"additionalProperties": false,
|
|
227
227
|
"description": "Response body containing the created signature."
|
|
228
228
|
},
|
|
229
|
-
"
|
|
229
|
+
"KmsClientDeleteKeyArgs": {
|
|
230
230
|
"type": "object",
|
|
231
231
|
"properties": {
|
|
232
232
|
"baseUrl": {
|
|
@@ -236,9 +236,10 @@
|
|
|
236
236
|
"type": "string"
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
+
"required": ["aliasOrKid"],
|
|
239
240
|
"additionalProperties": false
|
|
240
241
|
},
|
|
241
|
-
"
|
|
242
|
+
"KmsClientGenerateKeyArgs": {
|
|
242
243
|
"type": "object",
|
|
243
244
|
"additionalProperties": false,
|
|
244
245
|
"properties": {
|
|
@@ -267,6 +268,17 @@
|
|
|
267
268
|
}
|
|
268
269
|
}
|
|
269
270
|
},
|
|
271
|
+
"GenerateKeyResponse": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"properties": {
|
|
274
|
+
"keyPair": {
|
|
275
|
+
"$ref": "#/components/schemas/ManagedKeyPair"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"required": ["keyPair"],
|
|
279
|
+
"additionalProperties": false,
|
|
280
|
+
"description": "Response body containing a generated key pair."
|
|
281
|
+
},
|
|
270
282
|
"ManagedKeyPair": {
|
|
271
283
|
"type": "object",
|
|
272
284
|
"properties": {
|
|
@@ -379,7 +391,7 @@
|
|
|
379
391
|
"additionalProperties": false,
|
|
380
392
|
"description": "Data class representing a cryptographic key pair used with JOSE (JSON Object Signing and Encryption)."
|
|
381
393
|
},
|
|
382
|
-
"
|
|
394
|
+
"KmsClientGetKeyArgs": {
|
|
383
395
|
"type": "object",
|
|
384
396
|
"properties": {
|
|
385
397
|
"baseUrl": {
|
|
@@ -392,6 +404,17 @@
|
|
|
392
404
|
"required": ["aliasOrKid"],
|
|
393
405
|
"additionalProperties": false
|
|
394
406
|
},
|
|
407
|
+
"GetKeyResponse": {
|
|
408
|
+
"type": "object",
|
|
409
|
+
"properties": {
|
|
410
|
+
"keyInfo": {
|
|
411
|
+
"$ref": "#/components/schemas/ManagedKeyInfo"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"required": ["keyInfo"],
|
|
415
|
+
"additionalProperties": false,
|
|
416
|
+
"description": "Response body containing a managed key."
|
|
417
|
+
},
|
|
395
418
|
"ManagedKeyInfo": {
|
|
396
419
|
"type": "object",
|
|
397
420
|
"properties": {
|
|
@@ -441,7 +464,7 @@
|
|
|
441
464
|
"additionalProperties": false,
|
|
442
465
|
"description": "Represents a managed cryptographic key information that is guaranteed to be present and resolved, part of a KMS providing concrete access to the key."
|
|
443
466
|
},
|
|
444
|
-
"
|
|
467
|
+
"KmsClientGetKeyProviderArgs": {
|
|
445
468
|
"type": "object",
|
|
446
469
|
"properties": {
|
|
447
470
|
"baseUrl": {
|
|
@@ -451,6 +474,7 @@
|
|
|
451
474
|
"type": "string"
|
|
452
475
|
}
|
|
453
476
|
},
|
|
477
|
+
"required": ["providerId"],
|
|
454
478
|
"additionalProperties": false
|
|
455
479
|
},
|
|
456
480
|
"KeyProviderResponse": {
|
|
@@ -473,7 +497,7 @@
|
|
|
473
497
|
"enum": ["SOFTWARE", "AZURE_KEYVAULT", "AWS_KMS"],
|
|
474
498
|
"description": "The type of Key Provider. Determines the required configuration settings. - AZURE_KEYVAULT: Microsoft Azure Key Vault or Managed HSM. - AWS_KMS: Amazon Web Services Key Management Service."
|
|
475
499
|
},
|
|
476
|
-
"
|
|
500
|
+
"kmsClientGetResolverArgs": {
|
|
477
501
|
"type": "object",
|
|
478
502
|
"properties": {
|
|
479
503
|
"baseUrl": {
|
|
@@ -517,7 +541,7 @@
|
|
|
517
541
|
"enum": ["JWK", "KID", "COSE_KEY", "X5C", "DID"],
|
|
518
542
|
"description": "Method used to identify cryptographic keys."
|
|
519
543
|
},
|
|
520
|
-
"
|
|
544
|
+
"KmsClientIsValidRawSignatureArgs": {
|
|
521
545
|
"type": "object",
|
|
522
546
|
"additionalProperties": false,
|
|
523
547
|
"properties": {
|
|
@@ -548,7 +572,7 @@
|
|
|
548
572
|
"additionalProperties": false,
|
|
549
573
|
"description": "Response body containing the details of the signature verification."
|
|
550
574
|
},
|
|
551
|
-
"
|
|
575
|
+
"KmsClientListKeyProvidersArgs": {
|
|
552
576
|
"type": "object",
|
|
553
577
|
"properties": {
|
|
554
578
|
"baseUrl": {
|
|
@@ -586,7 +610,7 @@
|
|
|
586
610
|
"additionalProperties": false,
|
|
587
611
|
"description": "Response body containing the details of a Key Provider instance."
|
|
588
612
|
},
|
|
589
|
-
"
|
|
613
|
+
"KmsClientListKeysArgs": {
|
|
590
614
|
"type": "object",
|
|
591
615
|
"properties": {
|
|
592
616
|
"baseUrl": {
|
|
@@ -612,7 +636,7 @@
|
|
|
612
636
|
"additionalProperties": false,
|
|
613
637
|
"description": "Response body containing all the managed keys."
|
|
614
638
|
},
|
|
615
|
-
"
|
|
639
|
+
"KmsClientListResolversArgs": {
|
|
616
640
|
"type": "object",
|
|
617
641
|
"properties": {
|
|
618
642
|
"baseUrl": {
|
|
@@ -635,7 +659,7 @@
|
|
|
635
659
|
"additionalProperties": false,
|
|
636
660
|
"description": "Response body containing all the resolvers."
|
|
637
661
|
},
|
|
638
|
-
"
|
|
662
|
+
"KmsClientProviderDeleteKeyArgs": {
|
|
639
663
|
"type": "object",
|
|
640
664
|
"properties": {
|
|
641
665
|
"baseUrl": {
|
|
@@ -651,7 +675,7 @@
|
|
|
651
675
|
"required": ["providerId", "aliasOrKid"],
|
|
652
676
|
"additionalProperties": false
|
|
653
677
|
},
|
|
654
|
-
"
|
|
678
|
+
"KmsClientProviderGenerateKeyArgs": {
|
|
655
679
|
"type": "object",
|
|
656
680
|
"additionalProperties": false,
|
|
657
681
|
"properties": {
|
|
@@ -680,7 +704,7 @@
|
|
|
680
704
|
},
|
|
681
705
|
"required": ["providerId"]
|
|
682
706
|
},
|
|
683
|
-
"
|
|
707
|
+
"KmsClientProviderGetKeyArgs": {
|
|
684
708
|
"type": "object",
|
|
685
709
|
"properties": {
|
|
686
710
|
"baseUrl": {
|
|
@@ -696,7 +720,7 @@
|
|
|
696
720
|
"required": ["providerId", "aliasOrKid"],
|
|
697
721
|
"additionalProperties": false
|
|
698
722
|
},
|
|
699
|
-
"
|
|
723
|
+
"KmsClientProviderListKeysArgs": {
|
|
700
724
|
"type": "object",
|
|
701
725
|
"properties": {
|
|
702
726
|
"baseUrl": {
|
|
@@ -709,7 +733,7 @@
|
|
|
709
733
|
"required": ["providerId"],
|
|
710
734
|
"additionalProperties": false
|
|
711
735
|
},
|
|
712
|
-
"
|
|
736
|
+
"KmsClientProviderStoreKeyArgs": {
|
|
713
737
|
"type": "object",
|
|
714
738
|
"additionalProperties": false,
|
|
715
739
|
"properties": {
|
|
@@ -781,7 +805,18 @@
|
|
|
781
805
|
"additionalProperties": false,
|
|
782
806
|
"description": "Represents a resolved cryptographic key information where the key is guaranteed to be present and resolved, providing concrete access to the key."
|
|
783
807
|
},
|
|
784
|
-
"
|
|
808
|
+
"StoreKeyResponse": {
|
|
809
|
+
"type": "object",
|
|
810
|
+
"properties": {
|
|
811
|
+
"keyInfo": {
|
|
812
|
+
"$ref": "#/components/schemas/ManagedKeyInfo"
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
"required": ["keyInfo"],
|
|
816
|
+
"additionalProperties": false,
|
|
817
|
+
"description": "Response body containing a stored key."
|
|
818
|
+
},
|
|
819
|
+
"KmsClientResolveKeyArgs": {
|
|
785
820
|
"type": "object",
|
|
786
821
|
"additionalProperties": false,
|
|
787
822
|
"properties": {
|
|
@@ -823,7 +858,7 @@
|
|
|
823
858
|
"type": "string"
|
|
824
859
|
}
|
|
825
860
|
},
|
|
826
|
-
"
|
|
861
|
+
"KmsClientStoreKeyArgs": {
|
|
827
862
|
"type": "object",
|
|
828
863
|
"additionalProperties": false,
|
|
829
864
|
"properties": {
|
|
@@ -845,157 +880,157 @@
|
|
|
845
880
|
}
|
|
846
881
|
},
|
|
847
882
|
"methods": {
|
|
848
|
-
"
|
|
883
|
+
"kmsClientCreateRawSignature": {
|
|
849
884
|
"description": "",
|
|
850
885
|
"arguments": {
|
|
851
|
-
"$ref": "#/components/schemas/
|
|
886
|
+
"$ref": "#/components/schemas/KmsClientCreateRawSignatureArgs"
|
|
852
887
|
},
|
|
853
888
|
"returnType": {
|
|
854
889
|
"$ref": "#/components/schemas/CreateRawSignatureResponse"
|
|
855
890
|
}
|
|
856
891
|
},
|
|
857
|
-
"
|
|
892
|
+
"kmsClientDeleteKey": {
|
|
858
893
|
"description": "",
|
|
859
894
|
"arguments": {
|
|
860
|
-
"$ref": "#/components/schemas/
|
|
895
|
+
"$ref": "#/components/schemas/KmsClientDeleteKeyArgs"
|
|
861
896
|
},
|
|
862
897
|
"returnType": {
|
|
863
898
|
"type": "boolean"
|
|
864
899
|
}
|
|
865
900
|
},
|
|
866
|
-
"
|
|
901
|
+
"kmsClientGenerateKey": {
|
|
867
902
|
"description": "",
|
|
868
903
|
"arguments": {
|
|
869
|
-
"$ref": "#/components/schemas/
|
|
904
|
+
"$ref": "#/components/schemas/KmsClientGenerateKeyArgs"
|
|
870
905
|
},
|
|
871
906
|
"returnType": {
|
|
872
|
-
"$ref": "#/components/schemas/
|
|
907
|
+
"$ref": "#/components/schemas/GenerateKeyResponse"
|
|
873
908
|
}
|
|
874
909
|
},
|
|
875
|
-
"
|
|
910
|
+
"kmsClientGetKey": {
|
|
876
911
|
"description": "",
|
|
877
912
|
"arguments": {
|
|
878
|
-
"$ref": "#/components/schemas/
|
|
913
|
+
"$ref": "#/components/schemas/KmsClientGetKeyArgs"
|
|
879
914
|
},
|
|
880
915
|
"returnType": {
|
|
881
|
-
"$ref": "#/components/schemas/
|
|
916
|
+
"$ref": "#/components/schemas/GetKeyResponse"
|
|
882
917
|
}
|
|
883
918
|
},
|
|
884
|
-
"
|
|
919
|
+
"kmsClientGetKeyProvider": {
|
|
885
920
|
"description": "",
|
|
886
921
|
"arguments": {
|
|
887
|
-
"$ref": "#/components/schemas/
|
|
922
|
+
"$ref": "#/components/schemas/KmsClientGetKeyProviderArgs"
|
|
888
923
|
},
|
|
889
924
|
"returnType": {
|
|
890
925
|
"$ref": "#/components/schemas/KeyProviderResponse"
|
|
891
926
|
}
|
|
892
927
|
},
|
|
893
|
-
"
|
|
928
|
+
"kmsClientGetResolver": {
|
|
894
929
|
"description": "",
|
|
895
930
|
"arguments": {
|
|
896
|
-
"$ref": "#/components/schemas/
|
|
931
|
+
"$ref": "#/components/schemas/kmsClientGetResolverArgs"
|
|
897
932
|
},
|
|
898
933
|
"returnType": {
|
|
899
934
|
"$ref": "#/components/schemas/Resolver"
|
|
900
935
|
}
|
|
901
936
|
},
|
|
902
|
-
"
|
|
937
|
+
"kmsClientIsValidRawSignature": {
|
|
903
938
|
"description": "",
|
|
904
939
|
"arguments": {
|
|
905
|
-
"$ref": "#/components/schemas/
|
|
940
|
+
"$ref": "#/components/schemas/KmsClientIsValidRawSignatureArgs"
|
|
906
941
|
},
|
|
907
942
|
"returnType": {
|
|
908
943
|
"$ref": "#/components/schemas/VerifyRawSignatureResponse"
|
|
909
944
|
}
|
|
910
945
|
},
|
|
911
|
-
"
|
|
946
|
+
"kmsClientListKeyProviders": {
|
|
912
947
|
"description": "",
|
|
913
948
|
"arguments": {
|
|
914
|
-
"$ref": "#/components/schemas/
|
|
949
|
+
"$ref": "#/components/schemas/KmsClientListKeyProvidersArgs"
|
|
915
950
|
},
|
|
916
951
|
"returnType": {
|
|
917
952
|
"$ref": "#/components/schemas/ListKeyProvidersResponse"
|
|
918
953
|
}
|
|
919
954
|
},
|
|
920
|
-
"
|
|
955
|
+
"kmsClientListKeys": {
|
|
921
956
|
"description": "",
|
|
922
957
|
"arguments": {
|
|
923
|
-
"$ref": "#/components/schemas/
|
|
958
|
+
"$ref": "#/components/schemas/KmsClientListKeysArgs"
|
|
924
959
|
},
|
|
925
960
|
"returnType": {
|
|
926
961
|
"$ref": "#/components/schemas/ListKeysResponse"
|
|
927
962
|
}
|
|
928
963
|
},
|
|
929
|
-
"
|
|
964
|
+
"kmsClientListResolvers": {
|
|
930
965
|
"description": "",
|
|
931
966
|
"arguments": {
|
|
932
|
-
"$ref": "#/components/schemas/
|
|
967
|
+
"$ref": "#/components/schemas/KmsClientListResolversArgs"
|
|
933
968
|
},
|
|
934
969
|
"returnType": {
|
|
935
970
|
"$ref": "#/components/schemas/ListResolversResponse"
|
|
936
971
|
}
|
|
937
972
|
},
|
|
938
|
-
"
|
|
973
|
+
"kmsClientProviderDeleteKey": {
|
|
939
974
|
"description": "",
|
|
940
975
|
"arguments": {
|
|
941
|
-
"$ref": "#/components/schemas/
|
|
976
|
+
"$ref": "#/components/schemas/KmsClientProviderDeleteKeyArgs"
|
|
942
977
|
},
|
|
943
978
|
"returnType": {
|
|
944
979
|
"type": "boolean"
|
|
945
980
|
}
|
|
946
981
|
},
|
|
947
|
-
"
|
|
982
|
+
"kmsClientProviderGenerateKey": {
|
|
948
983
|
"description": "",
|
|
949
984
|
"arguments": {
|
|
950
|
-
"$ref": "#/components/schemas/
|
|
985
|
+
"$ref": "#/components/schemas/KmsClientProviderGenerateKeyArgs"
|
|
951
986
|
},
|
|
952
987
|
"returnType": {
|
|
953
|
-
"$ref": "#/components/schemas/
|
|
988
|
+
"$ref": "#/components/schemas/GenerateKeyResponse"
|
|
954
989
|
}
|
|
955
990
|
},
|
|
956
|
-
"
|
|
991
|
+
"kmsClientProviderGetKey": {
|
|
957
992
|
"description": "",
|
|
958
993
|
"arguments": {
|
|
959
|
-
"$ref": "#/components/schemas/
|
|
994
|
+
"$ref": "#/components/schemas/KmsClientProviderGetKeyArgs"
|
|
960
995
|
},
|
|
961
996
|
"returnType": {
|
|
962
|
-
"$ref": "#/components/schemas/
|
|
997
|
+
"$ref": "#/components/schemas/GetKeyResponse"
|
|
963
998
|
}
|
|
964
999
|
},
|
|
965
|
-
"
|
|
1000
|
+
"kmsClientProviderListKeys": {
|
|
966
1001
|
"description": "",
|
|
967
1002
|
"arguments": {
|
|
968
|
-
"$ref": "#/components/schemas/
|
|
1003
|
+
"$ref": "#/components/schemas/KmsClientProviderListKeysArgs"
|
|
969
1004
|
},
|
|
970
1005
|
"returnType": {
|
|
971
1006
|
"$ref": "#/components/schemas/ListKeysResponse"
|
|
972
1007
|
}
|
|
973
1008
|
},
|
|
974
|
-
"
|
|
1009
|
+
"kmsClientProviderStoreKey": {
|
|
975
1010
|
"description": "",
|
|
976
1011
|
"arguments": {
|
|
977
|
-
"$ref": "#/components/schemas/
|
|
1012
|
+
"$ref": "#/components/schemas/KmsClientProviderStoreKeyArgs"
|
|
978
1013
|
},
|
|
979
1014
|
"returnType": {
|
|
980
|
-
"$ref": "#/components/schemas/
|
|
1015
|
+
"$ref": "#/components/schemas/StoreKeyResponse"
|
|
981
1016
|
}
|
|
982
1017
|
},
|
|
983
|
-
"
|
|
1018
|
+
"kmsClientResolveKey": {
|
|
984
1019
|
"description": "",
|
|
985
1020
|
"arguments": {
|
|
986
|
-
"$ref": "#/components/schemas/
|
|
1021
|
+
"$ref": "#/components/schemas/KmsClientResolveKeyArgs"
|
|
987
1022
|
},
|
|
988
1023
|
"returnType": {
|
|
989
1024
|
"$ref": "#/components/schemas/ResolvedKeyInfo"
|
|
990
1025
|
}
|
|
991
1026
|
},
|
|
992
|
-
"
|
|
1027
|
+
"kmsClientStoreKey": {
|
|
993
1028
|
"description": "",
|
|
994
1029
|
"arguments": {
|
|
995
|
-
"$ref": "#/components/schemas/
|
|
1030
|
+
"$ref": "#/components/schemas/KmsClientStoreKeyArgs"
|
|
996
1031
|
},
|
|
997
1032
|
"returnType": {
|
|
998
|
-
"$ref": "#/components/schemas/
|
|
1033
|
+
"$ref": "#/components/schemas/StoreKeyResponse"
|
|
999
1034
|
}
|
|
1000
1035
|
}
|
|
1001
1036
|
}
|
|
@@ -40,7 +40,7 @@ import type {
|
|
|
40
40
|
KeyProviderResponse,
|
|
41
41
|
GenerateKeyResponse,
|
|
42
42
|
StoreKeyResponse,
|
|
43
|
-
GetKeyResponse
|
|
43
|
+
GetKeyResponse,
|
|
44
44
|
} from '../models'
|
|
45
45
|
import {
|
|
46
46
|
CreateRawSignatureResponseFromJSONTyped,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
StoreKeyToJSONTyped,
|
|
60
60
|
StoreKeyResponseFromJSONTyped,
|
|
61
61
|
VerifyRawSignatureResponseFromJSONTyped,
|
|
62
|
-
VerifyRawSignatureToJSONTyped
|
|
62
|
+
VerifyRawSignatureToJSONTyped,
|
|
63
63
|
} from '../models'
|
|
64
64
|
|
|
65
65
|
const logger = Loggers.DEFAULT.get('sphereon:ssi-sdk:kms:rest-client')
|
|
@@ -392,6 +392,7 @@ export class KmsRestClient implements IAgentPlugin {
|
|
|
392
392
|
alg: args.alg,
|
|
393
393
|
keyOperations: args.keyOperations,
|
|
394
394
|
use: args.use,
|
|
395
|
+
alias: args.alias,
|
|
395
396
|
} satisfies GenerateKey
|
|
396
397
|
const response = await fetch(url, {
|
|
397
398
|
method: 'POST',
|
|
@@ -477,11 +478,9 @@ export class KmsRestClient implements IAgentPlugin {
|
|
|
477
478
|
}
|
|
478
479
|
|
|
479
480
|
private async handleHttpError(url: string, response: Response): Promise<never> {
|
|
480
|
-
const contentType = response.headers.get(
|
|
481
|
-
const isJson = contentType?.includes(
|
|
482
|
-
const responseBody = isJson
|
|
483
|
-
? JSON.stringify(await response.json())
|
|
484
|
-
: await response.text()
|
|
481
|
+
const contentType = response.headers.get('content-type')
|
|
482
|
+
const isJson = contentType?.includes('application/json')
|
|
483
|
+
const responseBody = isJson ? JSON.stringify(await response.json()) : await response.text()
|
|
485
484
|
|
|
486
485
|
return Promise.reject(Error(`request to ${url} returned http error ${response.status} - ${responseBody}`))
|
|
487
486
|
}
|