From 15bab3e7c57a5c44ba9c09fadf86ba1a6988b8ba Mon Sep 17 00:00:00 2001 From: mikeplotean <101570226+mikeplotean@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:05:26 +0200 Subject: [PATCH 1/3] chore: handle missing credential issuer (#48) --- web/src/pages/credentials/[credentialId].vue | 50 ++++++++++---------- web/src/pages/index.vue | 4 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/web/src/pages/credentials/[credentialId].vue b/web/src/pages/credentials/[credentialId].vue index 2676031..70c2841 100644 --- a/web/src/pages/credentials/[credentialId].vue +++ b/web/src/pages/credentials/[credentialId].vue @@ -32,12 +32,12 @@ ) }} -
+
- {{ jwtJson.vc.issuer.name }} + {{ jwtJson.vc.issuer?.name }}
@@ -249,30 +249,32 @@
-
Issuer
-
-
Name
-
{{ jwtJson.vc.issuer.name }}
-
-
-
DID
-
- {{ jwtJson.vc.issuer.id ? jwtJson.vc.issuer.id : jwtJson.vc.issuer }} +
+
Issuer
+
+
Name
+
{{ jwtJson.vc.issuer.name }}
-
-
-
-
- {{ - 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) - : "" - }} +
+
DID
+
+ {{ jwtJson.vc.issuer.id ? jwtJson.vc.issuer.id : jwtJson.vc.issuer }} +
-
- Issued - {{jwtJson.vc.issuanceDate ? new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) : "No issuancedate" }} +
+
+
+ {{ + 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) + : "" + }} +
+
+ Issued + {{ jwtJson.vc.issuanceDate ? new Date(jwtJson.vc.issuanceDate).toISOString().slice(0, 10) : "No issuancedate" }} +
diff --git a/web/src/pages/index.vue b/web/src/pages/index.vue index 2de0edd..eb2cd14 100644 --- a/web/src/pages/index.vue +++ b/web/src/pages/index.vue @@ -57,13 +57,13 @@ ) }} -
+
- {{ credential.issuer.name }} + {{ credential.issuer?.name }}
From e31e0b67a99838f2cfe6e84b03deb19108958d37 Mon Sep 17 00:00:00 2001 From: mikeplotean <101570226+mikeplotean@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:20:46 +0200 Subject: [PATCH 2/3] ci: publish swagger (#53) --- k8s/deployment-dev.yaml | 11 +++++++++-- k8s/deployment-prod.yaml | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/k8s/deployment-dev.yaml b/k8s/deployment-dev.yaml index a48ffbc..8592fb1 100644 --- a/k8s/deployment-dev.yaml +++ b/k8s/deployment-dev.yaml @@ -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 \ No newline at end of file diff --git a/k8s/deployment-prod.yaml b/k8s/deployment-prod.yaml index f031252..f83e662 100644 --- a/k8s/deployment-prod.yaml +++ b/k8s/deployment-prod.yaml @@ -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 \ No newline at end of file + name: http \ No newline at end of file From 37d081ba506cb9aaeaa331c4bb6613db39ece8ca Mon Sep 17 00:00:00 2001 From: mikeplotean <101570226+mikeplotean@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:14:02 +0200 Subject: [PATCH 3/3] chore: consider blank values when checking credential-id (#54) --- src/main/kotlin/id/walt/service/SSIKit2WalletService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt b/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt index 40821d6..1b1efca 100644 --- a/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt +++ b/src/main/kotlin/id/walt/service/SSIKit2WalletService.kt @@ -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")