@verana-labs/vs-agent-plugin-openid4vc 1.12.0-oidc4vc.7 → 2.0.0-dev.100
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 +175 -164
- package/build/config.d.ts +19 -3
- package/build/config.js +161 -242
- 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 +20 -12
- package/build/index.js +39 -16
- package/build/index.js.map +1 -1
- package/build/nestjs/OpenId4VcPlugin.js +27 -43
- package/build/nestjs/OpenId4VcPlugin.js.map +1 -1
- package/build/nestjs/V2OpenId4VcCredentialExchangesController.d.ts +19 -0
- package/build/nestjs/V2OpenId4VcCredentialExchangesController.js +161 -0
- package/build/nestjs/V2OpenId4VcCredentialExchangesController.js.map +1 -0
- package/build/nestjs/V2OpenId4VcPresentationsController.d.ts +19 -0
- package/build/nestjs/V2OpenId4VcPresentationsController.js +147 -0
- package/build/nestjs/V2OpenId4VcPresentationsController.js.map +1 -0
- package/build/nestjs/V2OpenId4VcSigningCertificatesController.d.ts +17 -0
- package/build/nestjs/V2OpenId4VcSigningCertificatesController.js +58 -0
- package/build/nestjs/V2OpenId4VcSigningCertificatesController.js.map +1 -0
- package/build/nestjs/dto/credential-exchange.dto.d.ts +31 -0
- package/build/nestjs/dto/credential-exchange.dto.js +150 -0
- package/build/nestjs/dto/credential-exchange.dto.js.map +1 -0
- package/build/nestjs/dto/index.d.ts +3 -0
- package/build/nestjs/dto/index.js +20 -0
- package/build/nestjs/dto/index.js.map +1 -0
- package/build/nestjs/dto/presentation.dto.d.ts +57 -0
- package/build/nestjs/dto/presentation.dto.js +246 -0
- package/build/nestjs/dto/presentation.dto.js.map +1 -0
- package/build/nestjs/dto/signing-certificate.dto.d.ts +8 -0
- package/build/nestjs/dto/signing-certificate.dto.js +40 -0
- package/build/nestjs/dto/signing-certificate.dto.js.map +1 -0
- package/build/nestjs/mappers.d.ts +5 -0
- package/build/nestjs/mappers.js +31 -0
- package/build/nestjs/mappers.js.map +1 -0
- package/build/sdk/credentialConfigurationHandlers.d.ts +4 -0
- package/build/sdk/credentialConfigurationHandlers.js +57 -0
- package/build/sdk/credentialConfigurationHandlers.js.map +1 -0
- package/build/sdk/setupOpenId4Vc.d.ts +8 -12
- package/build/sdk/setupOpenId4Vc.js +88 -80
- package/build/sdk/setupOpenId4Vc.js.map +1 -1
- package/build/services/CertificateService.d.ts +5 -22
- package/build/services/CertificateService.js +90 -84
- package/build/services/CertificateService.js.map +1 -1
- package/build/services/IssuerService.d.ts +57 -44
- package/build/services/IssuerService.js +284 -103
- package/build/services/IssuerService.js.map +1 -1
- package/build/services/VerifierService.d.ts +44 -44
- package/build/services/VerifierService.js +227 -223
- package/build/services/VerifierService.js.map +1 -1
- package/build/services/credentialConfigurationBuilder.d.ts +10 -0
- package/build/services/credentialConfigurationBuilder.js +88 -0
- package/build/services/credentialConfigurationBuilder.js.map +1 -0
- package/build/services/presentationRequest.d.ts +51 -0
- package/build/services/presentationRequest.js +72 -0
- package/build/services/presentationRequest.js.map +1 -0
- package/build/services/presentationVerification.d.ts +12 -0
- package/build/services/presentationVerification.js +13 -0
- package/build/services/presentationVerification.js.map +1 -0
- package/build/services/typeMetadataIntegrity.d.ts +6 -0
- package/build/services/typeMetadataIntegrity.js +32 -0
- package/build/services/typeMetadataIntegrity.js.map +1 -0
- package/build/trust/CertificateTrust.d.ts +1 -4
- package/build/trust/CertificateTrust.js +10 -15
- package/build/trust/CertificateTrust.js.map +1 -1
- package/build/trust/keyBinding.d.ts +15 -16
- package/build/trust/keyBinding.js +54 -174
- package/build/trust/keyBinding.js.map +1 -1
- package/build/trust/presentedIssuer.d.ts +9 -0
- package/build/trust/presentedIssuer.js +23 -0
- package/build/trust/presentedIssuer.js.map +1 -0
- package/build/trust/trustDecision.d.ts +31 -0
- package/build/trust/trustDecision.js +204 -0
- package/build/trust/trustDecision.js.map +1 -0
- package/build/trust/types.d.ts +7 -16
- package/build/trust/types.js +8 -0
- package/build/trust/types.js.map +1 -1
- package/build/types.d.ts +29 -51
- package/build/types.js +4 -0
- package/build/types.js.map +1 -1
- package/build/utils/isRecord.d.ts +1 -0
- package/build/utils/isRecord.js +7 -0
- package/build/utils/isRecord.js.map +1 -0
- package/build/utils/serviceDisplay.d.ts +8 -0
- package/build/utils/serviceDisplay.js +11 -0
- package/build/utils/serviceDisplay.js.map +1 -0
- package/package.json +10 -8
- package/build/nestjs/CertificatesController.d.ts +0 -11
- package/build/nestjs/CertificatesController.js +0 -58
- package/build/nestjs/CertificatesController.js.map +0 -1
- package/build/nestjs/IssuerController.d.ts +0 -8
- package/build/nestjs/IssuerController.js +0 -66
- package/build/nestjs/IssuerController.js.map +0 -1
- package/build/nestjs/VerifierController.d.ts +0 -8
- package/build/nestjs/VerifierController.js +0 -66
- package/build/nestjs/VerifierController.js.map +0 -1
- package/build/nestjs/dto.d.ts +0 -7
- package/build/nestjs/dto.js +0 -34
- package/build/nestjs/dto.js.map +0 -1
- package/build/services/StatusListService.d.ts +0 -42
- package/build/services/StatusListService.js +0 -132
- package/build/services/StatusListService.js.map +0 -1
- package/build/trust/TrustClient.d.ts +0 -12
- package/build/trust/TrustClient.js +0 -120
- package/build/trust/TrustClient.js.map +0 -1
- package/build/trust/verdict.d.ts +0 -2
- package/build/trust/verdict.js +0 -13
- package/build/trust/verdict.js.map +0 -1
package/build/config.js
CHANGED
|
@@ -1,271 +1,190 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OfferClaimsError = exports.OFFER_TTL_SECONDS_MAX = exports.OFFER_TTL_SECONDS_MIN = exports.VERIFIER_CAPABILITY_ID = exports.ISSUER_CAPABILITY_ID = void 0;
|
|
4
|
+
exports.isReservedClaimName = isReservedClaimName;
|
|
5
|
+
exports.parseOpenId4VcConfiguration = parseOpenId4VcConfiguration;
|
|
4
6
|
exports.findCredentialConfiguration = findCredentialConfiguration;
|
|
5
|
-
exports.findVerifierPolicy = findVerifierPolicy;
|
|
6
7
|
exports.parseOfferClaims = parseOfferClaims;
|
|
8
|
+
exports.parseOfferTtlSeconds = parseOfferTtlSeconds;
|
|
9
|
+
exports.parseOfferIssuanceMetadata = parseOfferIssuanceMetadata;
|
|
7
10
|
const core_1 = require("@credo-ts/core");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
12
|
+
const isRecord_1 = require("./utils/isRecord");
|
|
13
|
+
exports.ISSUER_CAPABILITY_ID = 'issuer';
|
|
14
|
+
exports.VERIFIER_CAPABILITY_ID = 'verifier';
|
|
15
|
+
exports.OFFER_TTL_SECONDS_MIN = 60;
|
|
16
|
+
exports.OFFER_TTL_SECONDS_MAX = 7776000;
|
|
17
|
+
// The issuer stamps these claims itself, so a credential never carries a value a caller supplied for one.
|
|
18
|
+
const RESERVED_CLAIM_NAMES = [
|
|
19
|
+
'vct',
|
|
20
|
+
'vct#integrity',
|
|
21
|
+
'iat',
|
|
22
|
+
'exp',
|
|
23
|
+
'nbf',
|
|
24
|
+
'iss',
|
|
25
|
+
'cnf',
|
|
26
|
+
'status',
|
|
27
|
+
];
|
|
28
|
+
function isReservedClaimName(name) {
|
|
29
|
+
return RESERVED_CLAIM_NAMES.includes(name);
|
|
30
|
+
}
|
|
31
|
+
/** A claim set the credential type refuses, which the Administration API answers as INVALID_INPUT. */
|
|
32
|
+
class OfferClaimsError extends Error {
|
|
33
|
+
constructor(message, violations) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.violations = violations;
|
|
36
|
+
this.name = 'OfferClaimsError';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.OfferClaimsError = OfferClaimsError;
|
|
40
|
+
/** [VSA-VTI-CFG-ENV-OID] Validation of the OpenID4VC configuration file. */
|
|
41
|
+
function parseOpenId4VcConfiguration(document) {
|
|
42
|
+
const configuration = assertJsonObject(document, '');
|
|
43
|
+
for (const field of Object.keys(configuration)) {
|
|
44
|
+
if (field === 'issuer')
|
|
45
|
+
parseIssuer(configuration.issuer, field);
|
|
46
|
+
else if (field === 'verifier')
|
|
47
|
+
parseVerifier(configuration.verifier, field);
|
|
48
|
+
else
|
|
49
|
+
throw unknownField(field);
|
|
50
|
+
}
|
|
51
|
+
return document;
|
|
52
|
+
}
|
|
53
|
+
function parseIssuer(value, path) {
|
|
54
|
+
const issuer = assertJsonObject(value, path);
|
|
55
|
+
for (const field of Object.keys(issuer)) {
|
|
56
|
+
const fieldPath = `${path}.${field}`;
|
|
57
|
+
if (field === 'signing')
|
|
58
|
+
parseSigning(issuer.signing, fieldPath);
|
|
59
|
+
else if (field === 'walletAttestationCertificates' || field === 'keyAttestationCertificates') {
|
|
60
|
+
assertX509Certificates(issuer[field], fieldPath);
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
throw unknownField(fieldPath);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function parseVerifier(value, path) {
|
|
67
|
+
const verifier = assertJsonObject(value, path);
|
|
68
|
+
for (const field of Object.keys(verifier)) {
|
|
69
|
+
const fieldPath = `${path}.${field}`;
|
|
70
|
+
if (field !== 'signing')
|
|
71
|
+
throw unknownField(fieldPath);
|
|
72
|
+
parseSigning(verifier.signing, fieldPath);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function parseSigning(value, path) {
|
|
76
|
+
const signing = assertJsonObject(value, path);
|
|
77
|
+
const configuredPath = `${path}.configured`;
|
|
78
|
+
if (!('configured' in signing))
|
|
79
|
+
throw new Error(`${configuredPath} is required`);
|
|
80
|
+
for (const field of Object.keys(signing)) {
|
|
81
|
+
if (field !== 'configured')
|
|
82
|
+
throw unknownField(`${path}.${field}`);
|
|
83
|
+
}
|
|
84
|
+
const configured = assertJsonObject(signing.configured, configuredPath);
|
|
85
|
+
for (const field of ['certificateChain', 'privateJwk']) {
|
|
86
|
+
if (!(field in configured))
|
|
87
|
+
throw new Error(`${configuredPath}.${field} is required`);
|
|
88
|
+
}
|
|
89
|
+
for (const field of Object.keys(configured)) {
|
|
90
|
+
if (field !== 'certificateChain' && field !== 'privateJwk') {
|
|
91
|
+
throw unknownField(`${configuredPath}.${field}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
assertNonEmptyStringArray(configured.certificateChain, `${configuredPath}.certificateChain`);
|
|
95
|
+
assertJsonObject(configured.privateJwk, `${configuredPath}.privateJwk`);
|
|
96
|
+
}
|
|
97
|
+
function unknownField(path) {
|
|
98
|
+
return new Error(`the OpenID4VC configuration contains an unknown field '${path}'`);
|
|
99
|
+
}
|
|
100
|
+
function assertJsonObject(value, path) {
|
|
101
|
+
if (!(0, isRecord_1.isRecord)(value)) {
|
|
102
|
+
throw new Error(`${path || 'the OpenID4VC configuration'} must be a JSON object`);
|
|
103
|
+
}
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
function assertNonEmptyStringArray(value, path) {
|
|
107
|
+
if (!Array.isArray(value) ||
|
|
108
|
+
value.length === 0 ||
|
|
109
|
+
value.some(item => typeof item !== 'string' || !item.trim())) {
|
|
110
|
+
throw new Error(`${path} must contain non-empty strings`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function assertX509Certificates(value, path) {
|
|
114
|
+
if (!Array.isArray(value)) {
|
|
115
|
+
throw new Error(`${path} must be an array of X.509 certificates`);
|
|
116
|
+
}
|
|
117
|
+
value.forEach((certificate, index) => {
|
|
118
|
+
try {
|
|
119
|
+
if (typeof certificate !== 'string')
|
|
120
|
+
throw new Error('not a string');
|
|
121
|
+
core_1.X509Certificate.fromEncodedCertificate(certificate);
|
|
26
122
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
assertSigningOptions(options.verifier.signing, 'verifier.signing');
|
|
32
|
-
assertTrustOptions(options.trust, true);
|
|
33
|
-
}
|
|
34
|
-
else if (options.trust) {
|
|
35
|
-
assertTrustOptions(options.trust, false);
|
|
36
|
-
}
|
|
37
|
-
assertCredentialConfigurations(options.credentialConfigurations);
|
|
38
|
-
assertVerifierPolicies(options.verifierPolicies, options.credentialConfigurations);
|
|
123
|
+
catch (_a) {
|
|
124
|
+
throw new Error(`${path}[${index}] must be a valid X.509 certificate`);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
39
127
|
}
|
|
40
128
|
function findCredentialConfiguration(options, id) {
|
|
41
129
|
return options.credentialConfigurations.find(configuration => configuration.id === id);
|
|
42
130
|
}
|
|
43
|
-
function findVerifierPolicy(options, id) {
|
|
44
|
-
return options.verifierPolicies.find(policy => policy.id === id);
|
|
45
|
-
}
|
|
46
131
|
function parseOfferClaims(configuration, input) {
|
|
47
|
-
if (!isRecord(input)) {
|
|
48
|
-
throw new
|
|
132
|
+
if (!(0, isRecord_1.isRecord)(input)) {
|
|
133
|
+
throw new OfferClaimsError('claims must be an object');
|
|
49
134
|
}
|
|
50
135
|
for (const name of Object.keys(input)) {
|
|
136
|
+
if (isReservedClaimName(name)) {
|
|
137
|
+
throw new OfferClaimsError(`claim '${name}' is reserved by SD-JWT VC`);
|
|
138
|
+
}
|
|
51
139
|
if (!configuration.claims.includes(name)) {
|
|
52
|
-
throw new
|
|
140
|
+
throw new OfferClaimsError(`unknown claim '${name}'`);
|
|
53
141
|
}
|
|
54
142
|
}
|
|
55
143
|
const claims = {};
|
|
56
144
|
for (const name of configuration.claims) {
|
|
145
|
+
if (!(name in input))
|
|
146
|
+
continue;
|
|
57
147
|
const value = input[name];
|
|
58
148
|
if (isEmptyClaim(value)) {
|
|
59
|
-
throw new
|
|
149
|
+
throw new OfferClaimsError(`claim '${name}' must be non-empty`);
|
|
60
150
|
}
|
|
61
151
|
claims[name] = value;
|
|
62
152
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
function assertCredentialConfigurations(configurations) {
|
|
66
|
-
if (!Array.isArray(configurations)) {
|
|
67
|
-
throw new Error('credentialConfigurations must be an array');
|
|
68
|
-
}
|
|
69
|
-
assertUniqueNonEmptyIds(configurations, 'credential configuration');
|
|
70
|
-
for (const configuration of configurations) {
|
|
71
|
-
const prefix = `credential configuration '${configuration.id}'`;
|
|
72
|
-
if (configuration.format !== 'dc+sd-jwt') {
|
|
73
|
-
throw new Error(`${prefix}: format must be 'dc+sd-jwt'`);
|
|
74
|
-
}
|
|
75
|
-
assertHttpUrl(configuration.vct, `${prefix}.vct`);
|
|
76
|
-
assertHttpUrl(configuration.vtjscId, `${prefix}.vtjscId`);
|
|
77
|
-
assertNonEmptyString(configuration.name, `${prefix}.name`);
|
|
78
|
-
assertNonEmptyUniqueStrings(configuration.claims, `${prefix}.claims`);
|
|
79
|
-
const reservedClaim = configuration.claims.find(claim => RESERVED_CREDENTIAL_CLAIMS.has(claim));
|
|
80
|
-
if (reservedClaim) {
|
|
81
|
-
throw new Error(`${prefix}.claims contains reserved claim '${reservedClaim}'`);
|
|
82
|
-
}
|
|
83
|
-
assertSubset(configuration.disclosureFrame, configuration.claims, `${prefix}.disclosureFrame`);
|
|
84
|
-
if (!Number.isInteger(configuration.ttlSeconds) ||
|
|
85
|
-
configuration.ttlSeconds < MIN_TTL_SECONDS ||
|
|
86
|
-
configuration.ttlSeconds > MAX_TTL_SECONDS) {
|
|
87
|
-
throw new Error(`${prefix}.ttlSeconds must be an integer between ${MIN_TTL_SECONDS} and ${MAX_TTL_SECONDS}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function assertVerifierPolicies(policies, configurations) {
|
|
92
|
-
if (!Array.isArray(policies)) {
|
|
93
|
-
throw new Error('verifierPolicies must be an array');
|
|
94
|
-
}
|
|
95
|
-
assertUniqueNonEmptyIds(policies, 'verifier policy');
|
|
96
|
-
for (const policy of policies) {
|
|
97
|
-
const configuration = configurations.find(item => item.id === policy.credentialConfigurationId);
|
|
98
|
-
if (!configuration) {
|
|
99
|
-
throw new Error(`verifier policy '${policy.id}': unknown credentialConfigurationId '${policy.credentialConfigurationId}'`);
|
|
100
|
-
}
|
|
101
|
-
assertSubset(policy.requestedClaims, configuration.claims, `verifier policy '${policy.id}'.requestedClaims`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function assertTrustOptions(trust, requiresAnchor) {
|
|
105
|
-
if (!trust) {
|
|
106
|
-
if (requiresAnchor)
|
|
107
|
-
throw new Error('verifier requires trust configuration');
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
assertHttpsUrl(trust.resolverUrl, 'trust.resolverUrl');
|
|
111
|
-
if (!Number.isInteger(trust.timeoutMs) ||
|
|
112
|
-
trust.timeoutMs <= 0 ||
|
|
113
|
-
trust.timeoutMs > keyBinding_1.MAX_DID_RESOLUTION_TIMEOUT_MS) {
|
|
114
|
-
throw new Error(`trust.timeoutMs must be a positive integer no greater than ${keyBinding_1.MAX_DID_RESOLUTION_TIMEOUT_MS}`);
|
|
115
|
-
}
|
|
116
|
-
assertNonEmptyUniqueStrings(trust.allowedDidWebHosts, 'trust.allowedDidWebHosts');
|
|
117
|
-
trust.allowedDidWebHosts.forEach((host, index) => assertDidWebHost(host, `trust.allowedDidWebHosts[${index}]`));
|
|
118
|
-
assertStringArray(trust.credentialIssuerCertificates, 'trust.credentialIssuerCertificates');
|
|
119
|
-
assertCredentialIssuerTrustAnchors(trust.credentialIssuerCertificates);
|
|
120
|
-
if (trust.developmentCertificateFingerprints) {
|
|
121
|
-
assertStringArray(trust.developmentCertificateFingerprints, 'trust.developmentCertificateFingerprints');
|
|
122
|
-
if (new Set(trust.developmentCertificateFingerprints).size !==
|
|
123
|
-
trust.developmentCertificateFingerprints.length) {
|
|
124
|
-
throw new Error('trust.developmentCertificateFingerprints must not contain duplicates');
|
|
125
|
-
}
|
|
126
|
-
if (trust.developmentCertificateFingerprints.some(fingerprint => !/^SHA256:[0-9a-f]{64}$/.test(fingerprint))) {
|
|
127
|
-
throw new Error('trust.developmentCertificateFingerprints must use SHA256 followed by 64 lowercase hexadecimal characters');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (requiresAnchor &&
|
|
131
|
-
!hasNonEmptyString(trust.credentialIssuerCertificates) &&
|
|
132
|
-
!hasNonEmptyString(trust.developmentCertificateFingerprints)) {
|
|
133
|
-
throw new Error('verifier trust requires credentialIssuerCertificates or developmentCertificateFingerprints');
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function assertSigningOptions(signing, field) {
|
|
137
|
-
const rawSigning = signing;
|
|
138
|
-
const hasConfigured = rawSigning.configured !== undefined;
|
|
139
|
-
const hasDevelopment = rawSigning.development !== undefined;
|
|
140
|
-
if (hasConfigured === hasDevelopment) {
|
|
141
|
-
throw new Error(`${field} must configure exactly one signing mode`);
|
|
142
|
-
}
|
|
143
|
-
if (hasConfigured) {
|
|
144
|
-
const configured = rawSigning.configured;
|
|
145
|
-
assertNonEmptyStringArray(configured.certificateChain, `${field}.configured.certificateChain`);
|
|
146
|
-
if (!configured.privateJwk || typeof configured.privateJwk !== 'object') {
|
|
147
|
-
throw new Error(`${field}.configured.privateJwk is required`);
|
|
148
|
-
}
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const development = rawSigning.development;
|
|
152
|
-
if (development.enabled !== true) {
|
|
153
|
-
throw new Error(`${field}.development.enabled must be true`);
|
|
154
|
-
}
|
|
155
|
-
assertNonEmptyString(development.commonName, `${field}.development.commonName`);
|
|
156
|
-
}
|
|
157
|
-
function assertHttpsUrl(value, field) {
|
|
158
|
-
const url = parseUrl(value, field);
|
|
159
|
-
if (process.env.NODE_ENV !== 'test' && url.protocol !== 'https:') {
|
|
160
|
-
throw new Error(`${field} must use HTTPS outside test mode`);
|
|
161
|
-
}
|
|
162
|
-
if (process.env.NODE_ENV === 'test' && url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
163
|
-
throw new Error(`${field} must use HTTP(S)`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function assertHttpUrl(value, field) {
|
|
167
|
-
const url = parseUrl(value, field);
|
|
168
|
-
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
169
|
-
throw new Error(`${field} must use HTTP(S)`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function parseUrl(value, field) {
|
|
173
|
-
let url;
|
|
174
|
-
try {
|
|
175
|
-
url = new URL(value);
|
|
153
|
+
if (Object.keys(claims).length === 0) {
|
|
154
|
+
throw new OfferClaimsError('claims must include at least one configured claim');
|
|
176
155
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (url.username || url.password) {
|
|
181
|
-
throw new Error(`${field} must not include credentials`);
|
|
182
|
-
}
|
|
183
|
-
return url;
|
|
184
|
-
}
|
|
185
|
-
function assertCredentialIssuerTrustAnchors(encodedCertificates) {
|
|
186
|
-
const fingerprints = new Set();
|
|
187
|
-
encodedCertificates.forEach((encodedCertificate, index) => {
|
|
188
|
-
var _a;
|
|
189
|
-
let certificate;
|
|
190
|
-
try {
|
|
191
|
-
certificate = core_1.X509Certificate.fromEncodedCertificate(encodedCertificate);
|
|
192
|
-
}
|
|
193
|
-
catch (_b) {
|
|
194
|
-
throw new Error(`trust.credentialIssuerCertificates[${index}] must be a valid X.509 certificate`);
|
|
195
|
-
}
|
|
196
|
-
(0, CertificateService_1.assertCertificateChainUsable)([certificate]);
|
|
197
|
-
if (!certificate.isCertificateAuthority || !((_a = certificate.keyUsage) === null || _a === void 0 ? void 0 : _a.includes(core_1.X509KeyUsage.KeyCertSign))) {
|
|
198
|
-
throw new Error(`trust.credentialIssuerCertificates[${index}] must be a CA trust anchor with keyCertSign usage`);
|
|
199
|
-
}
|
|
200
|
-
if (certificate.subject !== certificate.issuer) {
|
|
201
|
-
throw new Error(`trust.credentialIssuerCertificates[${index}] must be a self-issued root trust anchor`);
|
|
202
|
-
}
|
|
203
|
-
const fingerprint = (0, CertificateTrust_1.certificateFingerprint)(certificate);
|
|
204
|
-
if (fingerprints.has(fingerprint)) {
|
|
205
|
-
throw new Error('trust.credentialIssuerCertificates contains a duplicate credential issuer certificate');
|
|
206
|
-
}
|
|
207
|
-
fingerprints.add(fingerprint);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function assertDidWebHost(value, field) {
|
|
211
|
-
try {
|
|
212
|
-
const url = new URL(`https://${value}`);
|
|
213
|
-
if (url.username ||
|
|
214
|
-
url.password ||
|
|
215
|
-
!url.hostname ||
|
|
216
|
-
url.pathname !== '/' ||
|
|
217
|
-
url.search ||
|
|
218
|
-
url.hash ||
|
|
219
|
-
url.host.toLowerCase() !== value) {
|
|
220
|
-
throw new Error();
|
|
221
|
-
}
|
|
156
|
+
const violations = (0, vs_agent_sdk_1.schemaViolations)(claimSetSchema(configuration.jsonSchema), claims);
|
|
157
|
+
if (violations.length > 0) {
|
|
158
|
+
throw new OfferClaimsError('the claim set does not satisfy the json_schema', violations);
|
|
222
159
|
}
|
|
223
|
-
|
|
224
|
-
throw new Error(`${field} must be an exact lowercase host with an optional port`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function assertUniqueNonEmptyIds(items, label) {
|
|
228
|
-
const ids = new Set();
|
|
229
|
-
for (const item of items) {
|
|
230
|
-
assertNonEmptyString(item.id, `${label} ID`);
|
|
231
|
-
if (ids.has(item.id)) {
|
|
232
|
-
throw new Error(`duplicate ${label} ID '${item.id}'`);
|
|
233
|
-
}
|
|
234
|
-
ids.add(item.id);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
function assertNonEmptyUniqueStrings(values, field) {
|
|
238
|
-
assertNonEmptyStringArray(values, field);
|
|
239
|
-
if (new Set(values).size !== values.length) {
|
|
240
|
-
throw new Error(`${field} must not contain duplicates`);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function assertNonEmptyStringArray(value, field) {
|
|
244
|
-
assertStringArray(value, field);
|
|
245
|
-
if (value.length === 0) {
|
|
246
|
-
throw new Error(`${field} must contain non-empty strings`);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function assertStringArray(value, field) {
|
|
250
|
-
if (!Array.isArray(value) || value.some(item => typeof item !== 'string' || !item.trim())) {
|
|
251
|
-
throw new Error(`${field} must contain non-empty strings`);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function assertSubset(values, allowedValues, field) {
|
|
255
|
-
if (!Array.isArray(values) || values.some(value => !allowedValues.includes(value))) {
|
|
256
|
-
throw new Error(`${field} must be a subset of configured claims`);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
function assertNonEmptyString(value, field) {
|
|
260
|
-
if (typeof value !== 'string' || !value.trim()) {
|
|
261
|
-
throw new Error(`${field} must be a non-empty string`);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function hasNonEmptyString(value) {
|
|
265
|
-
return Array.isArray(value) && value.some(item => typeof item === 'string' && item.trim());
|
|
160
|
+
return claims;
|
|
266
161
|
}
|
|
267
|
-
|
|
268
|
-
|
|
162
|
+
// An SD-JWT VTC carries no `credentialSubject.id`, so `id` is never a required property of a claim set.
|
|
163
|
+
function claimSetSchema(jsonSchema) {
|
|
164
|
+
var _a;
|
|
165
|
+
const schema = JSON.parse(jsonSchema);
|
|
166
|
+
const credentialSubject = (_a = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _a === void 0 ? void 0 : _a.credentialSubject;
|
|
167
|
+
if (!(0, isRecord_1.isRecord)(credentialSubject) || !Array.isArray(credentialSubject.required))
|
|
168
|
+
return schema;
|
|
169
|
+
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
|
+
}
|
|
171
|
+
function parseOfferTtlSeconds(input) {
|
|
172
|
+
if (typeof input !== 'number' ||
|
|
173
|
+
!Number.isInteger(input) ||
|
|
174
|
+
input < exports.OFFER_TTL_SECONDS_MIN ||
|
|
175
|
+
input > exports.OFFER_TTL_SECONDS_MAX) {
|
|
176
|
+
throw new Error(`ttlSeconds must be an integer between ${exports.OFFER_TTL_SECONDS_MIN} and ${exports.OFFER_TTL_SECONDS_MAX}`);
|
|
177
|
+
}
|
|
178
|
+
return input;
|
|
179
|
+
}
|
|
180
|
+
function parseOfferIssuanceMetadata(configuration, input) {
|
|
181
|
+
if (!(0, isRecord_1.isRecord)(input)) {
|
|
182
|
+
throw new Error('issuance metadata must be an object');
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
claims: parseOfferClaims(configuration, input.claims),
|
|
186
|
+
ttlSeconds: parseOfferTtlSeconds(input.ttlSeconds),
|
|
187
|
+
};
|
|
269
188
|
}
|
|
270
189
|
function isEmptyClaim(value) {
|
|
271
190
|
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":";;AAiBA,4DA+BC;AAED,kEAKC;AAED,gDAKC;AAED,4CAwBC;AAjFD,yCAA8D;AAE9D,sEAA4E;AAC5E,+DAAiE;AACjE,mDAAkE;AAElE,MAAM,eAAe,GAAG,QAAU,CAAA;AAClC,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AAE/E,SAAgB,wBAAwB,CAAC,OAA+B;IACtE,cAAc,CAAC,OAAO,CAAC,gBAAgB,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AED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI,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,14 +1,22 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { OpenId4VcIssuanceSessionState, OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc';
|
|
2
|
+
export { findCredentialConfiguration, OFFER_TTL_SECONDS_MAX, OFFER_TTL_SECONDS_MIN, parseOfferClaims, parseOpenId4VcConfiguration, } from './config';
|
|
3
|
+
export { OpenId4VcEventType } from './events/openId4VcEvents';
|
|
2
4
|
export { OpenId4VcPlugin } from './nestjs/OpenId4VcPlugin';
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
5
|
+
export * from './nestjs/dto';
|
|
6
|
+
export { V2OpenId4VcCredentialExchangesController } from './nestjs/V2OpenId4VcCredentialExchangesController';
|
|
7
|
+
export { V2OpenId4VcPresentationsController } from './nestjs/V2OpenId4VcPresentationsController';
|
|
8
|
+
export { V2OpenId4VcSigningCertificatesController } from './nestjs/V2OpenId4VcSigningCertificatesController';
|
|
6
9
|
export { setupOpenId4Vc } from './sdk/setupOpenId4Vc';
|
|
7
|
-
export {
|
|
8
|
-
export type {
|
|
9
|
-
export { IssuerService
|
|
10
|
-
export type {
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
13
|
-
export
|
|
14
|
-
export type {
|
|
10
|
+
export type { OpenId4VcIssuerRequestMapper, OpenId4VcSdkPlugin } from './sdk/setupOpenId4Vc';
|
|
11
|
+
export type { SigningCertificateInfo, SigningRole } from './services/CertificateService';
|
|
12
|
+
export { IssuerService } from './services/IssuerService';
|
|
13
|
+
export type { OpenId4VcIssuanceSessionSummary, OpenId4VcOfferResult } from './services/IssuerService';
|
|
14
|
+
export { OPENID4VC_REQUEST_SIGNERS, VerifierService } from './services/VerifierService';
|
|
15
|
+
export type { OpenId4VcCreatePresentationRequestOptions, OpenId4VcRequestSigner, OpenId4VcVerificationRequest, OpenId4VcVerificationSessionSummary, } from './services/VerifierService';
|
|
16
|
+
export { OPENID4VC_QUERY_LANGUAGES } from './services/presentationRequest';
|
|
17
|
+
export type { OpenId4VcQueryLanguage } from './services/presentationRequest';
|
|
18
|
+
export type { OpenId4VcVerifiedCredentialResult, PresentationDecision, } from './services/presentationVerification';
|
|
19
|
+
export { TRUST_VERDICT_NAMES, VERANA_TRUST_STATUSES } from './trust/types';
|
|
20
|
+
export type { TrustEvidence, TrustVerdict, TrustVerdictName, VeranaTrustStatus } from './trust/types';
|
|
21
|
+
export { OPENID4VC_DID_TRUST_RESOLVER, OPENID4VC_OPTIONS } from './types';
|
|
22
|
+
export type { OpenId4VcAgent, OpenId4VcConfigurationFile, OpenId4VcConfiguredSigningMaterial, OpenId4VcCredentialConfiguration, OpenId4VcPluginOptions, OpenId4VcSigningOptions, OpenId4VcVsAgentModules, } from './types';
|
package/build/index.js
CHANGED
|
@@ -1,30 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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.OpenId4VcEventType = exports.parseOpenId4VcConfiguration = exports.parseOfferClaims = exports.OFFER_TTL_SECONDS_MIN = exports.OFFER_TTL_SECONDS_MAX = exports.findCredentialConfiguration = exports.OpenId4VcVerificationSessionState = exports.OpenId4VcIssuanceSessionState = void 0;
|
|
18
|
+
var openid4vc_1 = require("@credo-ts/openid4vc");
|
|
19
|
+
Object.defineProperty(exports, "OpenId4VcIssuanceSessionState", { enumerable: true, get: function () { return openid4vc_1.OpenId4VcIssuanceSessionState; } });
|
|
20
|
+
Object.defineProperty(exports, "OpenId4VcVerificationSessionState", { enumerable: true, get: function () { return openid4vc_1.OpenId4VcVerificationSessionState; } });
|
|
4
21
|
var config_1 = require("./config");
|
|
5
22
|
Object.defineProperty(exports, "findCredentialConfiguration", { enumerable: true, get: function () { return config_1.findCredentialConfiguration; } });
|
|
6
|
-
Object.defineProperty(exports, "
|
|
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_MIN", { enumerable: true, get: function () { return config_1.OFFER_TTL_SECONDS_MIN; } });
|
|
7
25
|
Object.defineProperty(exports, "parseOfferClaims", { enumerable: true, get: function () { return config_1.parseOfferClaims; } });
|
|
8
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "parseOpenId4VcConfiguration", { enumerable: true, get: function () { return config_1.parseOpenId4VcConfiguration; } });
|
|
27
|
+
var openId4VcEvents_1 = require("./events/openId4VcEvents");
|
|
28
|
+
Object.defineProperty(exports, "OpenId4VcEventType", { enumerable: true, get: function () { return openId4VcEvents_1.OpenId4VcEventType; } });
|
|
9
29
|
var OpenId4VcPlugin_1 = require("./nestjs/OpenId4VcPlugin");
|
|
10
30
|
Object.defineProperty(exports, "OpenId4VcPlugin", { enumerable: true, get: function () { return OpenId4VcPlugin_1.OpenId4VcPlugin; } });
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "
|
|
31
|
+
__exportStar(require("./nestjs/dto"), exports);
|
|
32
|
+
var V2OpenId4VcCredentialExchangesController_1 = require("./nestjs/V2OpenId4VcCredentialExchangesController");
|
|
33
|
+
Object.defineProperty(exports, "V2OpenId4VcCredentialExchangesController", { enumerable: true, get: function () { return V2OpenId4VcCredentialExchangesController_1.V2OpenId4VcCredentialExchangesController; } });
|
|
34
|
+
var V2OpenId4VcPresentationsController_1 = require("./nestjs/V2OpenId4VcPresentationsController");
|
|
35
|
+
Object.defineProperty(exports, "V2OpenId4VcPresentationsController", { enumerable: true, get: function () { return V2OpenId4VcPresentationsController_1.V2OpenId4VcPresentationsController; } });
|
|
36
|
+
var V2OpenId4VcSigningCertificatesController_1 = require("./nestjs/V2OpenId4VcSigningCertificatesController");
|
|
37
|
+
Object.defineProperty(exports, "V2OpenId4VcSigningCertificatesController", { enumerable: true, get: function () { return V2OpenId4VcSigningCertificatesController_1.V2OpenId4VcSigningCertificatesController; } });
|
|
18
38
|
var setupOpenId4Vc_1 = require("./sdk/setupOpenId4Vc");
|
|
19
39
|
Object.defineProperty(exports, "setupOpenId4Vc", { enumerable: true, get: function () { return setupOpenId4Vc_1.setupOpenId4Vc; } });
|
|
20
|
-
var StatusListService_1 = require("./services/StatusListService");
|
|
21
|
-
Object.defineProperty(exports, "StatusListService", { enumerable: true, get: function () { return StatusListService_1.StatusListService; } });
|
|
22
40
|
var IssuerService_1 = require("./services/IssuerService");
|
|
23
41
|
Object.defineProperty(exports, "IssuerService", { enumerable: true, get: function () { return IssuerService_1.IssuerService; } });
|
|
24
|
-
Object.defineProperty(exports, "OpenId4VcIssuerRequestError", { enumerable: true, get: function () { return IssuerService_1.OpenId4VcIssuerRequestError; } });
|
|
25
|
-
Object.defineProperty(exports, "OpenId4VcOfferNotFoundError", { enumerable: true, get: function () { return IssuerService_1.OpenId4VcOfferNotFoundError; } });
|
|
26
42
|
var VerifierService_1 = require("./services/VerifierService");
|
|
27
|
-
Object.defineProperty(exports, "
|
|
28
|
-
Object.defineProperty(exports, "UnknownVerificationSessionError", { enumerable: true, get: function () { return VerifierService_1.UnknownVerificationSessionError; } });
|
|
43
|
+
Object.defineProperty(exports, "OPENID4VC_REQUEST_SIGNERS", { enumerable: true, get: function () { return VerifierService_1.OPENID4VC_REQUEST_SIGNERS; } });
|
|
29
44
|
Object.defineProperty(exports, "VerifierService", { enumerable: true, get: function () { return VerifierService_1.VerifierService; } });
|
|
45
|
+
var presentationRequest_1 = require("./services/presentationRequest");
|
|
46
|
+
Object.defineProperty(exports, "OPENID4VC_QUERY_LANGUAGES", { enumerable: true, get: function () { return presentationRequest_1.OPENID4VC_QUERY_LANGUAGES; } });
|
|
47
|
+
var types_1 = require("./trust/types");
|
|
48
|
+
Object.defineProperty(exports, "TRUST_VERDICT_NAMES", { enumerable: true, get: function () { return types_1.TRUST_VERDICT_NAMES; } });
|
|
49
|
+
Object.defineProperty(exports, "VERANA_TRUST_STATUSES", { enumerable: true, get: function () { return types_1.VERANA_TRUST_STATUSES; } });
|
|
50
|
+
var types_2 = require("./types");
|
|
51
|
+
Object.defineProperty(exports, "OPENID4VC_DID_TRUST_RESOLVER", { enumerable: true, get: function () { return types_2.OPENID4VC_DID_TRUST_RESOLVER; } });
|
|
52
|
+
Object.defineProperty(exports, "OPENID4VC_OPTIONS", { enumerable: true, get: function () { return types_2.OPENID4VC_OPTIONS; } });
|
|
30
53
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAAsG;AAA7F,0HAAA,6BAA6B,OAAA;AAAE,8HAAA,iCAAiC,OAAA;AAEzE,mCAMiB;AALf,qHAAA,2BAA2B,OAAA;AAC3B,+GAAA,qBAAqB,OAAA;AACrB,+GAAA,qBAAqB,OAAA;AACrB,0GAAA,gBAAgB,OAAA;AAChB,qHAAA,2BAA2B,OAAA;AAE7B,4DAA6D;AAApD,qHAAA,kBAAkB,OAAA;AAC3B,4DAA0D;AAAjD,kHAAA,eAAe,OAAA;AACxB,+CAA4B;AAC5B,8GAA4G;AAAnG,oKAAA,wCAAwC,OAAA;AACjD,kGAAgG;AAAvF,wJAAA,kCAAkC,OAAA;AAC3C,8GAA4G;AAAnG,oKAAA,wCAAwC,OAAA;AACjD,uDAAqD;AAA5C,gHAAA,cAAc,OAAA;AAGvB,0DAAwD;AAA/C,8GAAA,aAAa,OAAA;AAEtB,8DAAuF;AAA9E,4HAAA,yBAAyB,OAAA;AAAE,kHAAA,eAAe,OAAA;AAOnD,sEAA0E;AAAjE,gIAAA,yBAAyB,OAAA;AAMlC,uCAA0E;AAAjE,4GAAA,mBAAmB,OAAA;AAAE,8GAAA,qBAAqB,OAAA;AAEnD,iCAAyE;AAAhE,qHAAA,4BAA4B,OAAA;AAAE,0GAAA,iBAAiB,OAAA"}
|