Closed cre8 closed 4 months ago
Just to confirm. This was working with the previous version of the VCI lib that only supported up to Draft 11?
Just to confirm. This was working with the previous version of the VCI lib that only supported up to Draft 11?
Yes, when updating the packages from 0.10.3
to 0.12.0
, see https://github.com/openwallet-foundation-labs/credhub/pull/70/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
Okay thanks, we will have a look
You wanted to uniform the credential here for a generalized event. But when it's an sd-jwt string encoded, the toUniFormCredential
function needs the hasher.
I am not sure if it's better to let the CredentialSignerCallback return a decoded credential and not of type string to avoid this scenario. But encoding and decoding and encoding does not seems to be a good solution :D
I would suggest to just pass the credential "as is" in the event without specific information like issuer. Parsing the credentials to get specific attributes will increase the complexity.
A patch like this works fine:
diff --git a/dist/VcIssuer.js b/dist/VcIssuer.js
index 31db1854f9b56f46cb736da64cc345a183a1b16b..30386be728cf06b5481aa90b6cbdee61e58dde23 100644
--- a/dist/VcIssuer.js
+++ b/dist/VcIssuer.js
@@ -471,15 +471,15 @@ class VcIssuer {
throw new Error(oid4vci_common_1.ISSUER_CONFIG_ERROR);
}
const credential = issuerCallback ? yield issuerCallback(opts) : yield this._credentialSignerCallback(opts);
- const uniform = ssi_types_1.CredentialMapper.toUniformCredential(credential);
- const issuer = uniform.issuer ? (typeof uniform.issuer === 'string' ? uniform.issuer : uniform.issuer.id) : '<unknown>';
+ // const uniform = ssi_types_1.CredentialMapper.toUniformCredential(credential);
+ // const issuer = uniform.issuer ? (typeof uniform.issuer === 'string' ? uniform.issuer : uniform.issuer.id) : '<unknown>';
// TODO: Create builder
events_1.EVENTS.emit(events_1.CredentialEventNames.OID4VCI_CREDENTIAL_ISSUED, {
eventName: events_1.CredentialEventNames.OID4VCI_CREDENTIAL_ISSUED,
id: (0, uuid_1.v4)(),
data: credential,
// TODO: Format, request etc
- initiator: issuer !== null && issuer !== void 0 ? issuer : '<unknown>',
+ // initiator: issuer !== null && issuer !== void 0 ? issuer : '<unknown>',
initiatorType: ssi_types_1.InitiatorType.EXTERNAL,
system: ssi_types_1.System.OID4VCI,
subsystem: ssi_types_1.SubSystem.VC_ISSUER,
Closing this since it seems to be fixed in 0.14.0
I updated from draf 11 to draft 13 using the
sd-jwt-vc
credentials. MycredentialSignerCallback
implementation returned a compact jwt as string. But then I am getting this response:The
const decoded = CredentialMapper.decodeVerifiableCredential(original)
gets no hasher passed, so I returned a decoded sdjwt like:But then then it fails earlier:
I would assume that the
hasher
function pass is missing in the function call, or do you have a better return type for theCredentialSignerCallback