@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-feature.SSISDK.57.uni.client.206 → 0.34.1-feature.SSISDK.58.host.nonce.endpoint.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +25 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +19 -19
- package/src/services/Siopv2MachineService.ts +12 -15
- package/src/utils/CredentialUtils.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -423,9 +423,9 @@ var plugin_schema_default = {
|
|
|
423
423
|
};
|
|
424
424
|
|
|
425
425
|
// src/agent/DidAuthSiopOpAuthenticator.ts
|
|
426
|
-
var
|
|
426
|
+
var import_did_auth_siop5 = require("@sphereon/did-auth-siop");
|
|
427
427
|
var import_ssi_sdk6 = require("@sphereon/ssi-sdk.data-store");
|
|
428
|
-
var
|
|
428
|
+
var import_ssi_types8 = require("@sphereon/ssi-types");
|
|
429
429
|
var import_uuid2 = require("uuid");
|
|
430
430
|
|
|
431
431
|
// src/session/functions.ts
|
|
@@ -1344,12 +1344,13 @@ var Siopv2Machine = class {
|
|
|
1344
1344
|
};
|
|
1345
1345
|
|
|
1346
1346
|
// src/services/Siopv2MachineService.ts
|
|
1347
|
-
var
|
|
1348
|
-
var
|
|
1349
|
-
var import_ssi_sdk3 = require("@sphereon/ssi-sdk.
|
|
1350
|
-
var import_ssi_sdk4 = require("@sphereon/ssi-sdk.
|
|
1351
|
-
var import_ssi_sdk5 = require("@sphereon/ssi-sdk.data-store");
|
|
1347
|
+
var import_did_auth_siop4 = require("@sphereon/did-auth-siop");
|
|
1348
|
+
var import_ssi_sdk_ext3 = require("@sphereon/ssi-sdk-ext.identifier-resolution");
|
|
1349
|
+
var import_ssi_sdk3 = require("@sphereon/ssi-sdk.credential-store");
|
|
1350
|
+
var import_ssi_sdk4 = require("@sphereon/ssi-sdk.data-store");
|
|
1352
1351
|
var import_ssi_types6 = require("@sphereon/ssi-types");
|
|
1352
|
+
var import_ssi_types7 = require("@sphereon/ssi-types");
|
|
1353
|
+
var import_ssi_sdk5 = require("@sphereon/ssi-sdk.core");
|
|
1353
1354
|
var import_dcql = require("dcql");
|
|
1354
1355
|
|
|
1355
1356
|
// src/utils/dcql.ts
|
|
@@ -1390,11 +1391,12 @@ function convertToDcqlCredentials(credential, hasher) {
|
|
|
1390
1391
|
__name(convertToDcqlCredentials, "convertToDcqlCredentials");
|
|
1391
1392
|
|
|
1392
1393
|
// src/services/Siopv2MachineService.ts
|
|
1393
|
-
var
|
|
1394
|
+
var import_ssi_sdk_ext4 = require("@sphereon/ssi-sdk-ext.did-utils");
|
|
1395
|
+
var logger3 = import_ssi_types7.Loggers.DEFAULT.get(LOGGER_NAMESPACE);
|
|
1394
1396
|
var siopSendAuthorizationResponse = /* @__PURE__ */ __name(async (connectionType, args, context) => {
|
|
1395
1397
|
const { agent } = context;
|
|
1396
1398
|
const { credentials } = args;
|
|
1397
|
-
if (connectionType !==
|
|
1399
|
+
if (connectionType !== import_ssi_sdk4.ConnectionType.SIOPv2_OpenID4VP) {
|
|
1398
1400
|
return Promise.reject(Error(`No supported authentication provider for type: ${connectionType}`));
|
|
1399
1401
|
}
|
|
1400
1402
|
const session = await agent.siopGetOPSession({
|
|
@@ -1404,7 +1406,7 @@ var siopSendAuthorizationResponse = /* @__PURE__ */ __name(async (connectionType
|
|
|
1404
1406
|
const aud = request.authorizationRequest.getMergedProperty("aud");
|
|
1405
1407
|
logger3.debug(`AUD: ${aud}`);
|
|
1406
1408
|
logger3.debug(JSON.stringify(request.authorizationRequest));
|
|
1407
|
-
const domain = await request.authorizationRequest.getMergedProperty("client_id") ?? request.issuer ?? "https://self-issued.me/v2";
|
|
1409
|
+
const domain = await request.authorizationRequest.getMergedProperty("client_id") ?? request.issuer ?? (request.versions.includes(import_did_auth_siop4.SupportedVersion.JWT_VC_PRESENTATION_PROFILE_v1) ? "https://self-issued.me/v2/openid-vc" : "https://self-issued.me/v2");
|
|
1408
1410
|
logger3.debug(`NONCE: ${session.nonce}, domain: ${domain}`);
|
|
1409
1411
|
const firstUniqueDC = credentials[0];
|
|
1410
1412
|
if (typeof firstUniqueDC !== "object" || !("digitalCredential" in firstUniqueDC)) {
|
|
@@ -1413,9 +1415,9 @@ var siopSendAuthorizationResponse = /* @__PURE__ */ __name(async (connectionType
|
|
|
1413
1415
|
let identifier;
|
|
1414
1416
|
const digitalCredential = firstUniqueDC.digitalCredential;
|
|
1415
1417
|
const firstVC = firstUniqueDC.uniformVerifiableCredential;
|
|
1416
|
-
const holder =
|
|
1418
|
+
const holder = import_ssi_types7.CredentialMapper.isSdJwtDecodedCredential(firstVC) ? firstVC.decodedPayload.cnf?.jwk ? (
|
|
1417
1419
|
//doesn't apply to did:jwk only, as you can represent any DID key as a JWK. So whenever you encounter a JWK it doesn't mean it had to come from a did:jwk in the system. It just can always be represented as a did:jwk
|
|
1418
|
-
`did:jwk:${(0,
|
|
1420
|
+
`did:jwk:${(0, import_ssi_sdk5.encodeJoseBlob)(firstVC.decodedPayload.cnf?.jwk)}#0`
|
|
1419
1421
|
) : firstVC.decodedPayload.sub : Array.isArray(firstVC.credentialSubject) ? firstVC.credentialSubject[0].id : firstVC.credentialSubject.id;
|
|
1420
1422
|
if (!digitalCredential.kmsKeyRef) {
|
|
1421
1423
|
if (!holder) {
|
|
@@ -1429,7 +1431,7 @@ var siopSendAuthorizationResponse = /* @__PURE__ */ __name(async (connectionType
|
|
|
1429
1431
|
logger3.debug(`Holder DID not found: ${holder}`);
|
|
1430
1432
|
throw e;
|
|
1431
1433
|
}
|
|
1432
|
-
} else if ((0,
|
|
1434
|
+
} else if ((0, import_ssi_sdk_ext3.isOID4VCIssuerIdentifier)(digitalCredential.kmsKeyRef)) {
|
|
1433
1435
|
identifier = await session.context.agent.identifierManagedGetByOID4VCIssuer({
|
|
1434
1436
|
identifier: firstUniqueDC.digitalCredential.kmsKeyRef
|
|
1435
1437
|
});
|
|
@@ -1495,7 +1497,7 @@ var getSelectableCredentials = /* @__PURE__ */ __name(async (dcqlQuery, context)
|
|
|
1495
1497
|
};
|
|
1496
1498
|
const { agent } = agentContext;
|
|
1497
1499
|
const uniqueVerifiableCredentials = await agent.crsGetUniqueCredentials({
|
|
1498
|
-
filter: (0,
|
|
1500
|
+
filter: (0, import_ssi_sdk3.verifiableCredentialForRoleFilter)(import_ssi_types6.CredentialRole.HOLDER)
|
|
1499
1501
|
});
|
|
1500
1502
|
const branding = await agent.ibGetCredentialBranding();
|
|
1501
1503
|
const dcqlCredentialsWithCredentials = new Map(uniqueVerifiableCredentials.map((vc) => [
|
|
@@ -1566,7 +1568,7 @@ var translateCorrelationIdToName = /* @__PURE__ */ __name(async (correlationId,
|
|
|
1566
1568
|
}, "translateCorrelationIdToName");
|
|
1567
1569
|
|
|
1568
1570
|
// src/agent/DidAuthSiopOpAuthenticator.ts
|
|
1569
|
-
var logger4 =
|
|
1571
|
+
var logger4 = import_ssi_types8.Loggers.DEFAULT.options(LOGGER_NAMESPACE, {}).get(LOGGER_NAMESPACE);
|
|
1570
1572
|
var didAuthSiopOpAuthenticatorMethods = [
|
|
1571
1573
|
"cmGetContacts",
|
|
1572
1574
|
"cmGetContact",
|
|
@@ -1784,7 +1786,7 @@ var DidAuthSiopOpAuthenticator = class {
|
|
|
1784
1786
|
alias: correlationId,
|
|
1785
1787
|
origin: import_ssi_sdk6.IdentityOrigin.EXTERNAL,
|
|
1786
1788
|
roles: [
|
|
1787
|
-
|
|
1789
|
+
import_ssi_types8.CredentialRole.ISSUER
|
|
1788
1790
|
],
|
|
1789
1791
|
identifier: {
|
|
1790
1792
|
type: correlationId.startsWith("did:") ? import_ssi_sdk6.CorrelationIdentifierType.DID : import_ssi_sdk6.CorrelationIdentifierType.URL,
|
|
@@ -1828,7 +1830,7 @@ var DidAuthSiopOpAuthenticator = class {
|
|
|
1828
1830
|
return {
|
|
1829
1831
|
body: responseBody,
|
|
1830
1832
|
url: response?.url,
|
|
1831
|
-
queryParams: (0,
|
|
1833
|
+
queryParams: (0, import_did_auth_siop5.decodeUriAsJson)(response?.url)
|
|
1832
1834
|
};
|
|
1833
1835
|
}
|
|
1834
1836
|
async siopGetSelectableCredentials(args, context) {
|
|
@@ -1841,11 +1843,11 @@ var DidAuthSiopOpAuthenticator = class {
|
|
|
1841
1843
|
};
|
|
1842
1844
|
|
|
1843
1845
|
// src/machine/CallbackStateListener.ts
|
|
1844
|
-
var
|
|
1845
|
-
var logger5 =
|
|
1846
|
-
defaultLogLevel:
|
|
1846
|
+
var import_ssi_types9 = require("@sphereon/ssi-types");
|
|
1847
|
+
var logger5 = import_ssi_types9.Loggers.DEFAULT.options("sphereon:siopv2-oid4vp:op-auth", {
|
|
1848
|
+
defaultLogLevel: import_ssi_types9.LogLevel.DEBUG,
|
|
1847
1849
|
methods: [
|
|
1848
|
-
|
|
1850
|
+
import_ssi_types9.LogMethod.CONSOLE
|
|
1849
1851
|
]
|
|
1850
1852
|
}).get("sphereon:siopv2-oid4vp:op-auth");
|
|
1851
1853
|
var OID4VPCallbackStateListener = /* @__PURE__ */ __name((callbacks) => {
|
|
@@ -1878,8 +1880,8 @@ var OID4VPCallbackStateListener = /* @__PURE__ */ __name((callbacks) => {
|
|
|
1878
1880
|
var import_ssi_sdk7 = require("@sphereon/ssi-sdk.agent-config");
|
|
1879
1881
|
var import_ssi_sdk8 = require("@sphereon/ssi-sdk.core");
|
|
1880
1882
|
var import_ssi_sdk9 = require("@sphereon/ssi-sdk.xstate-machine-persistence");
|
|
1881
|
-
var
|
|
1882
|
-
var logger6 =
|
|
1883
|
+
var import_ssi_types10 = require("@sphereon/ssi-types");
|
|
1884
|
+
var logger6 = import_ssi_types10.Loggers.DEFAULT.options(LOGGER_NAMESPACE, {}).get(LOGGER_NAMESPACE);
|
|
1883
1885
|
var Siopv2OID4VPLinkHandler = class extends import_ssi_sdk8.LinkHandlerAdapter {
|
|
1884
1886
|
static {
|
|
1885
1887
|
__name(this, "Siopv2OID4VPLinkHandler");
|