Skip to content

Commit

Permalink
add issuer id
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Tuerk <[email protected]>
  • Loading branch information
JoTiTu committed Jan 2, 2025
1 parent f23104f commit 5664750
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
using WalletFramework.Core.Credentials;
using WalletFramework.Core.Functional;
using WalletFramework.Core.Json;
using WalletFramework.Core.String;
using WalletFramework.MdocLib;
using WalletFramework.MdocVc;
using WalletFramework.Oid4Vc.Oid4Vci.Issuer.Models;
using WalletFramework.SdJwtVc.Models;
using WalletFramework.SdJwtVc.Models.Records;
using WalletFramework.SdJwtVc.Models.StatusList;
Expand Down Expand Up @@ -139,7 +141,8 @@ public static void AddSdJwtData(

public static void AddMDocData(
this CredentialSetRecord credentialSetRecord,
MdocRecord mdocRecord)
MdocRecord mdocRecord,
IssuerMetadata issuerMetadata)
{
credentialSetRecord.MDocCredentialType = mdocRecord.DocType;
credentialSetRecord.State = mdocRecord.CredentialState;
Expand All @@ -151,7 +154,9 @@ public static void AddMDocData(

if (credentialSetRecord.ExpiresAt.IsNone)
credentialSetRecord.ExpiresAt = mdocRecord.ExpiresAt.ToOption();
//TODO: Add issuerId

if (credentialSetRecord.IssuerId.IsNullOrEmpty())
credentialSetRecord.IssuerId = issuerMetadata.CredentialIssuer.ToString();
}

public static CredentialSetId GetCredentialSetId(this CredentialSetRecord credentialSetRecord) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ await credential.Value.Match(
credentialSet.GetCredentialSetId(), creds.Count > 1);
await _mdocStorage.Add(record);

credentialSet.AddMDocData(record);
credentialSet.AddMDocData(record, issuerMetadata);
});
}
},
Expand Down Expand Up @@ -415,7 +415,7 @@ await credential.Value.Match(
credentialSet.GetCredentialSetId(), creds.Count > 1);
await _mdocStorage.Add(record);

credentialSet.AddMDocData(record);
credentialSet.AddMDocData(record, session.AuthorizationData.IssuerMetadata);
});
}
},
Expand Down Expand Up @@ -534,7 +534,7 @@ select credentialsOrTransactionId.Match<OneOf<List<ICredential>, TransactionId>>
var record = mdoc.Decoded.ToRecord(displays, response.KeyId,
credentialSetRecord.GetCredentialSetId(), creds.Count > 1);

credentialSetRecord.AddMDocData(record);
credentialSetRecord.AddMDocData(record, session.AuthorizationData.IssuerMetadata);

token = token.Match<OneOf<OAuthToken, DPopToken>>(
oAuth =>
Expand Down

0 comments on commit 5664750

Please sign in to comment.