Skip to content

Commit

Permalink
Fix lints (#245)
Browse files Browse the repository at this point in the history
* html fixes

* update cdn

* one more

* remove fors

* point to latest

* update

* update plugin to use h2

* update plugin
  • Loading branch information
decentralgabe authored Feb 26, 2024
1 parent 5bbe9f2 commit f766903
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 34 deletions.
10 changes: 3 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html lang="en">

<head>
<meta charset="utf-8" />
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<title>Securing Verifiable Credentials using JOSE and COSE</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="https://cdn.jsdelivr.net/gh/w3c/vc-jose-cose@206aac2e84847fa8f5c9601e11974e26ace4f9ac/plugin/dist/main.js"></script>
<script type="text/javascript" class="remove">
<script src="https://cdn.jsdelivr.net/gh/w3c/vc-jose-cose@f2ecf4f7004dcd9524727a27f7671577c2e28cf4/plugin/dist/main.js"></script>
<script class="remove">
// See https://github.com/w3c/respec/wiki/ for how to configure
// ReSpec
var respecConfig = {
Expand Down Expand Up @@ -667,7 +667,6 @@ <h2>COSE Header Parameters and CWT Claims</h2>
Additional members may be present as header parameters and claims.
If they are not understood, they MUST be ignored.
</p>
</section>
</section>

<section id="key_discovery" class="normative">
Expand Down Expand Up @@ -1738,7 +1737,6 @@ <h2>Privacy Considerations</h2>
</p>
</li>
</ul>
</p>
<p>
These considerations are not exhaustive, and implementers and
users are advised to consult additional privacy resources and
Expand Down Expand Up @@ -2097,8 +2095,6 @@ <h2>
</p>
</section>
</section>
</section>

<section>
<h2>Verification Algorithm</h2>
<p>
Expand Down
10 changes: 5 additions & 5 deletions plugin/dist/main.js

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions plugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
company: "Transmute", companyURL: "http://transmute.industries/"
}
],
authors:
[
{
name: "Orie Steele", url: "https://www.linkedin.com/in/or13b/",
company: "Transmute", companyURL: "http://transmute.industries/"
}
],
authors: [
{
name: "Orie Steele", url: "https://www.linkedin.com/in/or13b/",
company: "Transmute", companyURL: "http://transmute.industries/"
}
],
maxTocLevel: 2,
inlineCSS: true,
postProcess: [
Expand Down
2 changes: 1 addition & 1 deletion plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function addVcJoseStyles() {
margin: 0 0;
}
.vc-jose-cose-tabbed h1, .vc-jose-cose-jwt-tabbed h1, .vc-jose-cose-sd-jwt-tabbed h1, .vc-jose-cose-cose-tabbed h1 {
.vc-jose-cose-tabbed h2, .vc-jose-cose-jwt-tabbed h2, .vc-jose-cose-sd-jwt-tabbed h2, .vc-jose-cose-cose-tabbed h2 {
font-size: 1em;
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/exampleCose.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export const getCoseExample = async (privateKey, messageJson) => {
const messageHex = buf2hex(message)
const messageDiag = await cose.cbor.diagnose(message)
return `
<h1>${messageType.replace('+cose', '')}</h1>
<h2>${messageType.replace('+cose', '')}</h2>
<pre>
${JSON.stringify(messageJson, null, 2)}
</pre>
<h1>application/cbor-diagnostic</h1>
<h2>application/cbor-diagnostic</h2>
<div class="cose-text">
${messageDiag.trim()}
</div>
<h1>${messageType} (detached payload)</h1>
<h2>${messageType} (detached payload)</h2>
<div class="cose-text">
${messageHex}
</div>
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/exampleJwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ export const getJwtExample = async (privateKey, messageJson) => {
const messageEncoded = new TextDecoder().decode(message)
// const decodedHeader = jose.decodeProtectedHeader(messageEncoded)
// Not displaying protected header to save space
// <h1>Protected</h1>
// <h2>Protected</h2>
// <pre>
// ${JSON.stringify(decodedHeader, null, 2)}
// </pre>
return `
<h1>${messageType.replace('+jwt', '')}</h1>
<h2>${messageType.replace('+jwt', '')}</h2>
<pre>
${JSON.stringify(messageJson, null, 2)}
</pre>
<h1>${messageType}</h1>
<h2>${messageType}</h2>
<div class="jose-text">
${getJwtHtml(messageEncoded)}
</div>
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/exampleSdJwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ export const getSdJwtExample = async (privateKey, messageJson) => {

// const decodedHeader = jose.decodeProtectedHeader(messageEncoded.split('~')[0])
// Not displaying protected header to save space
// <h1>Protected</h1>
// <h2>Protected</h2>
// <pre>
// ${JSON.stringify(decodedHeader, null, 2)}
// </pre>
return `
<h1>${messageType2}</h1>
<h2>${messageType2}</h2>
<div>
${getDisclosabilityHtml(issuerClaims)}
</div>
<h1>${messageType}</h1>
<h2>${messageType}</h2>
<div class="jose-text">
${getSdHtml(messageEncoded)}
</div>
Expand Down
10 changes: 5 additions & 5 deletions plugin/src/getHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const getCombinedHtml = ({ index, coseExample, jwtExample, sdJwtExample }
return `
<div class="vc-jose-cose-tabbed">
<input type="radio" id="vc-jose-cose-tab-${index}-cose" name="vc-jose-cose-tabs-${index}" checked="checked">
<input type="radio" id="vc-jose-cose-tab-${index}-jwt" name="vc-jose-cose-tabs-${index}" >
<input type="radio" id="vc-jose-cose-tab-${index}-sd-jwt" name="vc-jose-cose-tabs-${index}" >
<input type="radio" id="vc-jose-cose-tab-${index}-jwt" name="vc-jose-cose-tabs-${index}">
<input type="radio" id="vc-jose-cose-tab-${index}-sd-jwt" name="vc-jose-cose-tabs-${index}">
<ul class="vc-jose-cose-tabs">
<li class="vc-jose-cose-tab">
<label for="vc-jose-cose-tab-${index}-cose">COSE</label>
Expand Down Expand Up @@ -34,7 +34,7 @@ export const getJwtHtml = ({ index, jwtExample })=>{
<div class="vc-jose-cose-jwt-tabbed">
<ul class="vc-jose-cose-jwt-tabs">
<li class="vc-jose-cose-jwt-tab">
<label for="vc-jose-cose-jwt-tab-${index}-jwt">JWT</label>
<label>JWT</label>
</li>
</ul>
<div class="vc-jose-cose-jwt-tab-content">
Expand All @@ -48,7 +48,7 @@ export const getSdJwtHtml = ({ index, sdJwtExample })=>{
<div class="vc-jose-cose-sd-jwt-tabbed">
<ul class="vc-jose-cose-sd-jwt-tabs">
<li class="vc-jose-cose-sd-jwt-tab">
<label for="vc-jose-cose-sd-jwt-tab-${index}-sd-jwt">SD-JWT</label>
<label>SD-JWT</label>
</li>
</ul>
<div class="vc-jose-cose-sd-jwt-tab-content">
Expand All @@ -62,7 +62,7 @@ export const getCoseHtml = ({ index, coseExample })=>{
<div class="vc-jose-cose-cose-tabbed">
<ul class="vc-jose-cose-cose-tabs">
<li class="vc-jose-cose-cose-tab">
<label for="vc-jose-cose-cose-tab-${index}-cose">COSE</label>
<label>COSE</label>
</li>
</ul>
<div class="vc-jose-cose-cose-tab-content">
Expand Down

0 comments on commit f766903

Please sign in to comment.