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