Skip to content
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
6 changes: 2 additions & 4 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ jobs:
- uses: actions/checkout@v3
- uses: w3c/spec-prod@v2
with:
TOOLCHAIN: bikeshed
GH_PAGES_BRANCH: gh-pages
SOURCE: v2/index.bs
DESTINATION: docs/index.html
TOOLCHAIN: respec
GH_PAGES_BRANCH: gh-pages
21 changes: 17 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
node_modules
*.idea/
*.iml
.DS_Store
*.sw[nop]
*~
.DS_Store
.idea/modules.xml
.idea/vc-data-model.iml
.idea/vcs.xml
.idea/workspace.xml
.vscode
.idea
.gitignore

**/node_modules
**/.DS_Store
**/.vscode
**/package-lock.json

out.html
4 changes: 2 additions & 2 deletions .pr-preview.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"src_file": "index.html",
"type": "bikeshed"
}
"type": "respec"
}
2 changes: 1 addition & 1 deletion v2/index.bs → CGFR/2023-04-05/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -871,4 +871,4 @@ Issue: <a href="https://github.com/w3c-ccg/vc-json-schema/issues/106">ISSUE #106
"publisher": "IETF"
}
}
</pre>
</pre>
File renamed without changes.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# W3C Credentials Community Group
# W3C Verifiable Credentials Working Group

Contributions to this repository are intended to become part of
Recommendation-track documents governed by the
Expand Down
10 changes: 7 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
All documents in this Repository are licensed by contributors
under the
[W3C Software and Document License](https://www.w3.org/Consortium/Legal/copyright-software).
All Reports in this Repository are licensed by Contributors under the [W3C Software and Document
License](https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).

Contributions to Specifications are made under the
[W3C CLA](https://www.w3.org/community/about/agreements/cla/).

Contributions to Software, including sample implementations, are under the
[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Building the Draft
Formatted HTML for the draft can be built using bikeshed (see below for instructions for bikeshed installation):
## Verifiable Credential JSON Schema 2022

```bash
$ bikeshed spec v2/index.bs docs/index.html
```

You may also want to use the watch functionality to automatically regenerate as you make changes:
This specification provides a mechanism for the use of [JSON Schemas](https://json-schema.org/) with [Verifiable Credentials](https://w3c.github.io/vc-data-model/). A significant part of the integrity of a Verifiable Credential comes from the ability to structure its contents so that all three parties — issuer, holder, verifier — may have a consistent mechanism of trust in interpreting the data that they are provided with. We introducing a new data model for an object to facilitate backing Credentials with JSON Schemas that we call a Credential Schema.

```bash
$ bikeshed watch v2/index.bs docs/index.html
```
https://w3c.github.io/vc-json-schema/

`./spec/` contains the spec files processed by bikeshed.
We encourage contributions meeting the [Contribution
Guidelines](CONTRIBUTING.md). While we prefer the creation of issues
and Pull Requests in the GitHub repository, discussions often occur
on the
[public-credentials](http://lists.w3.org/Archives/Public/public-credentials/)
mailing list as well.

`./docs/` contains the build files that are hosted on github.
### Building

## Bikeshed Installation and Setup
See the full instructions at https://tabatkins.github.io/bikeshed/#installing.
To build, we use [respec](https://respec.org/).

You will need to have Python 3.7 or later installed. Then, to install Bikeshed itself, run the following:
After installing respec, you can bulid the spec locally using the following command:

```bash
pip3 install bikeshed && bikeshed update
```sh
respec --localhost index.html out.html --verbose -e
```

When that is completed, Bikeshed should be installed, and the `bikeshed` command should work in your shell.
Next open up `out.html` in a web browser and review the document.

### Other useful links
* [Public group email archive](https://lists.w3.org/Archives/Public/public-credentials/)
185 changes: 185 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/* globals omitTerms, respecConfig, $, require */
/* exported linkCrossReferences, restrictReferences, fixIncludes */

var vcwg = {
// Add as the respecConfig localBiblio variable
// Extend or override global respec references
localBiblio: {
"RFC-3339": {
title: "Date and Time on the Internet: Timestamps",
date: "2002",
href: "https://www.rfc-editor.org/rfc/rfc3339",
authors: [
"G. Klyne",
"Clearswift Corporation",
"C. Newman",
"Sun Microsystems"
],
publisher: "Internet Engineering Task Force (IETF)"
},
"VC-DATA-MODEL": {
href: "https://www.w3.org/TR/vc-data-model/",
title: "Verifiable Credentials Data Model 1.0",
publisher: "W3C"
},
"JSON-SCHEMA": {
href: "https://json-schema.org/draft/2020-12/json-schema-core.html",
title: "JSON Schema: A Media Type for Describing JSON Documents",
publisher: "IETF"
},
"JSON-SCHEMA-VALIDATION": {
href: "https://json-schema.org/draft/2020-12/json-schema-validation.html",
title: "JSON Schema Validation: A Vocabulary for Structural Validation of JSON",
publisher: "IETF"
},
"DID-CORE": {
href: "https://w3c.github.io/did-core/",
title: "Decentralized Identifiers (DIDs) v1.0",
publisher: "W3C"
},
"JSON-LD": {
href: "https://w3c.github.io/json-ld-syntax/",
title: "JSON-LD 1.1: A JSON-based Serialization for Linked Data",
publisher: "W3C"
},
"VC-JWT": {
href: "https://www.w3.org/TR/vc-jwt/",
title: "Securing Verifiable Credentials using JSON Web Tokens",
publisher: "W3C"
},
"DATA-INTEGRITY": {
href: "https://w3c-ccg.github.io/data-integrity-spec/",
title: "Data Integrity. Manu Sporny; Dave Longley. Credentials Community Group. CG-DRAFT",
publisher: "W3C"
},
"JOSE": {
href: "https://jose.readthedocs.io/en/latest/",
title: "Javascript Object Signing and Encryption (JOSE)",
publisher: "IETF"
},
"JSON-SCHEMA-IMPLMENTATIONS": {
href: "https://json-schema.org/implementations.html",
title: "JSON Schema Implementations",
publisher: "json-schema-org"
},
"RFC 2119": {
href: "https://www.rfc-editor.org/rfc/rfc2119",
title: "Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. Best Current Practice",
publisher: "IETF"
},
"RFC 8174": {
href: "https://www.rfc-editor.org/rfc/rfc8174",
title: "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba. IETF. May 2017. Best Current Practice",
publisher: "IETF"
}
}
};
require(["core/pubsubhub"], (respecEvents) => {
"use strict";

respecEvents.sub('end-all', (message) => {
console.log("END EVENT", message);
// remove data-cite on where the citation is to ourselves.
const selfDfns = document.querySelectorAll("dfn[data-cite^='" + respecConfig.shortName.toUpperCase() + "#']");
for (const dfn of selfDfns) {
delete dfn.dataset.cite;
}

// Update data-cite references to ourselves.
const selfRefs = document.querySelectorAll("a[data-cite^='" + respecConfig.shortName.toUpperCase() + "#']");
for (const anchor of selfRefs) {
anchor.href= anchor.dataset.cite.replace(/^.*#/,"#");
delete anchor.dataset.cite;
}

});

});

// Removes dfns that aren't referenced anywhere in the spec.
// To ensure a definition appears in the Terminology section, use
// and link to it!
// This is triggered by postProcess in the respec config.
function restrictRefs(config, document) {

// Get set of ids internal dfns referenced in the spec body
const internalDfnLinks = document.querySelectorAll("a.internalDFN");
let internalDfnIds = new Set();
for (const dfnLink of internalDfnLinks) {
const dfnHref = dfnLink.href.split("#")[1];
internalDfnIds.add(dfnHref);
}

// Remove unused dfns from the termlist
const termlist = document.querySelector(".termlist");
const linkIdsInDfns = [];
for (const child of termlist.querySelectorAll("dfn")){
if (!internalDfnIds.has(child.id)){
let dt = child.closest("dt");
let dd = dt.nextElementSibling;

// Get internal links from dfns we're going to remove
// because these show up in the dfn-panels later and then
// trigger the local-refs-exist linter (see below)
const linksInDfn = dd.querySelectorAll("a.internalDFN");
for (link of linksInDfn) {
linkIdsInDfns.push(link.id);
}

termlist.removeChild(dt);
termlist.removeChild(dd);
}
}

// Remove unused dfns from the dfn-panels
// (these are hidden, but still trigger the local-refs-exist linter)
// (this seems like a hack, there's probably a better way to hook into respec
// before it gets to this point)
const dfnPanels = document.querySelectorAll(".dfn-panel");
for (const panel of dfnPanels) {
if (!internalDfnIds.has(panel.querySelector(".self-link").href.split("#")[1])) {
panel.parentNode.removeChild(panel);
}

// Remove references to dfns we removed which link to other dfns
const panelLinks = panel.querySelectorAll("li a");
for (const link of panelLinks) {
if (linkIdsInDfns.includes(link.href.split("#")[1])) {
link.parentNode.removeChild(link);
}
}
}
}

function _esc(s) {
return s.replace(/&/g,'&amp;')
.replace(/>/g,'&gt;')
.replace(/"/g,'&quot;')
.replace(/</g,'&lt;');
}

function reindent(text) {
// TODO: use trimEnd when Edge supports it
const lines = text.trimRight().split("\n");
while (lines.length && !lines[0].trim()) {
lines.shift();
}
const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\s]/));
const leastIndent = Math.min(...indents);
return lines.map(s => s.slice(leastIndent)).join("\n");
}

function updateExample(doc, content) {
// perform transformations to make it render and prettier
return _esc(reindent(unComment(doc, content)));
}

function unComment(doc, content) {
// perform transformations to make it render and prettier
return content
.replace(/<!--/, '')
.replace(/-->/, '')
.replace(/< !\s*-\s*-/g, '<!--')
.replace(/-\s*- >/g, '-->')
.replace(/-\s*-\s*&gt;/g, '--&gt;');
}
Loading