Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
51caa45
initialize package with http-server for testing
jchartrand Dec 22, 2025
dc5900e
add rollup build
jchartrand Dec 22, 2025
8e35db2
update page
jchartrand Dec 22, 2025
3e5425a
push dist for now to allow Github pages to work
jchartrand Dec 22, 2025
7d9bb1a
add rollup node package resolver
jchartrand Dec 22, 2025
4efc33e
add test credential
jchartrand Dec 22, 2025
3c46f5a
add node resolver to rollup config
jchartrand Dec 22, 2025
7063a1e
add verifier-core call
jchartrand Dec 22, 2025
db91031
switch test cred to an object
jchartrand Dec 23, 2025
a51de7c
switch to using webpack bundle
jchartrand Dec 23, 2025
b0f86df
switch to webpack from rollup
jchartrand Dec 23, 2025
3d12abc
clean out dist
jchartrand Dec 23, 2025
0a47b4b
add webpack dev server
jchartrand Dec 23, 2025
86bd4ee
force single webpack bundle
jchartrand Dec 23, 2025
a6f3ba7
switch to DB vc for signature verification
jchartrand Dec 29, 2025
4c5858b
trigger verification from button
jchartrand Dec 29, 2025
16f5a80
display signature result
jchartrand Dec 29, 2025
94dcea8
show/hide containers instead of dynamically adding
jchartrand Dec 29, 2025
cde9770
rework spinners, checks, and layout
jchartrand Dec 30, 2025
ee6ad50
push bundle for Pages deployment
jchartrand Dec 30, 2025
f0b7398
add vc url/json resolver
jchartrand Dec 31, 2025
a57b078
add expiry handling
jchartrand Dec 31, 2025
9b4565f
add better expiration date messages
jchartrand Dec 31, 2025
60f10f9
add red X on failure
jchartrand Dec 31, 2025
a9a4972
dynamically draw red x
jchartrand Dec 31, 2025
ed58c2e
fix alignment
jchartrand Dec 31, 2025
fcd6d86
rebuild for Pages
jchartrand Dec 31, 2025
064140b
add separate status check to avoid CORS preflight errors
jchartrand Dec 31, 2025
4d007f6
build for Pages
jchartrand Dec 31, 2025
321c647
fix overlaid cross and checkmark
jchartrand Dec 31, 2025
17ce165
add issuer lookup
jchartrand Jan 1, 2026
ad3130e
rebuild for pages
jchartrand Jan 1, 2026
ad7c8f9
set up playwright and first test
jchartrand Jan 2, 2026
90190c7
add more tests
jchartrand Jan 2, 2026
ca59757
display credential details if signature and issuer are valid
jchartrand Jan 2, 2026
bac6830
fix invalid signature handling
jchartrand Jan 2, 2026
821028e
update build for github Pages
jchartrand Jan 2, 2026
8f24313
styling
jchartrand Jan 3, 2026
76cc0ca
fix styling
jchartrand Jan 3, 2026
3f209c8
rework credential display
jchartrand Jan 6, 2026
bf1e905
rework styling
jchartrand Jan 6, 2026
5c2519e
display cleanup
jchartrand Jan 6, 2026
ace42bc
more styling
jchartrand Jan 6, 2026
c18a0a5
add wait spinner for fetches
jchartrand Jan 6, 2026
964cc02
rework promises to display progress
jchartrand Jan 6, 2026
242c827
big rework of shadow DOM selection
jchartrand Jan 6, 2026
342bbf2
build for Pages deployment
jchartrand Jan 6, 2026
58c5f22
add drag and drop option
jchartrand Jan 7, 2026
fcf7e3a
remove listeners on close
jchartrand Jan 7, 2026
e36b614
add reset option
jchartrand Jan 7, 2026
0579d97
build for pages
jchartrand Jan 7, 2026
fb2265d
fix pointer to bundle for Pages
jchartrand Jan 7, 2026
9e391ac
remove old data on reset
jchartrand Jan 7, 2026
1f8d6ee
add details dialog
jchartrand Jan 7, 2026
de22b51
remove focus from modal
jchartrand Jan 7, 2026
572249a
font, color, alignment changes
jchartrand Jan 8, 2026
84707e2
first crack at readme
jchartrand Jan 8, 2026
adffec6
add slot header content to page
jchartrand Jan 8, 2026
5a73930
reorganize styles
jchartrand Jan 8, 2026
1acaf97
remove header in favour of slot content
jchartrand Jan 8, 2026
6a0383a
add public verify method to element
jchartrand Jan 8, 2026
782043e
update README
jchartrand Jan 8, 2026
b7a178b
add event listener to html
jchartrand Jan 8, 2026
7af7e76
fire custom event when component is ready
jchartrand Jan 8, 2026
1157e3b
switch sample vc to include holder name
jchartrand Jan 8, 2026
d77d012
reset spinners after clicking verify-another button
jchartrand Jan 8, 2026
bf53839
add verification from req param
jchartrand Jan 8, 2026
2850cab
build for Pages
jchartrand Jan 8, 2026
df29c74
add named slots for header and prepositional phrases
jchartrand Jan 9, 2026
badcf5f
bundle for Pages deployment
jchartrand Jan 9, 2026
04f722c
remove issuer-registry-client package
jchartrand Jan 9, 2026
9f40dbc
update index.html files with did list template
jchartrand Jan 9, 2026
714e8bd
add local did list
jchartrand Jan 9, 2026
0def916
add test did to local list
jchartrand Jan 9, 2026
b9a6b34
fix query selector on local did list template
jchartrand Jan 9, 2026
456de4c
remove old issuer lookup
jchartrand Jan 9, 2026
0fd9a01
add default did list
jchartrand Jan 9, 2026
9ca5135
update readme with did template instructions
jchartrand Jan 9, 2026
99c89b9
fix default did list
jchartrand Jan 9, 2026
39d5f92
fix issuerName property accessor
jchartrand Jan 9, 2026
a503c08
switch to new issuer lookup
jchartrand Jan 9, 2026
2ffd332
rebuild for Pages deployment
jchartrand Jan 9, 2026
d88bfea
add test did to default list
jchartrand Jan 9, 2026
ef4b01f
update sub labels
jchartrand Jan 9, 2026
279a015
rebuild for Pages
jchartrand Jan 9, 2026
476e6bd
fix missing tag bracket
jchartrand Jan 9, 2026
7d8b998
rebuild for Pages
jchartrand Jan 9, 2026
6a54fb9
fix delay
jchartrand Jan 9, 2026
94ca175
build for Pages deployment
jchartrand Jan 9, 2026
2d5c6aa
add test did to list
jchartrand Jan 9, 2026
46482e3
fix revocation message
jchartrand Jan 9, 2026
a945865
rebuild for Pages
jchartrand Jan 9, 2026
1bb96fb
font styling
jchartrand Jan 12, 2026
b87b397
install marked for criteria markdown display
jchartrand Jan 12, 2026
4a779ae
add dialog sections
jchartrand Jan 12, 2026
57dbec2
add test did to local list
jchartrand Jan 12, 2026
d97f9d6
rework dialog
jchartrand Jan 12, 2026
3cda0d4
build for pages
jchartrand Jan 12, 2026
834bb32
fix scroll on dialog
jchartrand Jan 12, 2026
98c6618
fix markdown styling
jchartrand Jan 12, 2026
b47dd70
reset field display when displaying another credential
jchartrand Jan 12, 2026
d9bc237
fix spinner color on second verification
jchartrand Jan 12, 2026
df004fb
build for Pages
jchartrand Jan 12, 2026
19c89f7
move test credential into tests
jchartrand Jan 13, 2026
e4fea34
format issuance date
jchartrand Jan 13, 2026
d7b6195
extend pause before showing button
jchartrand Jan 13, 2026
ad6cb3c
build for Pages
jchartrand Jan 13, 2026
5757ebd
adjust pauses during verification
jchartrand Jan 13, 2026
066fe0b
fix listeners declaration to allow reassignement
jchartrand Jan 13, 2026
546231e
rename package for npm publish
jchartrand Jan 13, 2026
c07a8d9
export the component class
jchartrand Jan 13, 2026
c2a3379
build for pages
jchartrand Jan 13, 2026
d04e0ff
minor change to comments
jchartrand Jan 13, 2026
b0c34a6
update for npm publish
jchartrand Jan 15, 2026
1eac31d
add public method to set did list
jchartrand Jan 15, 2026
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
79 changes: 3 additions & 76 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

Expand All @@ -41,12 +35,6 @@ build/Release
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

Expand All @@ -62,78 +50,17 @@ web_modules/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

playwright-report/
test-results/
132 changes: 131 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,132 @@
# veri-good
web component for verifying Verifiable Credentials

A [Web Component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) for verifying [Verifiable Credentials](https://www.w3.org/TR/vc-data-model-2.0/).

Web components are custom HTML tags that work natively with all modern browsers, and can therefore be dropped into any HTML page, which you'd do like so for the veri-good element:

```
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>veri-good!</title>
</head>
<body>
<div style="font-size: 20px"></div>
<div style="padding: 5em">
<veri-good></veri-good>
</div>
<script type="module" src="=bundle.js"></script>
</body>
</html>
```

You'll therefore need to have saved that bundle.js (which is in the dist directory of this repository) to your server.

If you are using a bundler (webpack, rollup, etc.) import the module which we've published to npm:

`import '@digitalcredentials/veri-good'`

The import automagically registers the component with the browser. Use the tag wherever you like.

We also provide a separate package that wraps the web component in a react element:

* [@digitalcredentials/veri-good-react github repo](https://github.com/digitalcredentials/veri-good-react)
* [@digitalcredentials/veri-good-react npm package](https://github.com/digitalcredentials/veri-good-react)

TODO: fix above links to react packages once published

### Issuer List

The signing DID for each credential is looked up in the issuer list. For the moment it defaults to the above list, i.e.,

```https://digitalcredentials.github.io/dcc-known-registries/known-did-registries.json```

You can look at that list as an example of how to build your own.

You set the issuer list in a template inside the `veri-good` tag like so:

```
<body>
<veri-good>
<template id="issuer-dids">
{
"did:web:digitalcredentials.github.io:testDID": {
"issuerName": "Department of Chemistry",
"url": "https://chemistry.uni.edu"
},
"did:key:z6MkjoriXdbyWD25YXTed114F8hdJrLXQ567xxPHAUKxpKkS": {
"issuerName": "Department of Economics",
"url": "https://econ.uni.edu"
}
}
</template>
</veri-good>
<script type="module" src="=bundle.js"></script>
</body>
```

Use the same json structure for your own list.

The issuerName and url are displayed when verifying a credential issued by that DID.

### Programmatic Verification

You can programmatically set the VC to be verified by calling the 'verify' method on the element, like so:

```
<body>
<veri-good registry-list="https://digitalcredentials.github.io/dcc-known-registries/known-did-registries.json"></veri-good>
<script type="module" src="=bundle.js"></script>
<script>
const verifier = document.querySelector('veri-good')
verifier.addEventListener('veri-good-is-ready', (e) => {
verifier.verify("https://digitalcredentials.github.io/vc-test-fixtures/verifiableCredentials/v1/bothSignatureTypes/didKey/legacy-noStatus-noExpiry-basicOBv3.json")
});
</script>
</body>
```

Notice that we have to wait for the web component to finish intializing, and fire the 'veri-good-is-ready' event before we can call the 'verify' method on it.

You can of course also (and more likely) directly use the call in your own javascript that you bundle up with webpack or the like.

You might use the 'verify' call for cases like:

* immediately verifying a credential whose url has been passed in as a request parameter on your html page.
* verifying a credential that the end user selects from a list of credentials on the page, like say in a web wallet

### Customization

#### Slots

There are three 'slots' in the web component into which you can place custom html content:

* header
* wasAwarded
* awardedBy

Use them by including your custom content inside the `<veri-good>` tag like so:

```
<veri-good registry-list="https://digitalcredentials.github.io/dcc-known-registries/known-did-registries.json">
<div slot="header">
<div style="margin:.2em">University of Wonderful</div>
<div style="font-size:1.2em">Course Credential Verification</div>
</div>
<div slot="wasAwarded">earned</div>
<div slot="awardedBy">awarded byyyy</div>
</veri-good>
```

The slots map into the verifier like so:

TODO: add image of verifier with slots circled, arrows pointing to each with a label.

You'll of course likely have to play with the css on your slots.

If you don't provide content for the slots, the defaults will be used which look like so:

TODO: add image with default content.


Loading