@sphereon/ssi-sdk.oid4vci-issuer-rest-api 0.34.1-feature.merge.crypto.extensions.modules.39 → 0.34.1-fix.78
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.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/package.json +20 -19
- package/src/issuer-metadata-api-functions.ts +12 -12
- package/src/types.ts +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,9 +7,10 @@ import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resoluti
|
|
|
7
7
|
import { IOID4VCIStore } from '@sphereon/ssi-sdk.oid4vci-issuer-store';
|
|
8
8
|
import { IAgentContext, IDIDManager, IKeyManager, IResolver, ICredentialVerifier, ICredentialIssuer } from '@veramo/core';
|
|
9
9
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
10
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
11
|
|
|
11
12
|
type IRequiredContext = IAgentContext<IPlugins>;
|
|
12
|
-
type IPlugins = IDIDManager & IKeyManager & IResolver & IIdentifierResolution & IOID4VCIStore & IOID4VCIIssuer & ICredentialVerifier & ICredentialIssuer & IJwtService;
|
|
13
|
+
type IPlugins = IDIDManager & IKeyManager & IResolver & IIdentifierResolution & IOID4VCIStore & IOID4VCIIssuer & ICredentialVerifier & ICredentialIssuer & IJwtService & IVcdmCredentialPlugin;
|
|
13
14
|
|
|
14
15
|
interface IOID4VCIRestAPIOpts extends IOID4VCIServerOpts {
|
|
15
16
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,10 @@ import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resoluti
|
|
|
7
7
|
import { IOID4VCIStore } from '@sphereon/ssi-sdk.oid4vci-issuer-store';
|
|
8
8
|
import { IAgentContext, IDIDManager, IKeyManager, IResolver, ICredentialVerifier, ICredentialIssuer } from '@veramo/core';
|
|
9
9
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
10
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
11
|
|
|
11
12
|
type IRequiredContext = IAgentContext<IPlugins>;
|
|
12
|
-
type IPlugins = IDIDManager & IKeyManager & IResolver & IIdentifierResolution & IOID4VCIStore & IOID4VCIIssuer & ICredentialVerifier & ICredentialIssuer & IJwtService;
|
|
13
|
+
type IPlugins = IDIDManager & IKeyManager & IResolver & IIdentifierResolution & IOID4VCIStore & IOID4VCIIssuer & ICredentialVerifier & ICredentialIssuer & IJwtService & IVcdmCredentialPlugin;
|
|
13
14
|
|
|
14
15
|
interface IOID4VCIRestAPIOpts extends IOID4VCIServerOpts {
|
|
15
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oid4vci-issuer-rest-api",
|
|
3
|
-
"version": "0.34.1-
|
|
3
|
+
"version": "0.34.1-fix.78+5114f005",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -23,23 +23,24 @@
|
|
|
23
23
|
"start:dev": "ts-node __tests__/RestAPI.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@sphereon/oid4vci-common": "0.19.1-
|
|
27
|
-
"@sphereon/oid4vci-issuer": "0.19.1-
|
|
28
|
-
"@sphereon/oid4vci-issuer-server": "0.19.1-
|
|
29
|
-
"@sphereon/ssi-express-support": "0.34.1-
|
|
30
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-
|
|
31
|
-
"@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-
|
|
32
|
-
"@sphereon/ssi-sdk.
|
|
33
|
-
"@sphereon/ssi-sdk.
|
|
34
|
-
"@sphereon/ssi-sdk.oid4vci-issuer
|
|
35
|
-
"@sphereon/ssi-
|
|
26
|
+
"@sphereon/oid4vci-common": "0.19.1-feature.DIIPv4.86",
|
|
27
|
+
"@sphereon/oid4vci-issuer": "0.19.1-feature.DIIPv4.86",
|
|
28
|
+
"@sphereon/oid4vci-issuer-server": "0.19.1-feature.DIIPv4.86",
|
|
29
|
+
"@sphereon/ssi-express-support": "0.34.1-fix.78+5114f005",
|
|
30
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-fix.78+5114f005",
|
|
31
|
+
"@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-fix.78+5114f005",
|
|
32
|
+
"@sphereon/ssi-sdk.credential-vcdm": "0.34.1-fix.78+5114f005",
|
|
33
|
+
"@sphereon/ssi-sdk.kv-store-temp": "0.34.1-fix.78+5114f005",
|
|
34
|
+
"@sphereon/ssi-sdk.oid4vci-issuer": "0.34.1-fix.78+5114f005",
|
|
35
|
+
"@sphereon/ssi-sdk.oid4vci-issuer-store": "0.34.1-fix.78+5114f005",
|
|
36
|
+
"@sphereon/ssi-types": "0.34.1-fix.78+5114f005",
|
|
36
37
|
"@veramo/core": "4.2.0",
|
|
37
38
|
"@veramo/credential-w3c": "4.2.0",
|
|
38
39
|
"awesome-qr": "^2.1.5-rc.0",
|
|
39
40
|
"body-parser": "^1.20.2",
|
|
40
41
|
"cookie-parser": "^1.4.6",
|
|
41
42
|
"cors": "^2.8.5",
|
|
42
|
-
"cross-fetch": "^
|
|
43
|
+
"cross-fetch": "^4.1.0",
|
|
43
44
|
"dotenv-flow": "^3.3.0",
|
|
44
45
|
"express": "^4.19.2",
|
|
45
46
|
"short-uuid": "^4.2.2",
|
|
@@ -51,12 +52,12 @@
|
|
|
51
52
|
"@sphereon/did-uni-client": "^0.6.3",
|
|
52
53
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
53
54
|
"@sphereon/pex-models": "^2.3.2",
|
|
54
|
-
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.34.1-
|
|
55
|
-
"@sphereon/ssi-sdk-ext.key-manager": "0.34.1-
|
|
56
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-
|
|
57
|
-
"@sphereon/ssi-sdk-ext.kms-local": "0.34.1-
|
|
58
|
-
"@sphereon/ssi-sdk.credential-vcdm-jsonld-provider": "0.34.1-
|
|
59
|
-
"@sphereon/ssi-sdk.data-store": "0.34.1-
|
|
55
|
+
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.34.1-fix.78+5114f005",
|
|
56
|
+
"@sphereon/ssi-sdk-ext.key-manager": "0.34.1-fix.78+5114f005",
|
|
57
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-fix.78+5114f005",
|
|
58
|
+
"@sphereon/ssi-sdk-ext.kms-local": "0.34.1-fix.78+5114f005",
|
|
59
|
+
"@sphereon/ssi-sdk.credential-vcdm-jsonld-provider": "0.34.1-fix.78+5114f005",
|
|
60
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-fix.78+5114f005",
|
|
60
61
|
"@types/body-parser": "^1.19.5",
|
|
61
62
|
"@types/cookie-parser": "^1.4.7",
|
|
62
63
|
"@types/cors": "^2.8.17",
|
|
@@ -110,5 +111,5 @@
|
|
|
110
111
|
"OpenID Connect",
|
|
111
112
|
"Authenticator"
|
|
112
113
|
],
|
|
113
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "5114f005ed3bbb851b2c7bb226cbb195fc70bf92"
|
|
114
115
|
}
|
|
@@ -4,9 +4,9 @@ import { LOG, VcIssuer } from '@sphereon/oid4vci-issuer'
|
|
|
4
4
|
import { determinePath } from '@sphereon/oid4vci-issuer-server'
|
|
5
5
|
import { IGetIssueStatusEndpointOpts } from '@sphereon/oid4vci-issuer-server'
|
|
6
6
|
import { IRequiredContext } from './types'
|
|
7
|
-
import {
|
|
7
|
+
import { CredentialConfigurationSupportedV1_0_15 } from '@sphereon/oid4vci-common'
|
|
8
8
|
import { IssuerInstance } from '@sphereon/ssi-sdk.oid4vci-issuer'
|
|
9
|
-
import {
|
|
9
|
+
import { IssuerMetadataV1_0_15 } from '@sphereon/oid4vci-common'
|
|
10
10
|
|
|
11
11
|
export function getCredentialConfigurationsEndpoint(
|
|
12
12
|
router: Router,
|
|
@@ -24,7 +24,7 @@ export function getCredentialConfigurationsEndpoint(
|
|
|
24
24
|
|
|
25
25
|
router.get(`${path}`, checkAuth(opts?.endpoint), async (request: Request, response: Response) => {
|
|
26
26
|
try {
|
|
27
|
-
const metadata = instance.issuerMetadata as
|
|
27
|
+
const metadata = instance.issuerMetadata as IssuerMetadataV1_0_15
|
|
28
28
|
response.statusCode = 200
|
|
29
29
|
|
|
30
30
|
return response.json({ credential_configurations_supported: metadata?.credential_configurations_supported ?? [] })
|
|
@@ -58,7 +58,7 @@ export function getCredentialConfigurationByIdEndpoint(
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
LOG.log(`[OID4VCI] getCredentialConfigurations endpoint called with configurationId: ${configurationId}`)
|
|
61
|
-
const metadata = instance.issuerMetadata as
|
|
61
|
+
const metadata = instance.issuerMetadata as IssuerMetadataV1_0_15
|
|
62
62
|
if (!metadata?.credential_configurations_supported || !metadata?.credential_configurations_supported?.[configurationId]) {
|
|
63
63
|
return sendErrorResponse(response, 404, `Credential configuration ${configurationId} not found`)
|
|
64
64
|
}
|
|
@@ -100,11 +100,11 @@ export function deleteCredentialConfigurationByIdEndpoint(
|
|
|
100
100
|
storeId: instance.metadataOptions.storeId,
|
|
101
101
|
namespace: instance.metadataOptions.storeNamespace,
|
|
102
102
|
correlationId: instance.metadataOptions.credentialIssuer,
|
|
103
|
-
})) as
|
|
103
|
+
})) as IssuerMetadataV1_0_15
|
|
104
104
|
if (!storeMetadata?.credential_configurations_supported || !storeMetadata?.credential_configurations_supported?.[configurationId]) {
|
|
105
105
|
return sendErrorResponse(response, 404, `Credential configuration ${configurationId} not found`)
|
|
106
106
|
}
|
|
107
|
-
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as
|
|
107
|
+
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as IssuerMetadataV1_0_15
|
|
108
108
|
delete updateMetadata.credential_configurations_supported[configurationId]
|
|
109
109
|
await context.agent.oid4vciStorePersistMetadata({
|
|
110
110
|
metadata: updateMetadata,
|
|
@@ -146,7 +146,7 @@ export function updateCredentialConfigurationByIdEndpoint(
|
|
|
146
146
|
return sendErrorResponse(response, 400, 'Missing configurationId')
|
|
147
147
|
}
|
|
148
148
|
LOG.log(`[OID4VCI] updateCredentialConfigurationById endpoint called with configurationId: ${configurationId}`)
|
|
149
|
-
const updatedCredentialConfiguration = request.body as
|
|
149
|
+
const updatedCredentialConfiguration = request.body as CredentialConfigurationSupportedV1_0_15
|
|
150
150
|
if (!updatedCredentialConfiguration || !updatedCredentialConfiguration.format) {
|
|
151
151
|
return sendErrorResponse(response, 400, 'Missing credential configuration in the body, or required format missing')
|
|
152
152
|
}
|
|
@@ -156,11 +156,11 @@ export function updateCredentialConfigurationByIdEndpoint(
|
|
|
156
156
|
storeId: instance.metadataOptions.storeId,
|
|
157
157
|
namespace: instance.metadataOptions.storeNamespace,
|
|
158
158
|
correlationId: instance.metadataOptions.credentialIssuer,
|
|
159
|
-
})) as
|
|
159
|
+
})) as IssuerMetadataV1_0_15
|
|
160
160
|
if (!storeMetadata?.credential_configurations_supported || !storeMetadata?.credential_configurations_supported?.[configurationId]) {
|
|
161
161
|
return sendErrorResponse(response, 404, `Credential configuration ${configurationId} not found`)
|
|
162
162
|
}
|
|
163
|
-
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as
|
|
163
|
+
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as IssuerMetadataV1_0_15
|
|
164
164
|
updateMetadata.credential_configurations_supported[configurationId] = updatedCredentialConfiguration
|
|
165
165
|
await context.agent.oid4vciStorePersistMetadata({
|
|
166
166
|
metadata: updateMetadata,
|
|
@@ -202,7 +202,7 @@ export function newCredentialConfigurationEndpoint(
|
|
|
202
202
|
return sendErrorResponse(response, 400, 'Missing configurationId')
|
|
203
203
|
}
|
|
204
204
|
LOG.log(`[OID4VCI] newCredentialConfigurationById endpoint called with configurationId: ${configurationId}`)
|
|
205
|
-
const newCredentialConfiguration = request.body as
|
|
205
|
+
const newCredentialConfiguration = request.body as CredentialConfigurationSupportedV1_0_15
|
|
206
206
|
if (!newCredentialConfiguration || !newCredentialConfiguration.format) {
|
|
207
207
|
return sendErrorResponse(response, 400, 'Missing credential configuration in the body, or required format missing')
|
|
208
208
|
}
|
|
@@ -212,7 +212,7 @@ export function newCredentialConfigurationEndpoint(
|
|
|
212
212
|
storeId: instance.metadataOptions.storeId,
|
|
213
213
|
namespace: instance.metadataOptions.storeNamespace,
|
|
214
214
|
correlationId: instance.metadataOptions.credentialIssuer,
|
|
215
|
-
})) as
|
|
215
|
+
})) as IssuerMetadataV1_0_15
|
|
216
216
|
if (storeMetadata?.credential_configurations_supported?.[configurationId]) {
|
|
217
217
|
return sendErrorResponse(
|
|
218
218
|
response,
|
|
@@ -220,7 +220,7 @@ export function newCredentialConfigurationEndpoint(
|
|
|
220
220
|
`Credential configuration ${configurationId} already exists, cannot create new one. Please update instead.`,
|
|
221
221
|
)
|
|
222
222
|
}
|
|
223
|
-
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as
|
|
223
|
+
const updateMetadata = JSON.parse(JSON.stringify(storeMetadata)) as IssuerMetadataV1_0_15
|
|
224
224
|
updateMetadata.credential_configurations_supported[configurationId] = newCredentialConfiguration
|
|
225
225
|
await context.agent.oid4vciStorePersistMetadata({
|
|
226
226
|
metadata: updateMetadata,
|
package/src/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IOID4VCIIssuer } from '@sphereon/ssi-sdk.oid4vci-issuer'
|
|
|
3
3
|
import { IOID4VCIStore } from '@sphereon/ssi-sdk.oid4vci-issuer-store'
|
|
4
4
|
import { IAgentContext, ICredentialIssuer, ICredentialVerifier, IDIDManager, IKeyManager, IResolver } from '@veramo/core'
|
|
5
5
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
|
|
6
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm'
|
|
6
7
|
|
|
7
8
|
export type IRequiredContext = IAgentContext<IPlugins>
|
|
8
9
|
|
|
@@ -14,4 +15,5 @@ export type IPlugins = IDIDManager &
|
|
|
14
15
|
IOID4VCIIssuer &
|
|
15
16
|
ICredentialVerifier &
|
|
16
17
|
ICredentialIssuer &
|
|
17
|
-
IJwtService
|
|
18
|
+
IJwtService &
|
|
19
|
+
IVcdmCredentialPlugin
|