Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkar-jain committed Oct 31, 2023
2 parents 52d52c8 + 37d081b commit 32a0c46
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 31 deletions.
11 changes: 9 additions & 2 deletions k8s/deployment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,18 @@ spec:
service:
name: wallet-backend
port:
number: 80
name: http
- path: /swagger
pathType: Prefix
backend:
service:
name: wallet-backend
port:
name: http
- path: /
pathType: Prefix
backend:
service:
name: wallet-frontend
port:
number: 80
name: http
11 changes: 9 additions & 2 deletions k8s/deployment-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,18 @@ spec:
service:
name: wallet-backend
port:
number: 80
name: http
- path: /swagger
pathType: Prefix
backend:
service:
name: wallet-backend
port:
name: http
- path: /
pathType: Prefix
backend:
service:
name: wallet-frontend
port:
number: 80
name: http
3 changes: 2 additions & 1 deletion src/main/kotlin/id/walt/service/SSIKit2WalletService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ class SSIKit2WalletService(accountId: UUID) : WalletService(accountId) {

val credentialId = Json.parseToJsonElement(
Base64.UrlSafe.decode(credential.split(".")[1]).decodeToString()
).jsonObject["vc"]!!.jsonObject["id"]?.jsonPrimitive?.content ?: randomUUID()
).jsonObject["vc"]!!.jsonObject["id"]?.jsonPrimitive?.content?.takeIf { it.isNotBlank() }
?: randomUUID()

CredentialsService.add(accountId, DbCredential(credentialId = credentialId, document = credential))
println(">>> $index. CREDENTIAL stored with Id: $credentialId")
Expand Down
50 changes: 26 additions & 24 deletions web/src/pages/credentials/[credentialId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
)
}}
</h2>
<div class="flex items-center">
<div v-if="jwtJson.vc.issuer" class="flex items-center">
<img :src="jwtJson.vc.issuer?.image?.id ? jwtJson.vc.issuer?.image?.id : jwtJson.vc.issuer?.image"
class="w-12"
/>
<div class="text-natural-600 ml-2 w-32">
{{ jwtJson.vc.issuer.name }}
{{ jwtJson.vc.issuer?.name }}
</div>
</div>
</div>
Expand Down Expand Up @@ -249,30 +249,32 @@
</div>

<hr class="my-5"/>
<div class="text-gray-500 mb-4 font-bold">Issuer</div>
<div class="md:flex text-gray-500 mb-3 md:mb-1">
<div class="min-w-[19vw]">Name</div>
<div class="font-bold">{{ jwtJson.vc.issuer.name }}</div>
</div>
<div class="md:flex text-gray-500 mb-3 md:mb-1">
<div class="min-w-[19vw]">DID</div>
<div class="font-bold overflow-scroll lg:overflow-auto">
{{ jwtJson.vc.issuer.id ? jwtJson.vc.issuer.id : jwtJson.vc.issuer }}
<div v-if="jwtJson.vc.issuer">
<div class="text-gray-500 mb-4 font-bold">Issuer</div>
<div class="md:flex text-gray-500 mb-3 md:mb-1">
<div class="min-w-[19vw]">Name</div>
<div class="font-bold">{{ jwtJson.vc.issuer.name }}</div>
</div>
</div>
<hr class="mt-5 mb-3"/>
<div class="text-gray-600 flex justify-between">
<div>
{{
jwtJson.vc.expirationDate && jwtJson.vc.issuanceDate
? "Valid from " + new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) + " to " + new
Date(jwtJson.vc.expirationDate).toISOString().slice(0, 10)
: ""
}}
<div class="md:flex text-gray-500 mb-3 md:mb-1">
<div class="min-w-[19vw]">DID</div>
<div class="font-bold overflow-scroll lg:overflow-auto">
{{ jwtJson.vc.issuer.id ? jwtJson.vc.issuer.id : jwtJson.vc.issuer }}
</div>
</div>
<div class="text-gray-900">
Issued
{{jwtJson.vc.issuanceDate ? new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) : "No issuancedate" }}
<hr class="mt-5 mb-3"/>
<div class="text-gray-600 flex justify-between">
<div>
{{
jwtJson.vc.expirationDate && jwtJson.vc.issuanceDate
? "Valid from " + new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) + " to " + new
Date(jwtJson.vc.expirationDate).toISOString().slice(0, 10)
: ""
}}
</div>
<div class="text-gray-900">
Issued
{{ jwtJson.vc.issuanceDate ? new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) : "No issuancedate" }}
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
)
}}
</h2>
<div class="flex items-center">
<div v-if="credential.issuer" class="flex items-center">
<img class="w-12" :src="credential.issuer?.image?.id
? credential.issuer?.image?.id
: credential.issuer?.image
" />
<div class="text-natural-600 ml-2 w-32">
{{ credential.issuer.name }}
{{ credential.issuer?.name }}
</div>
</div>
</div>
Expand Down

0 comments on commit 32a0c46

Please sign in to comment.