Skip to content

Commit

Permalink
fix: load status-list template using template service
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeplotean committed May 2, 2023
1 parent 2584b2c commit 6a1c0d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sealed class CredentialStatus(
val type: String,
) {
abstract val id: String
@Serializable
enum class Types{
StatusList2021Entry,
SimpleCredentialStatus2022,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import id.walt.common.resolveContent
import id.walt.credentials.w3c.VerifiableCredential
import id.walt.credentials.w3c.W3CCredentialSubject
import id.walt.credentials.w3c.builder.W3CCredentialBuilder
import id.walt.credentials.w3c.templates.VcTemplateService
import id.walt.credentials.w3c.toVerifiableCredential
import id.walt.model.DidMethod
import id.walt.servicematrix.ServiceProvider
Expand Down Expand Up @@ -32,6 +33,7 @@ class WaltIdStatusListCredentialStorageService : StatusListCredentialStorageServ
private val credentialsGroup = "status-credentials"
private val signatoryService = Signatory.getService()
private val vcStoreService = ContextManager.vcStore
private val templateService = VcTemplateService.getService()
private val issuerDid = DidService.create(DidMethod.key)// TODO: fix it

override fun fetch(id: String): VerifiableCredential? =
Expand All @@ -55,7 +57,7 @@ class WaltIdStatusListCredentialStorageService : StatusListCredentialStorageServ
)
)
}.let {
W3CCredentialBuilder.fromPartial(resolveContent(templatePath)).apply {
W3CCredentialBuilder.fromPartial(templateService.getTemplate(templatePath).template!!).apply {
setId(it.id ?: id)
buildSubject {
setFromJson(it.toJson())
Expand Down

0 comments on commit 6a1c0d0

Please sign in to comment.