Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credential status list #26

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion credential-status-list
2 changes: 2 additions & 0 deletions db-setup/scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ CREATE DATABASE vidissuer;
CREATE DATABASE ehicissuer;
CREATE DATABASE verifier;
CREATE DATABASE pda1issuer;
CREATE DATABASE resources_vault;
CREATE DATABASE credential_status_list;
2 changes: 1 addition & 1 deletion resources-vault
2 changes: 1 addition & 1 deletion wallet-enterprise
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export = {
password: "root",
dbname: "verifier"
},
wwwalletURL: "http://localhost:3000/cb"
wwwalletURL: "http://localhost:3000/cb",
crl: {},
}
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ th {
}

textarea.wide{
width: 40% !important;
width: 60% !important;
}

#json-textarea {
Expand All @@ -614,11 +614,28 @@ textarea.wide{
color: black;
overflow: auto;
resize: vertical;
width: 500px;
min-height: 200px;
}

.expired-label {
--tw-bg-opacity: 1;
background-color: #F97316;
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
--tw-border-opacity: 1;
border-color: #F97316;
border-top-width: 1px;
border-left-width: 1px;
border-top-left-radius: 0.5rem;
font-size: 0.75rem;
line-height: 1rem;
padding: 0.25rem 0.75rem 0.25rem 0.75rem;
right: 0px;
bottom: 0px;
position: absolute;
}

.revoked-label {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
--tw-text-opacity: 1;
Expand All @@ -631,8 +648,8 @@ textarea.wide{
font-size: 0.75rem;
line-height: 1rem;
padding: 0.25rem 0.75rem 0.25rem 0.75rem;
right: 10px;
bottom: 10px;
right: 0px;
bottom: 0px;
position: absolute;
}

Expand Down Expand Up @@ -700,3 +717,63 @@ textarea.wide{
.checkbox input[type="checkbox"]:checked + label:after {
display: block;
}

/* CSS for the claims tables */

/* CSS for the claims tables */
.claims-tables {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}

.claims-tables h4 {
margin: 10px 0;
color: #333;
}

.table-container {
width: 60%;
margin-bottom: 20px;
overflow-x: auto; /* Enable horizontal scrolling */
}

.table-container table {
width: 100%;
border-collapse: collapse;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {

.table-container{
width: -webkit-fill-available!important;
margin-left: 1%;
margin-right: 1%;
}
}

.table-container table thead tr {
background-color: #f2f2f2;
}

.table-container table th,
.table-container table td {
padding: 10px;
text-align: left;
border: 1px solid #ddd;
font-size: 14px;
}

.table-container table th {
color: white;
}

.table-container table tbody tr:nth-child(even) {
background-color: #f9f9f9;
}

.table-container table tbody tr:hover {
background-color: #f1f1f1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,25 @@ block layout-content
each credential, index in credentialPayloads
- const branding = credential.credentialBranding || { backgroundColor: 'red', textColor: 'black' }
- const imageUrl = credential.credentialBranding.image.url // Get the corresponding image URL
.credential-box(style=`display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; position: relative; padding: 10px;`, id=`credential-box-${index}`)
.credential-box(style=`position:relative;overflow:hidden;display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; position: relative; margin: 10px;border-radius:10px;`, id=`credential-box-${index}`)
img(style="width: 240px; height: 150px; border-radius: 10px;")(src=imageUrl)

h3 Requested claims extracted from credentials

// Text area to display claims
textarea#json-textarea.wide
//- Display the 'credentialPayloads' JSON object
| #{JSON.stringify(presentationClaims, null, 2)}
.claims-tables
each claimType in Object.keys(presentationClaims)
h4= claimType
.table-container(style="overflow-x: auto;")
table
thead
tr
th Name
th Value
tbody
each claim in presentationClaims[claimType]
tr
td= claim.name
td= claim.value

h3 Credentials

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export = {
url: "http://wallet-enterprise-ehic-issuer:8004",
port: "8004",
Expand All @@ -10,5 +9,11 @@ export = {
password: "root",
dbname: "ehicissuer"
},
wwwalletURL: "http://localhost:3000/cb"
wwwalletURL: "http://localhost:3000/cb",
crl: {
url: "http://credential-status-list:9001",
credentials: {
basicToken: "U0RGRUoyM05KNDNOMkpFTlNBS05LSkROZHNBU0FERk5TS0pkc2FuZGtzZmpzZjoyMTMyMTMyMTNBU0tETWtzYWRzZmRkc2tqZm5GS0xTREFGSlNGU0RTREZTRkQK"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AuthorizationServerState } from "../../entities/AuthorizationServerStat
import { CredentialView } from "../../authorization/types";
import { randomUUID } from "node:crypto";
import fs from 'fs';
import { CredentialStatusList } from "../../lib/CredentialStatus";

export class EHICSupportedCredentialSdJwt implements SupportedCredentialProtocol {

Expand Down Expand Up @@ -81,6 +82,10 @@ export class EHICSupportedCredentialSdJwt implements SupportedCredentialProtocol
...ehicClaims,
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
"image": {
"url": config.url + "/images/ehicCard.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ export = {
wwwalletURL: "http://localhost:3000/cb",
resourcesVaultService: {
url: "http://resources-vault:6555"
},
crl: {
url: "http://credential-status-list:9001",
credentials: {
basicToken: "U0RGRUoyM05KNDNOMkpFTlNBS05LSkROZHNBU0FERk5TS0pkc2FuZGtzZmpzZjoyMTMyMTMyMTNBU0tETWtzYWRzZmRkc2tqZm5GS0xTREFGSlNGU0RTREZTRkQK"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import fs from 'fs';
import path from 'path';
import axios from 'axios';
import { compactDecrypt, calculateJwkThumbprint, CompactEncrypt } from 'jose';
import { CredentialStatusList } from "../../lib/CredentialStatus";
const currentWorkingDirectory = __dirname + "/../../../../";

var publicKeyFilePath;
Expand Down Expand Up @@ -169,6 +170,10 @@ export class PDA1SupportedCredentialSdJwt implements SupportedCredentialProtocol
...claims,
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
"image": {
"url": config.url + "/images/pda1.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ export = {
password: "root",
dbname: "vidissuer"
},
wwwalletURL: "http://localhost:3000/cb"
wwwalletURL: "http://localhost:3000/cb",
crl: {
url: "http://credential-status-list:9001",
credentials: {
basicToken: "U0RGRUoyM05KNDNOMkpFTlNBS05LSkROZHNBU0FERk5TS0pkc2FuZGtzZmpzZjoyMTMyMTMyMTNBU0tETWtzYWRzZmRkc2tqZm5GS0xTREFGSlNGU0RTREZTRkQK"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AuthorizationServerState } from "../../entities/AuthorizationServerStat
import { CredentialView } from "../../authorization/types";
import { randomUUID } from "node:crypto";
import fs from 'fs';
import { CredentialStatusList } from "../../lib/CredentialStatus";

export class VIDSupportedCredentialSdJwt implements SupportedCredentialProtocol {

Expand Down Expand Up @@ -83,6 +84,10 @@ export class VIDSupportedCredentialSdJwt implements SupportedCredentialProtocol
...vidClaims,
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
"image": {
"url": config.url + "/images/vidCard.png"
Expand Down
2 changes: 1 addition & 1 deletion wallet-frontend
Loading