@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.SSISDK.70.integrate.digidentity.308 → 0.34.1-feature.SSISDK.78.306
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 +259 -96
- 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 +259 -96
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/plugin.schema.json +259 -95
- package/src/agent/KmsRestClient.ts +7 -6
|
@@ -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,7 +392,6 @@ export class KmsRestClient implements IAgentPlugin {
|
|
|
392
392
|
alg: args.alg,
|
|
393
393
|
keyOperations: args.keyOperations,
|
|
394
394
|
use: args.use,
|
|
395
|
-
alias: args.alias,
|
|
396
395
|
} satisfies GenerateKey
|
|
397
396
|
const response = await fetch(url, {
|
|
398
397
|
method: 'POST',
|
|
@@ -478,9 +477,11 @@ export class KmsRestClient implements IAgentPlugin {
|
|
|
478
477
|
}
|
|
479
478
|
|
|
480
479
|
private async handleHttpError(url: string, response: Response): Promise<never> {
|
|
481
|
-
const contentType = response.headers.get(
|
|
482
|
-
const isJson = contentType?.includes(
|
|
483
|
-
const responseBody = isJson
|
|
480
|
+
const contentType = response.headers.get("content-type")
|
|
481
|
+
const isJson = contentType?.includes("application/json")
|
|
482
|
+
const responseBody = isJson
|
|
483
|
+
? JSON.stringify(await response.json())
|
|
484
|
+
: await response.text()
|
|
484
485
|
|
|
485
486
|
return Promise.reject(Error(`request to ${url} returned http error ${response.status} - ${responseBody}`))
|
|
486
487
|
}
|