@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.SSISDK.70.integrate.digidentity.307 → 0.34.1-feature.SSISDK.70.integrate.digidentity.308
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 +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/agent/KmsRestClient.ts +6 -7
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-feature.SSISDK.70.integrate.digidentity.
|
|
4
|
+
"version": "0.34.1-feature.SSISDK.70.integrate.digidentity.308+0588b776",
|
|
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-feature.SSISDK.70.integrate.digidentity.
|
|
31
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.70.integrate.digidentity.308+0588b776",
|
|
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": "0588b776578b892690a13b6945ba9c91ca418598"
|
|
60
60
|
}
|
|
@@ -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
|
}
|