@sphereon/ssi-sdk.kms-rest-client 0.34.1-feature.SSISDK.70.integrate.digidentity.311 → 0.34.1-feature.SSISDK.82.linkedVP.325
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 +19 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -28
- package/dist/index.d.ts +52 -28
- package/dist/index.js +19 -81
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/agent/KmsRestClient.ts +41 -54
- package/src/types/IKmsRestClient.ts +61 -44
package/dist/index.cjs
CHANGED
|
@@ -3767,11 +3767,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3767
3767
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
3768
3768
|
const url = _KmsRestClient.urlWithBase(`/resolvers/${args.resolverId}`, baseUrl);
|
|
3769
3769
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3770
|
-
method: "GET"
|
|
3771
|
-
headers: await this.createHeaders({
|
|
3772
|
-
tenantId: args.tenantId,
|
|
3773
|
-
userId: args.userId
|
|
3774
|
-
})
|
|
3770
|
+
method: "GET"
|
|
3775
3771
|
});
|
|
3776
3772
|
logger.debug(`get resolver response: ${response}`);
|
|
3777
3773
|
if (!response.ok) {
|
|
@@ -3784,11 +3780,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3784
3780
|
const baseUrl = this.assertedAgentBaseUrl(args?.baseUrl);
|
|
3785
3781
|
const url = _KmsRestClient.urlWithBase("/resolvers", baseUrl);
|
|
3786
3782
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3787
|
-
method: "GET"
|
|
3788
|
-
headers: await this.createHeaders({
|
|
3789
|
-
tenantId: args?.tenantId,
|
|
3790
|
-
userId: args?.userId
|
|
3791
|
-
})
|
|
3783
|
+
method: "GET"
|
|
3792
3784
|
});
|
|
3793
3785
|
logger.debug(`list resolvers response: ${response}`);
|
|
3794
3786
|
if (!response.ok) {
|
|
@@ -3809,9 +3801,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3809
3801
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3810
3802
|
method: "POST",
|
|
3811
3803
|
headers: await this.createHeaders({
|
|
3812
|
-
|
|
3813
|
-
tenantId: args.tenantId,
|
|
3814
|
-
userId: args.userId
|
|
3804
|
+
"Content-Type": "application/json"
|
|
3815
3805
|
}),
|
|
3816
3806
|
body: JSON.stringify(ResolvePublicKeyToJSONTyped(body))
|
|
3817
3807
|
});
|
|
@@ -3832,9 +3822,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3832
3822
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3833
3823
|
method: "POST",
|
|
3834
3824
|
headers: await this.createHeaders({
|
|
3835
|
-
|
|
3836
|
-
tenantId: args.tenantId,
|
|
3837
|
-
userId: args.userId
|
|
3825
|
+
"Content-Type": "application/json"
|
|
3838
3826
|
}),
|
|
3839
3827
|
body: JSON.stringify(CreateRawSignatureToJSONTyped(body))
|
|
3840
3828
|
});
|
|
@@ -3856,9 +3844,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3856
3844
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3857
3845
|
method: "POST",
|
|
3858
3846
|
headers: await this.createHeaders({
|
|
3859
|
-
|
|
3860
|
-
tenantId: args.tenantId,
|
|
3861
|
-
userId: args.userId
|
|
3847
|
+
"Content-Type": "application/json"
|
|
3862
3848
|
}),
|
|
3863
3849
|
body: JSON.stringify(VerifyRawSignatureToJSONTyped(body))
|
|
3864
3850
|
});
|
|
@@ -3873,11 +3859,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3873
3859
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
3874
3860
|
const url = _KmsRestClient.urlWithBase(`/keys/${args.aliasOrKid}`, baseUrl);
|
|
3875
3861
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3876
|
-
method: "GET"
|
|
3877
|
-
headers: await this.createHeaders({
|
|
3878
|
-
tenantId: args.tenantId,
|
|
3879
|
-
userId: args.userId
|
|
3880
|
-
})
|
|
3862
|
+
method: "GET"
|
|
3881
3863
|
});
|
|
3882
3864
|
logger.debug(`get key response: ${response}`);
|
|
3883
3865
|
if (!response.ok) {
|
|
@@ -3894,11 +3876,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3894
3876
|
}
|
|
3895
3877
|
});
|
|
3896
3878
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3897
|
-
method: "GET"
|
|
3898
|
-
headers: await this.createHeaders({
|
|
3899
|
-
tenantId: args?.tenantId,
|
|
3900
|
-
userId: args?.userId
|
|
3901
|
-
})
|
|
3879
|
+
method: "GET"
|
|
3902
3880
|
});
|
|
3903
3881
|
logger.debug(`list keys response: ${response}`);
|
|
3904
3882
|
if (!response.ok) {
|
|
@@ -3917,9 +3895,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3917
3895
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3918
3896
|
method: "POST",
|
|
3919
3897
|
headers: await this.createHeaders({
|
|
3920
|
-
|
|
3921
|
-
tenantId: args.tenantId,
|
|
3922
|
-
userId: args.userId
|
|
3898
|
+
"Content-Type": "application/json"
|
|
3923
3899
|
}),
|
|
3924
3900
|
body: JSON.stringify(StoreKeyToJSONTyped(body))
|
|
3925
3901
|
});
|
|
@@ -3942,9 +3918,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3942
3918
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3943
3919
|
method: "POST",
|
|
3944
3920
|
headers: await this.createHeaders({
|
|
3945
|
-
|
|
3946
|
-
tenantId: args.tenantId,
|
|
3947
|
-
userId: args.userId
|
|
3921
|
+
"Content-Type": "application/json"
|
|
3948
3922
|
}),
|
|
3949
3923
|
body: JSON.stringify(GenerateKeyGlobalToJSONTyped(body))
|
|
3950
3924
|
});
|
|
@@ -3959,11 +3933,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3959
3933
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
3960
3934
|
const url = _KmsRestClient.urlWithBase(`/keys/${args.aliasOrKid}`, baseUrl);
|
|
3961
3935
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3962
|
-
method: "DELETE"
|
|
3963
|
-
headers: await this.createHeaders({
|
|
3964
|
-
tenantId: args.tenantId,
|
|
3965
|
-
userId: args.userId
|
|
3966
|
-
})
|
|
3936
|
+
method: "DELETE"
|
|
3967
3937
|
});
|
|
3968
3938
|
logger.debug(`delete key response: ${response}`);
|
|
3969
3939
|
if (!response.ok) {
|
|
@@ -3976,11 +3946,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3976
3946
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
3977
3947
|
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}`, baseUrl);
|
|
3978
3948
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3979
|
-
method: "GET"
|
|
3980
|
-
headers: await this.createHeaders({
|
|
3981
|
-
tenantId: args.tenantId,
|
|
3982
|
-
userId: args.userId
|
|
3983
|
-
})
|
|
3949
|
+
method: "GET"
|
|
3984
3950
|
});
|
|
3985
3951
|
logger.debug(`get provider response: ${response}`);
|
|
3986
3952
|
if (!response.ok) {
|
|
@@ -3993,11 +3959,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
3993
3959
|
const baseUrl = this.assertedAgentBaseUrl(args?.baseUrl);
|
|
3994
3960
|
const url = _KmsRestClient.urlWithBase("/providers", baseUrl);
|
|
3995
3961
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
3996
|
-
method: "GET"
|
|
3997
|
-
headers: await this.createHeaders({
|
|
3998
|
-
tenantId: args?.tenantId,
|
|
3999
|
-
userId: args?.userId
|
|
4000
|
-
})
|
|
3962
|
+
method: "GET"
|
|
4001
3963
|
});
|
|
4002
3964
|
logger.debug(`list providers response: ${response}`);
|
|
4003
3965
|
if (!response.ok) {
|
|
@@ -4010,11 +3972,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4010
3972
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
4011
3973
|
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys`, baseUrl);
|
|
4012
3974
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
4013
|
-
method: "GET"
|
|
4014
|
-
headers: await this.createHeaders({
|
|
4015
|
-
tenantId: args.tenantId,
|
|
4016
|
-
userId: args.userId
|
|
4017
|
-
})
|
|
3975
|
+
method: "GET"
|
|
4018
3976
|
});
|
|
4019
3977
|
logger.debug(`list provider keys response: ${response}`);
|
|
4020
3978
|
if (!response.ok) {
|
|
@@ -4033,9 +3991,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4033
3991
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
4034
3992
|
method: "POST",
|
|
4035
3993
|
headers: await this.createHeaders({
|
|
4036
|
-
|
|
4037
|
-
tenantId: args.tenantId,
|
|
4038
|
-
userId: args.userId
|
|
3994
|
+
"Content-Type": "application/json"
|
|
4039
3995
|
}),
|
|
4040
3996
|
body: JSON.stringify(StoreKeyToJSONTyped(body))
|
|
4041
3997
|
});
|
|
@@ -4058,9 +4014,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4058
4014
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
4059
4015
|
method: "POST",
|
|
4060
4016
|
headers: await this.createHeaders({
|
|
4061
|
-
|
|
4062
|
-
tenantId: args.tenantId,
|
|
4063
|
-
userId: args.userId
|
|
4017
|
+
"Content-Type": "application/json"
|
|
4064
4018
|
}),
|
|
4065
4019
|
body: JSON.stringify(GenerateKeyToJSONTyped(body))
|
|
4066
4020
|
});
|
|
@@ -4075,11 +4029,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4075
4029
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
4076
4030
|
const url = _KmsRestClient.urlWithBase(`/providers/${args.providerId}/keys/${args.aliasOrKid}`, baseUrl);
|
|
4077
4031
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
4078
|
-
method: "GET"
|
|
4079
|
-
headers: await this.createHeaders({
|
|
4080
|
-
tenantId: args.tenantId,
|
|
4081
|
-
userId: args.userId
|
|
4082
|
-
})
|
|
4032
|
+
method: "GET"
|
|
4083
4033
|
});
|
|
4084
4034
|
logger.debug(`get provider key response: ${response}`);
|
|
4085
4035
|
if (!response.ok) {
|
|
@@ -4092,11 +4042,7 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4092
4042
|
const baseUrl = this.assertedAgentBaseUrl(args.baseUrl);
|
|
4093
4043
|
const url = _KmsRestClient.urlWithBase(`providers/${args.providerId}/keys/${args.aliasOrKid}`, baseUrl);
|
|
4094
4044
|
const response = await (0, import_cross_fetch.fetch)(url, {
|
|
4095
|
-
method: "DELETE"
|
|
4096
|
-
headers: await this.createHeaders({
|
|
4097
|
-
tenantId: args.tenantId,
|
|
4098
|
-
userId: args.userId
|
|
4099
|
-
})
|
|
4045
|
+
method: "DELETE"
|
|
4100
4046
|
});
|
|
4101
4047
|
logger.debug(`delete key response: ${response}`);
|
|
4102
4048
|
if (!response.ok) {
|
|
@@ -4112,17 +4058,9 @@ var KmsRestClient = class _KmsRestClient {
|
|
|
4112
4058
|
}
|
|
4113
4059
|
throw new Error("No base url has been provided");
|
|
4114
4060
|
}
|
|
4115
|
-
async createHeaders(
|
|
4061
|
+
async createHeaders(existing) {
|
|
4116
4062
|
const headers = {
|
|
4117
|
-
...
|
|
4118
|
-
"Content-Type": args.contentType
|
|
4119
|
-
} : {},
|
|
4120
|
-
...args?.tenantId ? {
|
|
4121
|
-
"X-Tenant-ID": args.tenantId
|
|
4122
|
-
} : {},
|
|
4123
|
-
...args?.userId ? {
|
|
4124
|
-
"X-User-ID": args.userId
|
|
4125
|
-
} : {},
|
|
4063
|
+
...existing,
|
|
4126
4064
|
Accept: "application/json"
|
|
4127
4065
|
};
|
|
4128
4066
|
if (this.authOpts?.enabled === true) {
|