Skip to content

Commit

Permalink
added @context field and issuer as part of the metadata of the vcs
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed May 28, 2024
1 parent fcba6eb commit a0f7d29
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "SERVER_URL=https://6d7f-2a02-587-870b-2f00-d697-1738-3249-fb5f.ngrok-free.app node server.js"
"dev": "SERVER_URL=https://0324-195-251-179-70.ngrok-free.app node server.js"
},
"author": "",
"license": "ISC",
Expand Down
14 changes: 14 additions & 0 deletions routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ router.post("/credential", async (req, res) => {
issued: new Date(Math.floor(Date.now() / 1000) * 1000).toISOString(),
issuer: serverURL,
type: ["PID"],
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://europa.eu/2018/credentials/eudi/pid/v1",
],
issuer: serverURL,
validFrom: new Date(
Math.floor(Date.now() / 1000) * 1000
).toISOString(),
Expand Down Expand Up @@ -324,6 +329,11 @@ router.post("/credential", async (req, res) => {
},
},
type: ["ePassportCredential"],
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://schemas.prod.digitalcredentials.iata.org/contexts/iata_credential.jsonld",
],
issuer: serverURL,
validFrom: new Date(
Math.floor(Date.now() / 1000) * 1000
).toISOString(),
Expand All @@ -342,6 +352,8 @@ router.post("/credential", async (req, res) => {
jti: "urn:did:1904a925-38bd-4eda-b682-4b5e3ca9d4bc",
vc: {
type: ["EducationalID"],
"@context": ["https://www.w3.org/2018/credentials/v1"],
issuer: serverURL,
credentialSubject: {
id: decodedHeaderSubjectDID || "",
identifier: "[email protected]",
Expand Down Expand Up @@ -388,6 +400,8 @@ router.post("/credential", async (req, res) => {
jti: "urn:did:1904a925-38bd-4eda-b682-4b5e3ca9d4bc",
vc: {
type: ["allianceIDCredential"],
"@context": ["https://www.w3.org/2018/credentials/v1"],
issuer: serverURL,
credentialSubject: {
id: decodedHeaderSubjectDID, // Replace with the actual subject DID
identifier: {
Expand Down

0 comments on commit a0f7d29

Please sign in to comment.