@verana-labs/vs-agent-plugin-openid4vc 2.0.0-pr799.2 → 2.0.0-pr832.1
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/README.md +48 -14
- package/build/config.d.ts +24 -2
- package/build/config.js +33 -11
- package/build/config.js.map +1 -1
- package/build/events/openId4VcEvents.d.ts +6 -0
- package/build/events/openId4VcEvents.js +17 -0
- package/build/events/openId4VcEvents.js.map +1 -0
- package/build/index.d.ts +9 -1
- package/build/index.js +26 -1
- package/build/index.js.map +1 -1
- package/build/nestjs/OpenId4VcPlugin.js +6 -0
- package/build/nestjs/OpenId4VcPlugin.js.map +1 -1
- package/build/nestjs/V2OpenId4VcCredentialExchangesController.js +2 -1
- package/build/nestjs/V2OpenId4VcCredentialExchangesController.js.map +1 -1
- package/build/nestjs/V2OpenId4VcCredentialRevocationController.d.ts +11 -0
- package/build/nestjs/V2OpenId4VcCredentialRevocationController.js +69 -0
- package/build/nestjs/V2OpenId4VcCredentialRevocationController.js.map +1 -0
- package/build/nestjs/V2OpenId4VcStatusListsController.d.ts +18 -0
- package/build/nestjs/V2OpenId4VcStatusListsController.js +107 -0
- package/build/nestjs/V2OpenId4VcStatusListsController.js.map +1 -0
- package/build/nestjs/dto/credential-exchange.dto.d.ts +3 -0
- package/build/nestjs/dto/credential-exchange.dto.js +32 -8
- package/build/nestjs/dto/credential-exchange.dto.js.map +1 -1
- package/build/nestjs/dto/credential-revocation.dto.d.ts +11 -0
- package/build/nestjs/dto/credential-revocation.dto.js +61 -0
- package/build/nestjs/dto/credential-revocation.dto.js.map +1 -0
- package/build/nestjs/dto/index.d.ts +2 -0
- package/build/nestjs/dto/index.js +2 -0
- package/build/nestjs/dto/index.js.map +1 -1
- package/build/nestjs/dto/presentation.dto.js +1 -1
- package/build/nestjs/dto/presentation.dto.js.map +1 -1
- package/build/nestjs/dto/status-list.dto.d.ts +17 -0
- package/build/nestjs/dto/status-list.dto.js +72 -0
- package/build/nestjs/dto/status-list.dto.js.map +1 -0
- package/build/nestjs/mappers.d.ts +4 -1
- package/build/nestjs/mappers.js +19 -9
- package/build/nestjs/mappers.js.map +1 -1
- package/build/sdk/setupOpenId4Vc.d.ts +3 -1
- package/build/sdk/setupOpenId4Vc.js +26 -0
- package/build/sdk/setupOpenId4Vc.js.map +1 -1
- package/build/services/CertificateService.d.ts +1 -0
- package/build/services/CertificateService.js +39 -9
- package/build/services/CertificateService.js.map +1 -1
- package/build/services/IssuerService.d.ts +11 -1
- package/build/services/IssuerService.js +109 -23
- package/build/services/IssuerService.js.map +1 -1
- package/build/services/StatusListService.d.ts +113 -0
- package/build/services/StatusListService.js +333 -0
- package/build/services/StatusListService.js.map +1 -0
- package/build/services/VerifierService.d.ts +3 -0
- package/build/services/VerifierService.js +52 -11
- package/build/services/VerifierService.js.map +1 -1
- package/build/services/credentialConfigurationBuilder.js +1 -1
- package/build/services/credentialConfigurationBuilder.js.map +1 -1
- package/build/storage/StatusListEntryRecord.d.ts +47 -0
- package/build/storage/StatusListEntryRecord.js +76 -0
- package/build/storage/StatusListEntryRecord.js.map +1 -0
- package/build/storage/StatusListRecord.d.ts +28 -0
- package/build/storage/StatusListRecord.js +54 -0
- package/build/storage/StatusListRecord.js.map +1 -0
- package/build/storage/StatusListStorageModule.d.ts +8 -0
- package/build/storage/StatusListStorageModule.js +17 -0
- package/build/storage/StatusListStorageModule.js.map +1 -0
- package/build/trust/keyBinding.d.ts +7 -0
- package/build/trust/keyBinding.js +9 -1
- package/build/trust/keyBinding.js.map +1 -1
- package/build/types.d.ts +2 -0
- package/build/types.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -6,11 +6,13 @@ operator sets `OID4VC_CONFIG_FILE_LOCATION`. Nothing else enables it.
|
|
|
6
6
|
|
|
7
7
|
What it does:
|
|
8
8
|
|
|
9
|
-
- pre-authorized OpenID4VCI issuance of `dc+sd-jwt` credentials,
|
|
10
|
-
agent hosts
|
|
11
|
-
|
|
9
|
+
- pre-authorized OpenID4VCI issuance of `dc+sd-jwt` credentials, revocable through the Token
|
|
10
|
+
Status Lists the agent hosts: an offer that names a `statusListId` and a `statusListIndex` binds
|
|
11
|
+
the index and stamps the `status` claim, `revokeCredential` flips it, and a credential that no
|
|
12
|
+
list registers is valid until the `ttlSeconds` of its offer run out;
|
|
12
13
|
- OpenID4VP requests in DCQL (`direct_post.jwt`, `x509_hash` or DID client identifier) or, for a
|
|
13
|
-
wallet that predates DCQL, Presentation Exchange (`direct_post`
|
|
14
|
+
wallet that predates DCQL, Presentation Exchange (`direct_post`, `x509_san_dns` or DID client
|
|
15
|
+
identifier, since draft 21 predates `x509_hash`);
|
|
14
16
|
- the `/v2/openid4vc` Administration API scope: create an offer or a request, then list, read
|
|
15
17
|
and delete.
|
|
16
18
|
|
|
@@ -40,10 +42,34 @@ when the indexer cannot answer), and reads the Type Metadata document over `http
|
|
|
40
42
|
following a redirect, to bind every credential to its `vct#integrity`. It answers
|
|
41
43
|
`503 RESOLVER_UNAVAILABLE` when that document cannot be read.
|
|
42
44
|
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
The
|
|
46
|
-
`
|
|
45
|
+
## Revocation
|
|
46
|
+
|
|
47
|
+
The issuer capability hosts [Token Status Lists](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-status-list),
|
|
48
|
+
one bit per status, each served at `{PUBLIC_API_BASE_URL}/oid4vc/status-list/{statusListId}` as
|
|
49
|
+
`application/statuslist+jwt`. `createStatusList` signs an all-valid token with the certificate chain
|
|
50
|
+
of the issuer capability, the same `x5c` that signs the credentials, so a verifier that applies the
|
|
51
|
+
same-chain rule of [[VSA-VTI-FLOW-VERIFY-OID]](https://github.com/verana-labs/verana-spec/blob/main/v4/vs-agent/spec.md#vsa-vti-flow-verify-oid-openid4vp-trust-decision)
|
|
52
|
+
step 6, credo among them, accepts the list of every credential it accepts. Credo builds and signs
|
|
53
|
+
each token through its `tokenStatusList` module; the plugin keeps the lists and the binding of each
|
|
54
|
+
index in the agent storage (`OpenId4VcStatusListRecord`, `OpenId4VcStatusListEntryRecord`), so both
|
|
55
|
+
survive a restart.
|
|
56
|
+
|
|
57
|
+
A credential joins a list through its offer: `statusListId` and `statusListIndex`, both or none. The
|
|
58
|
+
caller allocates the index. The agent binds it before the offer exists, refuses a later offer that
|
|
59
|
+
names it with `409 INVALID_STATE`, stamps `status.status_list` with the `uri` of the list and the
|
|
60
|
+
`idx` on every copy the wallet requests, and reports the coordinates on the credential exchange.
|
|
61
|
+
`revokeCredential` sets the status at the index to INVALID and publishes the re-signed token before
|
|
62
|
+
it answers; a second call changes nothing. The binding outlives the issuance session, so a caller
|
|
63
|
+
can revoke a credential whose session it deleted. `deleteStatusList` is refused while an index is
|
|
64
|
+
bound to a credential that is not revoked and not expired; an offer that no wallet redeemed binds
|
|
65
|
+
its index until the offer expires.
|
|
66
|
+
|
|
67
|
+
Every token carries `sub` (the `uri`), `iat`, `exp`, 24 hours after `iat`, and `ttl`, 300 seconds,
|
|
68
|
+
the longest a verifier may cache it, so a revocation reaches a caching verifier within minutes. The
|
|
69
|
+
agent re-signs a list on the next read of its URL once half of that lifetime has passed, and whenever
|
|
70
|
+
the signing certificate changed since the token was signed. A re-signed list carries the new chain
|
|
71
|
+
and the statuses of the token it replaces, which ends the acceptance of every credential the
|
|
72
|
+
previous certificate signed, as the spec states.
|
|
47
73
|
|
|
48
74
|
## Enable it
|
|
49
75
|
|
|
@@ -95,7 +121,9 @@ the verifier). A peer verifier still has to pin the fingerprint that
|
|
|
95
121
|
**Configured signing** (`signing.configured`): `certificateChain` (a non-self-signed leaf first,
|
|
96
122
|
then the intermediates and the root) and the `privateJwk` P-256 key of the leaf. The leaf must
|
|
97
123
|
carry the agent DID as a URI SAN. The agent never publishes a configured key; the operator
|
|
98
|
-
publishes it under `assertionMethod` or `authentication` before startup.
|
|
124
|
+
publishes it under `assertionMethod` or `authentication` before startup. For the verifier, that
|
|
125
|
+
method has to be under the agent DID and resolve on the DID record the agent stores, because
|
|
126
|
+
`requestSigner: did` signs with it; otherwise the verifier refuses to start. Keep the file out of
|
|
99
127
|
source control, logs and image layers.
|
|
100
128
|
|
|
101
129
|
### Development example
|
|
@@ -113,15 +141,19 @@ answers in the v2 error envelope. Without `OID4VC_CONFIG_FILE_LOCATION`, every p
|
|
|
113
141
|
|
|
114
142
|
| Method | Path | Notes |
|
|
115
143
|
| --- | --- | --- |
|
|
116
|
-
| `createCredentialOffer` | `POST /credential-offer` | `jsonSchemaCredentialId`, `claims`, `ttlSeconds` (60 to 7776000), optional `statusListId` and `statusListIndex` together. Returns `credentialExchangeId` and `url`. `404 UNKNOWN_ID
|
|
117
|
-
| `listCredentialExchanges` | `GET /credential-exchanges` | Filters `jsonSchemaCredentialId`, `state`. Keyset pagination. |
|
|
118
|
-
| `getCredentialExchange` | `GET /credential-exchanges/{credentialExchangeId}` | `credentialExchangeId`, `jsonSchemaCredentialId`, `state`, `createdAt`, `updatedAt`, `expiresAt`, `errorMessage`. Never the claims, the offer URL or the pre-authorized code. |
|
|
144
|
+
| `createCredentialOffer` | `POST /credential-offer` | `jsonSchemaCredentialId`, `claims`, `ttlSeconds` (60 to 7776000, or up to 31536000 for a credential registered on a status list), optional `statusListId` and `statusListIndex` together. Returns `credentialExchangeId` and `url`. `404 UNKNOWN_ID` (type or list), `400 INVALID_INPUT` (claims, `ttlSeconds`, half a pair, index out of range), `409 INVALID_STATE` (index already bound), `409 NOT_AUTHORIZED`, `503 RESOLVER_UNAVAILABLE`. |
|
|
145
|
+
| `listCredentialExchanges` | `GET /credential-exchanges` | Filters `jsonSchemaCredentialId`, `state`, `statusListId`. Keyset pagination. |
|
|
146
|
+
| `getCredentialExchange` | `GET /credential-exchanges/{credentialExchangeId}` | `credentialExchangeId`, `jsonSchemaCredentialId`, `statusListId` and `statusListIndex` when the offer set them, `state`, `createdAt`, `updatedAt`, `expiresAt`, `errorMessage`. Never the claims, the offer URL or the pre-authorized code. |
|
|
119
147
|
| `deleteCredentialExchange` | `DELETE /credential-exchanges/{credentialExchangeId}` | `204`. Deletes the record only, never a credential that a wallet holds. |
|
|
120
148
|
| `createPresentationRequest` | `POST /presentation-request` | `jsonSchemaCredentialId`, optional `requestedClaims` (defaults to every claim of the type), optional `queryLanguage` (`dcql`, `presentation_exchange`), optional `requestSigner` (`x5c`, `did`). Returns `proofExchangeId` and `url`. `404 UNKNOWN_ID`, `400 INVALID_INPUT`, `409 NOT_AUTHORIZED`, `503 RESOLVER_UNAVAILABLE`, `409 INVALID_STATE`. The agent has to hold an active VERIFIER `Participant` for the `CredentialSchema` of the type. |
|
|
121
149
|
| `listPresentations` | `GET /presentations` | Filters `jsonSchemaCredentialId`, `state`. Keyset pagination. |
|
|
122
150
|
| `getPresentation` | `GET /presentations/{proofExchangeId}` | Adds the stored `jsonSchemaCredentialId` and `requestedClaims` of the request, then `cryptographicVerified`, `accepted`, `trust` and `credential` once the wallet answered. |
|
|
123
151
|
| `deletePresentation` | `DELETE /presentations/{proofExchangeId}` | `204`. |
|
|
124
152
|
| `listSigningCertificates` | `GET /signing-certificates` | Bare array of `role`, `development`, `fingerprint`, `certificateChain`. Never a private key. |
|
|
153
|
+
| `listStatusLists` | `GET /status-lists` | Keyset pagination of `statusListId`, `uri`, `size`, `createdAt`, `updatedAt` (the `iat` of the last published token). |
|
|
154
|
+
| `createStatusList` | `POST /status-lists` | Optional `size` (1024 to 16777216, default 131072). Publishes the all-valid token before it answers `201` with the record. `400 INVALID_INPUT`. |
|
|
155
|
+
| `deleteStatusList` | `DELETE /status-lists/{statusListId}` | `204`; the public URL answers `404` afterwards. `404 UNKNOWN_ID`, `409 INVALID_STATE` while an index is bound to a credential that is not revoked and not expired. |
|
|
156
|
+
| `revokeCredential` | `POST /revoke-credential` | `statusListId`, `statusListIndex`. Publishes the re-signed token, then answers `200` with `statusListId`, `statusListIndex`, `revokedAt` (the `iat` of that token). Idempotent. `404 UNKNOWN_ID`, `400 INVALID_INPUT` (index out of range), `409 INVALID_STATE` (no offer bound the index). |
|
|
125
157
|
|
|
126
158
|
Session states are credo's: `OfferCreated`, `OfferUriRetrieved`, `AuthorizationInitiated`,
|
|
127
159
|
`AuthorizationGranted`, `AccessTokenRequested`, `AccessTokenCreated`, `CredentialRequestReceived`,
|
|
@@ -143,6 +175,7 @@ Admin API and the metadata return; it never builds a path itself.
|
|
|
143
175
|
| `/.well-known/openid-credential-issuer`, `/.well-known/oauth-authorization-server`, `/.well-known/jwt-vc-issuer` | Issuer and authorization-server metadata, also at the path-inserted forms. |
|
|
144
176
|
| `/oid4vci/issuer/...` | Token and credential traffic of the issuer capability. |
|
|
145
177
|
| `/oid4vp/verifier/...` | Authorization request and response traffic of the verifier capability. |
|
|
178
|
+
| `/oid4vc/status-list/{statusListId}` | The Status List Token of one list, `application/statuslist+jwt`, `Cache-Control: no-store`; `404` for an unknown list. |
|
|
146
179
|
|
|
147
180
|
## Trust decision
|
|
148
181
|
|
|
@@ -199,6 +232,7 @@ the code it changes, with a one-line note.
|
|
|
199
232
|
|
|
200
233
|
`pnpm --filter @verana-labs/vs-agent-plugin-openid4vc exec vitest run` runs the unit tests and the
|
|
201
234
|
in-process end-to-end tests, which start real credo agents for the issuer, the holder and the
|
|
202
|
-
verifier, drive a pre-authorized issuance through to a stored holder-bound credential,
|
|
203
|
-
it back to the verifier through to a stored trust verdict
|
|
235
|
+
verifier, drive a pre-authorized issuance through to a stored holder-bound credential, present
|
|
236
|
+
it back to the verifier through to a stored trust verdict, and revoke a registered credential on a
|
|
237
|
+
status list the issuer serves until the verifier refuses it. No external wallet or conformance
|
|
204
238
|
evidence is recorded here; see the Verana Playground for recorded wallet scenarios.
|
package/build/config.d.ts
CHANGED
|
@@ -2,8 +2,16 @@ import type { OpenId4VcConfigurationFile, OpenId4VcCredentialConfiguration, Open
|
|
|
2
2
|
import type { SchemaViolation } from '@verana-labs/vs-agent-sdk';
|
|
3
3
|
export declare const ISSUER_CAPABILITY_ID = "issuer";
|
|
4
4
|
export declare const VERIFIER_CAPABILITY_ID = "verifier";
|
|
5
|
+
/** [VSA-PUB-OID-1] The public path segment of a Token Status List, under `PUBLIC_API_BASE_URL`. */
|
|
6
|
+
export declare const STATUS_LIST_PATH = "oid4vc/status-list";
|
|
7
|
+
export declare const STATUS_LIST_JWT_CONTENT_TYPE = "application/statuslist+jwt";
|
|
8
|
+
/** [VSA-PUB-OID-1] The `uri` of a list: the URL at which the agent serves its token. */
|
|
9
|
+
export declare function statusListUri(publicApiBaseUrl: string, statusListId: string): string;
|
|
5
10
|
export declare const OFFER_TTL_SECONDS_MIN = 60;
|
|
11
|
+
/** [VSA-ADM-OID-CE-OFFER] ceiling of a credential that no status list registers: 90 days. */
|
|
6
12
|
export declare const OFFER_TTL_SECONDS_MAX = 7776000;
|
|
13
|
+
/** [VSA-ADM-OID-CE-OFFER] ceiling of a credential registered on a status list: one year. */
|
|
14
|
+
export declare const OFFER_TTL_SECONDS_MAX_REVOCABLE = 31536000;
|
|
7
15
|
export declare function isReservedClaimName(name: string): boolean;
|
|
8
16
|
/** A claim set the credential type refuses, which the Administration API answers as INVALID_INPUT. */
|
|
9
17
|
export declare class OfferClaimsError extends Error {
|
|
@@ -14,8 +22,22 @@ export declare class OfferClaimsError extends Error {
|
|
|
14
22
|
export declare function parseOpenId4VcConfiguration(document: unknown): OpenId4VcConfigurationFile;
|
|
15
23
|
export declare function findCredentialConfiguration(options: Pick<OpenId4VcPluginOptions, 'credentialConfigurations'>, id: string): OpenId4VcCredentialConfiguration | undefined;
|
|
16
24
|
export declare function parseOfferClaims(configuration: OpenId4VcCredentialConfiguration, input: unknown): Record<string, unknown>;
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
/**
|
|
26
|
+
* [VSA-ADM-OID-CE-OFFER]: the lifetime of the credential. A credential that a status list registers
|
|
27
|
+
* can live a year, since a revocation can end it; one that no list registers is bound to 90 days.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseOfferTtlSeconds(input: unknown, { revocable }?: {
|
|
30
|
+
revocable?: boolean;
|
|
31
|
+
}): number;
|
|
32
|
+
/** The Token Status List coordinates an offer stores on its issuance session, [VSA-ADM-OID-CE-OFFER]. */
|
|
33
|
+
export interface OfferStatusReference {
|
|
34
|
+
statusListId: string;
|
|
35
|
+
statusListIndex: number;
|
|
36
|
+
uri: string;
|
|
37
|
+
}
|
|
38
|
+
export type OfferIssuanceMetadata = {
|
|
19
39
|
claims: Record<string, unknown>;
|
|
20
40
|
ttlSeconds: number;
|
|
41
|
+
status?: OfferStatusReference;
|
|
21
42
|
};
|
|
43
|
+
export declare function parseOfferIssuanceMetadata(configuration: OpenId4VcCredentialConfiguration, input: unknown): OfferIssuanceMetadata;
|
package/build/config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OfferClaimsError = exports.OFFER_TTL_SECONDS_MAX = exports.OFFER_TTL_SECONDS_MIN = exports.VERIFIER_CAPABILITY_ID = exports.ISSUER_CAPABILITY_ID = void 0;
|
|
3
|
+
exports.OfferClaimsError = exports.OFFER_TTL_SECONDS_MAX_REVOCABLE = exports.OFFER_TTL_SECONDS_MAX = exports.OFFER_TTL_SECONDS_MIN = exports.STATUS_LIST_JWT_CONTENT_TYPE = exports.STATUS_LIST_PATH = exports.VERIFIER_CAPABILITY_ID = exports.ISSUER_CAPABILITY_ID = void 0;
|
|
4
|
+
exports.statusListUri = statusListUri;
|
|
4
5
|
exports.isReservedClaimName = isReservedClaimName;
|
|
5
6
|
exports.parseOpenId4VcConfiguration = parseOpenId4VcConfiguration;
|
|
6
7
|
exports.findCredentialConfiguration = findCredentialConfiguration;
|
|
@@ -12,8 +13,18 @@ const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
|
12
13
|
const isRecord_1 = require("./utils/isRecord");
|
|
13
14
|
exports.ISSUER_CAPABILITY_ID = 'issuer';
|
|
14
15
|
exports.VERIFIER_CAPABILITY_ID = 'verifier';
|
|
16
|
+
/** [VSA-PUB-OID-1] The public path segment of a Token Status List, under `PUBLIC_API_BASE_URL`. */
|
|
17
|
+
exports.STATUS_LIST_PATH = 'oid4vc/status-list';
|
|
18
|
+
exports.STATUS_LIST_JWT_CONTENT_TYPE = 'application/statuslist+jwt';
|
|
19
|
+
/** [VSA-PUB-OID-1] The `uri` of a list: the URL at which the agent serves its token. */
|
|
20
|
+
function statusListUri(publicApiBaseUrl, statusListId) {
|
|
21
|
+
return `${publicApiBaseUrl}/${exports.STATUS_LIST_PATH}/${encodeURIComponent(statusListId)}`;
|
|
22
|
+
}
|
|
15
23
|
exports.OFFER_TTL_SECONDS_MIN = 60;
|
|
24
|
+
/** [VSA-ADM-OID-CE-OFFER] ceiling of a credential that no status list registers: 90 days. */
|
|
16
25
|
exports.OFFER_TTL_SECONDS_MAX = 7776000;
|
|
26
|
+
/** [VSA-ADM-OID-CE-OFFER] ceiling of a credential registered on a status list: one year. */
|
|
27
|
+
exports.OFFER_TTL_SECONDS_MAX_REVOCABLE = 31536000;
|
|
17
28
|
// The issuer stamps these claims itself, so a credential never carries a value a caller supplied for one.
|
|
18
29
|
const RESERVED_CLAIM_NAMES = [
|
|
19
30
|
'vct',
|
|
@@ -168,12 +179,14 @@ function claimSetSchema(jsonSchema) {
|
|
|
168
179
|
return schema;
|
|
169
180
|
return Object.assign(Object.assign({}, schema), { properties: Object.assign(Object.assign({}, schema.properties), { credentialSubject: Object.assign(Object.assign({}, credentialSubject), { required: credentialSubject.required.filter(name => name !== 'id') }) }) });
|
|
170
181
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
/**
|
|
183
|
+
* [VSA-ADM-OID-CE-OFFER]: the lifetime of the credential. A credential that a status list registers
|
|
184
|
+
* can live a year, since a revocation can end it; one that no list registers is bound to 90 days.
|
|
185
|
+
*/
|
|
186
|
+
function parseOfferTtlSeconds(input, { revocable = false } = {}) {
|
|
187
|
+
const max = revocable ? exports.OFFER_TTL_SECONDS_MAX_REVOCABLE : exports.OFFER_TTL_SECONDS_MAX;
|
|
188
|
+
if (typeof input !== 'number' || !Number.isInteger(input) || input < exports.OFFER_TTL_SECONDS_MIN || input > max) {
|
|
189
|
+
throw new Error(`ttlSeconds must be an integer between ${exports.OFFER_TTL_SECONDS_MIN} and ${max}${revocable ? '' : ' for a credential that no status list registers'}`);
|
|
177
190
|
}
|
|
178
191
|
return input;
|
|
179
192
|
}
|
|
@@ -181,10 +194,19 @@ function parseOfferIssuanceMetadata(configuration, input) {
|
|
|
181
194
|
if (!(0, isRecord_1.isRecord)(input)) {
|
|
182
195
|
throw new Error('issuance metadata must be an object');
|
|
183
196
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
const status = parseOfferStatusReference(input.status);
|
|
198
|
+
return Object.assign({ claims: parseOfferClaims(configuration, input.claims), ttlSeconds: parseOfferTtlSeconds(input.ttlSeconds, { revocable: status !== undefined }) }, (status ? { status } : {}));
|
|
199
|
+
}
|
|
200
|
+
function parseOfferStatusReference(input) {
|
|
201
|
+
if (input === undefined)
|
|
202
|
+
return undefined;
|
|
203
|
+
if (!(0, isRecord_1.isRecord)(input) ||
|
|
204
|
+
typeof input.statusListId !== 'string' ||
|
|
205
|
+
typeof input.statusListIndex !== 'number' ||
|
|
206
|
+
typeof input.uri !== 'string') {
|
|
207
|
+
throw new Error('issuance metadata carries an invalid status list reference');
|
|
208
|
+
}
|
|
209
|
+
return { statusListId: input.statusListId, statusListIndex: input.statusListIndex, uri: input.uri };
|
|
188
210
|
}
|
|
189
211
|
function isEmptyClaim(value) {
|
|
190
212
|
if (value === null || value === undefined)
|
package/build/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts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I,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACtD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAA;IACnD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;AACrE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OpenId4VcAgent } from '../types';
|
|
2
|
+
export declare enum OpenId4VcEventType {
|
|
3
|
+
CredentialExchangeStateUpdated = "openid4vc.credential-exchanges.state-updated",
|
|
4
|
+
PresentationStateUpdated = "openid4vc.presentations.state-updated"
|
|
5
|
+
}
|
|
6
|
+
export declare function emitStateUpdated(agent: OpenId4VcAgent, type: OpenId4VcEventType, record: () => object | Promise<object>, previousState: string | null): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenId4VcEventType = void 0;
|
|
4
|
+
exports.emitStateUpdated = emitStateUpdated;
|
|
5
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
6
|
+
var OpenId4VcEventType;
|
|
7
|
+
(function (OpenId4VcEventType) {
|
|
8
|
+
OpenId4VcEventType["CredentialExchangeStateUpdated"] = "openid4vc.credential-exchanges.state-updated";
|
|
9
|
+
OpenId4VcEventType["PresentationStateUpdated"] = "openid4vc.presentations.state-updated";
|
|
10
|
+
})(OpenId4VcEventType || (exports.OpenId4VcEventType = OpenId4VcEventType = {}));
|
|
11
|
+
function emitStateUpdated(agent, type, record, previousState) {
|
|
12
|
+
// credo calls listeners synchronously inside its state update, so a throw here would fail the flow itself
|
|
13
|
+
new Promise(resolve => resolve(record()))
|
|
14
|
+
.then(data => (0, vs_agent_sdk_1.emitModuleMessageEvent)(agent, type, Object.assign(Object.assign({}, data), { previousState })))
|
|
15
|
+
.catch(error => agent.config.logger.error(`event ${type} emission failed`, { cause: error }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=openId4VcEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openId4VcEvents.js","sourceRoot":"","sources":["../../src/events/openId4VcEvents.ts"],"names":[],"mappings":";;;AASA,4CAUC;AAjBD,4DAAkE;AAElE,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,qGAA+E,CAAA;IAC/E,wFAAkE,CAAA;AACpE,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,SAAgB,gBAAgB,CAC9B,KAAqB,EACrB,IAAwB,EACxB,MAAsC,EACtC,aAA4B;IAE5B,0GAA0G;IAC1G,IAAI,OAAO,CAAS,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;SAC9C,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,qCAAsB,EAAC,KAAK,EAAE,IAAI,kCAAO,IAAI,KAAE,aAAa,IAAG,CAAC;SAC7E,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,IAAI,kBAAkB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AACjG,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
export { OpenId4VcIssuanceSessionState, OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc';
|
|
2
|
-
export { findCredentialConfiguration, OFFER_TTL_SECONDS_MAX, OFFER_TTL_SECONDS_MIN, parseOfferClaims, parseOpenId4VcConfiguration, } from './config';
|
|
2
|
+
export { findCredentialConfiguration, OFFER_TTL_SECONDS_MAX, OFFER_TTL_SECONDS_MAX_REVOCABLE, OFFER_TTL_SECONDS_MIN, parseOfferClaims, parseOpenId4VcConfiguration, STATUS_LIST_JWT_CONTENT_TYPE, STATUS_LIST_PATH, statusListUri, } from './config';
|
|
3
|
+
export { OpenId4VcEventType } from './events/openId4VcEvents';
|
|
3
4
|
export { OpenId4VcPlugin } from './nestjs/OpenId4VcPlugin';
|
|
4
5
|
export * from './nestjs/dto';
|
|
5
6
|
export { V2OpenId4VcCredentialExchangesController } from './nestjs/V2OpenId4VcCredentialExchangesController';
|
|
7
|
+
export { V2OpenId4VcCredentialRevocationController } from './nestjs/V2OpenId4VcCredentialRevocationController';
|
|
6
8
|
export { V2OpenId4VcPresentationsController } from './nestjs/V2OpenId4VcPresentationsController';
|
|
7
9
|
export { V2OpenId4VcSigningCertificatesController } from './nestjs/V2OpenId4VcSigningCertificatesController';
|
|
10
|
+
export { V2OpenId4VcStatusListsController } from './nestjs/V2OpenId4VcStatusListsController';
|
|
8
11
|
export { setupOpenId4Vc } from './sdk/setupOpenId4Vc';
|
|
9
12
|
export type { OpenId4VcIssuerRequestMapper, OpenId4VcSdkPlugin } from './sdk/setupOpenId4Vc';
|
|
10
13
|
export type { SigningCertificateInfo, SigningRole } from './services/CertificateService';
|
|
11
14
|
export { IssuerService } from './services/IssuerService';
|
|
12
15
|
export type { OpenId4VcIssuanceSessionSummary, OpenId4VcOfferResult } from './services/IssuerService';
|
|
16
|
+
export { STATUS_LIST_SIZE_DEFAULT, STATUS_LIST_SIZE_MAX, STATUS_LIST_SIZE_MIN, STATUS_LIST_TOKEN_LIFETIME_SECONDS, STATUS_LIST_TOKEN_TTL_SECONDS, StatusListService, } from './services/StatusListService';
|
|
17
|
+
export type { OpenId4VcRevocationResult, OpenId4VcStatusListBinding, OpenId4VcStatusListCoordinates, OpenId4VcStatusListSummary, } from './services/StatusListService';
|
|
13
18
|
export { OPENID4VC_REQUEST_SIGNERS, VerifierService } from './services/VerifierService';
|
|
14
19
|
export type { OpenId4VcCreatePresentationRequestOptions, OpenId4VcRequestSigner, OpenId4VcVerificationRequest, OpenId4VcVerificationSessionSummary, } from './services/VerifierService';
|
|
15
20
|
export { OPENID4VC_QUERY_LANGUAGES } from './services/presentationRequest';
|
|
16
21
|
export type { OpenId4VcQueryLanguage } from './services/presentationRequest';
|
|
17
22
|
export type { OpenId4VcVerifiedCredentialResult, PresentationDecision, } from './services/presentationVerification';
|
|
23
|
+
export { OpenId4VcStatusListEntryRecord, OpenId4VcStatusListEntryRepository, } from './storage/StatusListEntryRecord';
|
|
24
|
+
export { OpenId4VcStatusListRecord, OpenId4VcStatusListRepository } from './storage/StatusListRecord';
|
|
25
|
+
export { OpenId4VcStatusListStorageModule } from './storage/StatusListStorageModule';
|
|
18
26
|
export { TRUST_VERDICT_NAMES, VERANA_TRUST_STATUSES } from './trust/types';
|
|
19
27
|
export type { TrustEvidence, TrustVerdict, TrustVerdictName, VeranaTrustStatus } from './trust/types';
|
|
20
28
|
export { OPENID4VC_DID_TRUST_RESOLVER, OPENID4VC_OPTIONS } from './types';
|
package/build/index.js
CHANGED
|
@@ -14,34 +14,59 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.OPENID4VC_OPTIONS = exports.OPENID4VC_DID_TRUST_RESOLVER = exports.VERANA_TRUST_STATUSES = exports.TRUST_VERDICT_NAMES = exports.OPENID4VC_QUERY_LANGUAGES = exports.VerifierService = exports.OPENID4VC_REQUEST_SIGNERS = exports.IssuerService = exports.setupOpenId4Vc = exports.V2OpenId4VcSigningCertificatesController = exports.V2OpenId4VcPresentationsController = exports.V2OpenId4VcCredentialExchangesController = exports.OpenId4VcPlugin = exports.parseOpenId4VcConfiguration = exports.parseOfferClaims = exports.OFFER_TTL_SECONDS_MIN = exports.OFFER_TTL_SECONDS_MAX = exports.findCredentialConfiguration = exports.OpenId4VcVerificationSessionState = exports.OpenId4VcIssuanceSessionState = void 0;
|
|
17
|
+
exports.OPENID4VC_OPTIONS = exports.OPENID4VC_DID_TRUST_RESOLVER = exports.VERANA_TRUST_STATUSES = exports.TRUST_VERDICT_NAMES = exports.OpenId4VcStatusListStorageModule = exports.OpenId4VcStatusListRepository = exports.OpenId4VcStatusListRecord = exports.OpenId4VcStatusListEntryRepository = exports.OpenId4VcStatusListEntryRecord = exports.OPENID4VC_QUERY_LANGUAGES = exports.VerifierService = exports.OPENID4VC_REQUEST_SIGNERS = exports.StatusListService = exports.STATUS_LIST_TOKEN_TTL_SECONDS = exports.STATUS_LIST_TOKEN_LIFETIME_SECONDS = exports.STATUS_LIST_SIZE_MIN = exports.STATUS_LIST_SIZE_MAX = exports.STATUS_LIST_SIZE_DEFAULT = exports.IssuerService = exports.setupOpenId4Vc = exports.V2OpenId4VcStatusListsController = exports.V2OpenId4VcSigningCertificatesController = exports.V2OpenId4VcPresentationsController = exports.V2OpenId4VcCredentialRevocationController = exports.V2OpenId4VcCredentialExchangesController = exports.OpenId4VcPlugin = exports.OpenId4VcEventType = exports.statusListUri = exports.STATUS_LIST_PATH = exports.STATUS_LIST_JWT_CONTENT_TYPE = exports.parseOpenId4VcConfiguration = exports.parseOfferClaims = exports.OFFER_TTL_SECONDS_MIN = exports.OFFER_TTL_SECONDS_MAX_REVOCABLE = exports.OFFER_TTL_SECONDS_MAX = exports.findCredentialConfiguration = exports.OpenId4VcVerificationSessionState = exports.OpenId4VcIssuanceSessionState = void 0;
|
|
18
18
|
var openid4vc_1 = require("@credo-ts/openid4vc");
|
|
19
19
|
Object.defineProperty(exports, "OpenId4VcIssuanceSessionState", { enumerable: true, get: function () { return openid4vc_1.OpenId4VcIssuanceSessionState; } });
|
|
20
20
|
Object.defineProperty(exports, "OpenId4VcVerificationSessionState", { enumerable: true, get: function () { return openid4vc_1.OpenId4VcVerificationSessionState; } });
|
|
21
21
|
var config_1 = require("./config");
|
|
22
22
|
Object.defineProperty(exports, "findCredentialConfiguration", { enumerable: true, get: function () { return config_1.findCredentialConfiguration; } });
|
|
23
23
|
Object.defineProperty(exports, "OFFER_TTL_SECONDS_MAX", { enumerable: true, get: function () { return config_1.OFFER_TTL_SECONDS_MAX; } });
|
|
24
|
+
Object.defineProperty(exports, "OFFER_TTL_SECONDS_MAX_REVOCABLE", { enumerable: true, get: function () { return config_1.OFFER_TTL_SECONDS_MAX_REVOCABLE; } });
|
|
24
25
|
Object.defineProperty(exports, "OFFER_TTL_SECONDS_MIN", { enumerable: true, get: function () { return config_1.OFFER_TTL_SECONDS_MIN; } });
|
|
25
26
|
Object.defineProperty(exports, "parseOfferClaims", { enumerable: true, get: function () { return config_1.parseOfferClaims; } });
|
|
26
27
|
Object.defineProperty(exports, "parseOpenId4VcConfiguration", { enumerable: true, get: function () { return config_1.parseOpenId4VcConfiguration; } });
|
|
28
|
+
Object.defineProperty(exports, "STATUS_LIST_JWT_CONTENT_TYPE", { enumerable: true, get: function () { return config_1.STATUS_LIST_JWT_CONTENT_TYPE; } });
|
|
29
|
+
Object.defineProperty(exports, "STATUS_LIST_PATH", { enumerable: true, get: function () { return config_1.STATUS_LIST_PATH; } });
|
|
30
|
+
Object.defineProperty(exports, "statusListUri", { enumerable: true, get: function () { return config_1.statusListUri; } });
|
|
31
|
+
var openId4VcEvents_1 = require("./events/openId4VcEvents");
|
|
32
|
+
Object.defineProperty(exports, "OpenId4VcEventType", { enumerable: true, get: function () { return openId4VcEvents_1.OpenId4VcEventType; } });
|
|
27
33
|
var OpenId4VcPlugin_1 = require("./nestjs/OpenId4VcPlugin");
|
|
28
34
|
Object.defineProperty(exports, "OpenId4VcPlugin", { enumerable: true, get: function () { return OpenId4VcPlugin_1.OpenId4VcPlugin; } });
|
|
29
35
|
__exportStar(require("./nestjs/dto"), exports);
|
|
30
36
|
var V2OpenId4VcCredentialExchangesController_1 = require("./nestjs/V2OpenId4VcCredentialExchangesController");
|
|
31
37
|
Object.defineProperty(exports, "V2OpenId4VcCredentialExchangesController", { enumerable: true, get: function () { return V2OpenId4VcCredentialExchangesController_1.V2OpenId4VcCredentialExchangesController; } });
|
|
38
|
+
var V2OpenId4VcCredentialRevocationController_1 = require("./nestjs/V2OpenId4VcCredentialRevocationController");
|
|
39
|
+
Object.defineProperty(exports, "V2OpenId4VcCredentialRevocationController", { enumerable: true, get: function () { return V2OpenId4VcCredentialRevocationController_1.V2OpenId4VcCredentialRevocationController; } });
|
|
32
40
|
var V2OpenId4VcPresentationsController_1 = require("./nestjs/V2OpenId4VcPresentationsController");
|
|
33
41
|
Object.defineProperty(exports, "V2OpenId4VcPresentationsController", { enumerable: true, get: function () { return V2OpenId4VcPresentationsController_1.V2OpenId4VcPresentationsController; } });
|
|
34
42
|
var V2OpenId4VcSigningCertificatesController_1 = require("./nestjs/V2OpenId4VcSigningCertificatesController");
|
|
35
43
|
Object.defineProperty(exports, "V2OpenId4VcSigningCertificatesController", { enumerable: true, get: function () { return V2OpenId4VcSigningCertificatesController_1.V2OpenId4VcSigningCertificatesController; } });
|
|
44
|
+
var V2OpenId4VcStatusListsController_1 = require("./nestjs/V2OpenId4VcStatusListsController");
|
|
45
|
+
Object.defineProperty(exports, "V2OpenId4VcStatusListsController", { enumerable: true, get: function () { return V2OpenId4VcStatusListsController_1.V2OpenId4VcStatusListsController; } });
|
|
36
46
|
var setupOpenId4Vc_1 = require("./sdk/setupOpenId4Vc");
|
|
37
47
|
Object.defineProperty(exports, "setupOpenId4Vc", { enumerable: true, get: function () { return setupOpenId4Vc_1.setupOpenId4Vc; } });
|
|
38
48
|
var IssuerService_1 = require("./services/IssuerService");
|
|
39
49
|
Object.defineProperty(exports, "IssuerService", { enumerable: true, get: function () { return IssuerService_1.IssuerService; } });
|
|
50
|
+
var StatusListService_1 = require("./services/StatusListService");
|
|
51
|
+
Object.defineProperty(exports, "STATUS_LIST_SIZE_DEFAULT", { enumerable: true, get: function () { return StatusListService_1.STATUS_LIST_SIZE_DEFAULT; } });
|
|
52
|
+
Object.defineProperty(exports, "STATUS_LIST_SIZE_MAX", { enumerable: true, get: function () { return StatusListService_1.STATUS_LIST_SIZE_MAX; } });
|
|
53
|
+
Object.defineProperty(exports, "STATUS_LIST_SIZE_MIN", { enumerable: true, get: function () { return StatusListService_1.STATUS_LIST_SIZE_MIN; } });
|
|
54
|
+
Object.defineProperty(exports, "STATUS_LIST_TOKEN_LIFETIME_SECONDS", { enumerable: true, get: function () { return StatusListService_1.STATUS_LIST_TOKEN_LIFETIME_SECONDS; } });
|
|
55
|
+
Object.defineProperty(exports, "STATUS_LIST_TOKEN_TTL_SECONDS", { enumerable: true, get: function () { return StatusListService_1.STATUS_LIST_TOKEN_TTL_SECONDS; } });
|
|
56
|
+
Object.defineProperty(exports, "StatusListService", { enumerable: true, get: function () { return StatusListService_1.StatusListService; } });
|
|
40
57
|
var VerifierService_1 = require("./services/VerifierService");
|
|
41
58
|
Object.defineProperty(exports, "OPENID4VC_REQUEST_SIGNERS", { enumerable: true, get: function () { return VerifierService_1.OPENID4VC_REQUEST_SIGNERS; } });
|
|
42
59
|
Object.defineProperty(exports, "VerifierService", { enumerable: true, get: function () { return VerifierService_1.VerifierService; } });
|
|
43
60
|
var presentationRequest_1 = require("./services/presentationRequest");
|
|
44
61
|
Object.defineProperty(exports, "OPENID4VC_QUERY_LANGUAGES", { enumerable: true, get: function () { return presentationRequest_1.OPENID4VC_QUERY_LANGUAGES; } });
|
|
62
|
+
var StatusListEntryRecord_1 = require("./storage/StatusListEntryRecord");
|
|
63
|
+
Object.defineProperty(exports, "OpenId4VcStatusListEntryRecord", { enumerable: true, get: function () { return StatusListEntryRecord_1.OpenId4VcStatusListEntryRecord; } });
|
|
64
|
+
Object.defineProperty(exports, "OpenId4VcStatusListEntryRepository", { enumerable: true, get: function () { return StatusListEntryRecord_1.OpenId4VcStatusListEntryRepository; } });
|
|
65
|
+
var StatusListRecord_1 = require("./storage/StatusListRecord");
|
|
66
|
+
Object.defineProperty(exports, "OpenId4VcStatusListRecord", { enumerable: true, get: function () { return StatusListRecord_1.OpenId4VcStatusListRecord; } });
|
|
67
|
+
Object.defineProperty(exports, "OpenId4VcStatusListRepository", { enumerable: true, get: function () { return StatusListRecord_1.OpenId4VcStatusListRepository; } });
|
|
68
|
+
var StatusListStorageModule_1 = require("./storage/StatusListStorageModule");
|
|
69
|
+
Object.defineProperty(exports, "OpenId4VcStatusListStorageModule", { enumerable: true, get: function () { return StatusListStorageModule_1.OpenId4VcStatusListStorageModule; } });
|
|
45
70
|
var types_1 = require("./trust/types");
|
|
46
71
|
Object.defineProperty(exports, "TRUST_VERDICT_NAMES", { enumerable: true, get: function () { return types_1.TRUST_VERDICT_NAMES; } });
|
|
47
72
|
Object.defineProperty(exports, "VERANA_TRUST_STATUSES", { enumerable: true, get: function () { return types_1.VERANA_TRUST_STATUSES; } });
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAAsG;AAA7F,0HAAA,6BAA6B,OAAA;AAAE,8HAAA,iCAAiC,OAAA;AAEzE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAAsG;AAA7F,0HAAA,6BAA6B,OAAA;AAAE,8HAAA,iCAAiC,OAAA;AAEzE,mCAUiB;AATf,qHAAA,2BAA2B,OAAA;AAC3B,+GAAA,qBAAqB,OAAA;AACrB,yHAAA,+BAA+B,OAAA;AAC/B,+GAAA,qBAAqB,OAAA;AACrB,0GAAA,gBAAgB,OAAA;AAChB,qHAAA,2BAA2B,OAAA;AAC3B,sHAAA,4BAA4B,OAAA;AAC5B,0GAAA,gBAAgB,OAAA;AAChB,uGAAA,aAAa,OAAA;AAEf,4DAA6D;AAApD,qHAAA,kBAAkB,OAAA;AAC3B,4DAA0D;AAAjD,kHAAA,eAAe,OAAA;AACxB,+CAA4B;AAC5B,8GAA4G;AAAnG,oKAAA,wCAAwC,OAAA;AACjD,gHAA8G;AAArG,sKAAA,yCAAyC,OAAA;AAClD,kGAAgG;AAAvF,wJAAA,kCAAkC,OAAA;AAC3C,8GAA4G;AAAnG,oKAAA,wCAAwC,OAAA;AACjD,8FAA4F;AAAnF,oJAAA,gCAAgC,OAAA;AACzC,uDAAqD;AAA5C,gHAAA,cAAc,OAAA;AAGvB,0DAAwD;AAA/C,8GAAA,aAAa,OAAA;AAEtB,kEAOqC;AANnC,6HAAA,wBAAwB,OAAA;AACxB,yHAAA,oBAAoB,OAAA;AACpB,yHAAA,oBAAoB,OAAA;AACpB,uIAAA,kCAAkC,OAAA;AAClC,kIAAA,6BAA6B,OAAA;AAC7B,sHAAA,iBAAiB,OAAA;AAQnB,8DAAuF;AAA9E,4HAAA,yBAAyB,OAAA;AAAE,kHAAA,eAAe,OAAA;AAOnD,sEAA0E;AAAjE,gIAAA,yBAAyB,OAAA;AAMlC,yEAGwC;AAFtC,uIAAA,8BAA8B,OAAA;AAC9B,2IAAA,kCAAkC,OAAA;AAEpC,+DAAqG;AAA5F,6HAAA,yBAAyB,OAAA;AAAE,iIAAA,6BAA6B,OAAA;AACjE,6EAAoF;AAA3E,2IAAA,gCAAgC,OAAA;AACzC,uCAA0E;AAAjE,4GAAA,mBAAmB,OAAA;AAAE,8GAAA,qBAAqB,OAAA;AAEnD,iCAAyE;AAAhE,qHAAA,4BAA4B,OAAA;AAAE,0GAAA,iBAAiB,OAAA"}
|
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpenId4VcPlugin = OpenId4VcPlugin;
|
|
4
4
|
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
5
5
|
const IssuerService_1 = require("../services/IssuerService");
|
|
6
|
+
const StatusListService_1 = require("../services/StatusListService");
|
|
6
7
|
const VerifierService_1 = require("../services/VerifierService");
|
|
7
8
|
const types_1 = require("../types");
|
|
8
9
|
const credentialConfigurationHandlers_1 = require("../sdk/credentialConfigurationHandlers");
|
|
9
10
|
const setupOpenId4Vc_1 = require("../sdk/setupOpenId4Vc");
|
|
10
11
|
const V2OpenId4VcCredentialExchangesController_1 = require("./V2OpenId4VcCredentialExchangesController");
|
|
12
|
+
const V2OpenId4VcCredentialRevocationController_1 = require("./V2OpenId4VcCredentialRevocationController");
|
|
11
13
|
const V2OpenId4VcPresentationsController_1 = require("./V2OpenId4VcPresentationsController");
|
|
12
14
|
const V2OpenId4VcSigningCertificatesController_1 = require("./V2OpenId4VcSigningCertificatesController");
|
|
15
|
+
const V2OpenId4VcStatusListsController_1 = require("./V2OpenId4VcStatusListsController");
|
|
13
16
|
function OpenId4VcPlugin(options) {
|
|
14
17
|
let issuerService;
|
|
15
18
|
const sdkPlugin = (0, setupOpenId4Vc_1.setupOpenId4Vc)(options, () => {
|
|
@@ -34,11 +37,14 @@ function OpenId4VcPlugin(options) {
|
|
|
34
37
|
V2OpenId4VcCredentialExchangesController_1.V2OpenId4VcCredentialExchangesController,
|
|
35
38
|
V2OpenId4VcPresentationsController_1.V2OpenId4VcPresentationsController,
|
|
36
39
|
V2OpenId4VcSigningCertificatesController_1.V2OpenId4VcSigningCertificatesController,
|
|
40
|
+
V2OpenId4VcStatusListsController_1.V2OpenId4VcStatusListsController,
|
|
41
|
+
V2OpenId4VcCredentialRevocationController_1.V2OpenId4VcCredentialRevocationController,
|
|
37
42
|
],
|
|
38
43
|
providers: [
|
|
39
44
|
{ provide: types_1.OPENID4VC_OPTIONS, useValue: options },
|
|
40
45
|
{ provide: types_1.OPENID4VC_ISSUER_SINK, useValue: publishIssuerService },
|
|
41
46
|
{ provide: types_1.OPENID4VC_DID_TRUST_RESOLVER, useValue: resolveDidTrust },
|
|
47
|
+
StatusListService_1.StatusListService,
|
|
42
48
|
IssuerService_1.IssuerService,
|
|
43
49
|
VerifierService_1.VerifierService,
|
|
44
50
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenId4VcPlugin.js","sourceRoot":"","sources":["../../src/nestjs/OpenId4VcPlugin.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"OpenId4VcPlugin.js","sourceRoot":"","sources":["../../src/nestjs/OpenId4VcPlugin.ts"],"names":[],"mappings":";;AAmBA,0CAqCC;AArDD,4DAAkE;AAElE,6DAAyD;AACzD,qEAAiE;AACjE,iEAA6D;AAC7D,oCAAiG;AAEjG,4FAAgG;AAChG,0DAAsD;AAEtD,yGAAqG;AACrG,2GAAuG;AACvG,6FAAyF;AACzF,yGAAqG;AACrG,yFAAqF;AAErF,SAAgB,eAAe,CAAC,OAA+B;IAC7D,IAAI,aAAiD,CAAA;IACrD,MAAM,SAAS,GAAG,IAAA,+BAAc,EAAC,OAAO,EAAE,GAAG,EAAE;QAC7C,IAAI,CAAC,aAAa;YAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAClF,OAAO,aAAa,CAAA;IACtB,CAAC,CAAC,CAAA;IACF,MAAM,oBAAoB,GAAwB,OAAO,CAAC,EAAE;QAC1D,aAAa,GAAG,OAAO,CAAA;IACzB,CAAC,CAAA;IACD,MAAM,eAAe,GAAqB,OAAO,CAAC,0BAA0B;QAC1E,CAAC,CAAC,IAAA,qCAAsB,EAAC,EAAE,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,EAAE,CAAC;QAC5F,CAAC,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,WAAW,CAAC,CAAA;QACrE,CAAC,CAAA;IAEL,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,SAAS;QACtB,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;QAC5C,uBAAuB,EAAE,QAAQ,CAAC,EAAE,CAClC,IAAA,yEAAuC,EAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC;QACjF,WAAW,EAAE;YACX,mFAAwC;YACxC,uEAAkC;YAClC,mFAAwC;YACxC,mEAAgC;YAChC,qFAAyC;SAC1C;QACD,SAAS,EAAE;YACT,EAAE,OAAO,EAAE,yBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE;YACjD,EAAE,OAAO,EAAE,6BAAqB,EAAE,QAAQ,EAAE,oBAAoB,EAAE;YAClE,EAAE,OAAO,EAAE,oCAA4B,EAAE,QAAQ,EAAE,eAAe,EAAE;YACpE,qCAAiB;YACjB,6BAAa;YACb,iCAAe;SAChB;KACF,CAAA;AACH,CAAC"}
|
|
@@ -45,6 +45,7 @@ let V2OpenId4VcCredentialExchangesController = class V2OpenId4VcCredentialExchan
|
|
|
45
45
|
const filters = {
|
|
46
46
|
jsonSchemaCredentialId: query.jsonSchemaCredentialId,
|
|
47
47
|
state: query.state,
|
|
48
|
+
statusListId: query.statusListId,
|
|
48
49
|
};
|
|
49
50
|
const sessions = await this.issuerService.listIssuanceSessions(filters);
|
|
50
51
|
const page = (0, vs_agent_sdk_1.paginate)(sessions, query, { method: 'openid4vc.listCredentialExchanges', filters }, vs_agent_sdk_1.createdAtKey);
|
|
@@ -98,7 +99,7 @@ __decorate([
|
|
|
98
99
|
(0, common_1.Get)('credential-exchanges'),
|
|
99
100
|
(0, swagger_1.ApiOperation)({
|
|
100
101
|
summary: 'List credential exchanges',
|
|
101
|
-
description: 'Returns the OpenID4VCI issuance sessions that the agent tracks.',
|
|
102
|
+
description: 'Returns the OpenID4VCI issuance sessions that the agent tracks, filtered by credential type, state or the status list that the offer named.',
|
|
102
103
|
}),
|
|
103
104
|
(0, swagger_1.ApiOkResponse)({
|
|
104
105
|
description: 'A page of credential exchange records',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2OpenId4VcCredentialExchangesController.js","sourceRoot":"","sources":["../../src/nestjs/V2OpenId4VcCredentialExchangesController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAauB;AACvB,6CASwB;AACxB,4DAAiF;AAEjF,6DAAyD;AAEzD,+BAMc;AACd,uCAAmD;AAEnD;;;;;;;GAOG;AAII,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IACnD,YAA2D,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAiC9E,AAAN,KAAK,CAAC,qBAAqB,CACxB,IAA2C;QAEnD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YACjD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;YACnD,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAA;QACF,OAAO,EAAE,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,EAAE,GAAG,EAAE,KAAK,CAAC,eAAe,EAAE,CAAA;IACtF,CAAC;
|
|
1
|
+
{"version":3,"file":"V2OpenId4VcCredentialExchangesController.js","sourceRoot":"","sources":["../../src/nestjs/V2OpenId4VcCredentialExchangesController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAauB;AACvB,6CASwB;AACxB,4DAAiF;AAEjF,6DAAyD;AAEzD,+BAMc;AACd,uCAAmD;AAEnD;;;;;;;GAOG;AAII,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IACnD,YAA2D,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAiC9E,AAAN,KAAK,CAAC,qBAAqB,CACxB,IAA2C;QAEnD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YACjD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;YACnD,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAA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|
+
import { OpenId4VcRevokeCredentialBodyDto, OpenId4VcRevokeCredentialResponseDto } from './dto';
|
|
3
|
+
/**
|
|
4
|
+
* This controller revokes the OpenID4VC credentials of this agent at list level.
|
|
5
|
+
* Refer to [VSA-ADM-OID-CR].
|
|
6
|
+
*/
|
|
7
|
+
export declare class V2OpenId4VcCredentialRevocationController {
|
|
8
|
+
private readonly statusListService;
|
|
9
|
+
constructor(statusListService: StatusListService);
|
|
10
|
+
revokeCredential(body: OpenId4VcRevokeCredentialBodyDto): Promise<OpenId4VcRevokeCredentialResponseDto>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2OpenId4VcCredentialRevocationController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const StatusListService_1 = require("../services/StatusListService");
|
|
19
|
+
const dto_1 = require("./dto");
|
|
20
|
+
const mappers_1 = require("./mappers");
|
|
21
|
+
/**
|
|
22
|
+
* This controller revokes the OpenID4VC credentials of this agent at list level.
|
|
23
|
+
* Refer to [VSA-ADM-OID-CR].
|
|
24
|
+
*/
|
|
25
|
+
let V2OpenId4VcCredentialRevocationController = class V2OpenId4VcCredentialRevocationController {
|
|
26
|
+
constructor(statusListService) {
|
|
27
|
+
this.statusListService = statusListService;
|
|
28
|
+
}
|
|
29
|
+
async revokeCredential(body) {
|
|
30
|
+
return (0, mappers_1.toRevocationDto)(await this.statusListService.revokeCredential({
|
|
31
|
+
statusListId: body.statusListId,
|
|
32
|
+
statusListIndex: body.statusListIndex,
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.V2OpenId4VcCredentialRevocationController = V2OpenId4VcCredentialRevocationController;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, common_1.Post)('revoke-credential'),
|
|
39
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
40
|
+
(0, swagger_1.ApiOperation)({
|
|
41
|
+
summary: 'Revoke an OpenID4VC credential',
|
|
42
|
+
description: 'Sets the status of the credential at statusListIndex to INVALID and publishes the re-signed Status List Token before it answers. A second call on a revoked index succeeds and changes nothing. A caller revokes a credential whose issuance session it has deleted.',
|
|
43
|
+
}),
|
|
44
|
+
(0, swagger_1.ApiBody)({
|
|
45
|
+
type: dto_1.OpenId4VcRevokeCredentialBodyDto,
|
|
46
|
+
examples: {
|
|
47
|
+
default: {
|
|
48
|
+
summary: 'Revoke by list and index',
|
|
49
|
+
value: { statusListId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', statusListIndex: 42 },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
(0, swagger_1.ApiOkResponse)({ description: 'The revocation record', type: dto_1.OpenId4VcRevokeCredentialResponseDto }),
|
|
54
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'statusListIndex is out of range for the list' }),
|
|
55
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No status list with the given id' }),
|
|
56
|
+
(0, swagger_1.ApiConflictResponse)({ description: 'No offer bound statusListIndex on that list' }),
|
|
57
|
+
__param(0, (0, common_1.Body)()),
|
|
58
|
+
__metadata("design:type", Function),
|
|
59
|
+
__metadata("design:paramtypes", [dto_1.OpenId4VcRevokeCredentialBodyDto]),
|
|
60
|
+
__metadata("design:returntype", Promise)
|
|
61
|
+
], V2OpenId4VcCredentialRevocationController.prototype, "revokeCredential", null);
|
|
62
|
+
exports.V2OpenId4VcCredentialRevocationController = V2OpenId4VcCredentialRevocationController = __decorate([
|
|
63
|
+
(0, swagger_1.ApiTags)('v2/openid4vc'),
|
|
64
|
+
(0, common_1.Controller)({ path: 'openid4vc', version: '2' }),
|
|
65
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
66
|
+
__param(0, (0, common_1.Inject)(StatusListService_1.StatusListService)),
|
|
67
|
+
__metadata("design:paramtypes", [StatusListService_1.StatusListService])
|
|
68
|
+
], V2OpenId4VcCredentialRevocationController);
|
|
69
|
+
//# sourceMappingURL=V2OpenId4VcCredentialRevocationController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2OpenId4VcCredentialRevocationController.js","sourceRoot":"","sources":["../../src/nestjs/V2OpenId4VcCredentialRevocationController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASuB;AACvB,6CAQwB;AAExB,qEAAiE;AAEjE,+BAA8F;AAC9F,uCAA2C;AAE3C;;;GAGG;AAII,IAAM,yCAAyC,GAA/C,MAAM,yCAAyC;IACpD,YAA+D,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAsB1F,AAAN,KAAK,CAAC,gBAAgB,CACnB,IAAsC;QAE9C,OAAO,IAAA,yBAAe,EACpB,MAAM,IAAI,CAAC,iBAAiB,CAAC,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CAAqC,qCAAiB;GADxF,yCAAyC,CAiCrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Page } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import { StatusListService } from '../services/StatusListService';
|
|
3
|
+
import { OpenId4VcCreateStatusListBodyDto, OpenId4VcListStatusListsQueryDto, OpenId4VcStatusListRecordDto } from './dto';
|
|
4
|
+
/**
|
|
5
|
+
* This controller has the Token Status Lists of the issuer capability of this agent.
|
|
6
|
+
* Refer to [VSA-ADM-OID-SL].
|
|
7
|
+
*
|
|
8
|
+
* One list serves every credential type the agent issues. A credential joins a list through the
|
|
9
|
+
* `statusListId` and `statusListIndex` of its offer, and the agent serves each list at its public
|
|
10
|
+
* URL, [VSA-PUB-OID-1], signed with the certificate that signs its credentials.
|
|
11
|
+
*/
|
|
12
|
+
export declare class V2OpenId4VcStatusListsController {
|
|
13
|
+
private readonly statusListService;
|
|
14
|
+
constructor(statusListService: StatusListService);
|
|
15
|
+
listStatusLists(query: OpenId4VcListStatusListsQueryDto): Promise<Page<OpenId4VcStatusListRecordDto>>;
|
|
16
|
+
createStatusList(body: OpenId4VcCreateStatusListBodyDto): Promise<OpenId4VcStatusListRecordDto>;
|
|
17
|
+
deleteStatusList(statusListId: string): Promise<void>;
|
|
18
|
+
}
|