-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
617 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
const axios = require('axios'); | ||
const fs = require('fs'); | ||
const csv = require('csv-parser'); | ||
|
||
const iana = 'https://www.iana.org/assignments/cose/header-parameters.csv'; | ||
|
||
(async () => { | ||
const response = await axios.get(iana, { | ||
// headers: {Authorization: `Bearer ${token}`, | ||
responseType: 'stream' | ||
}); | ||
const stream = response.data.pipe(csv()); | ||
const IANACOSEHeaderParameters = {} | ||
stream.on('data', row => { | ||
if (row.Reference.startsWith('[RFC')) { | ||
row.Reference = `https://datatracker.ietf.org/doc/${row.Reference.substring(1, row.Reference.length - 1)}` | ||
} | ||
IANACOSEHeaderParameters[row.Label] = row | ||
}); | ||
stream.on('end', () => { | ||
const file = ` | ||
export type IANACOSEHeaderParameter = { | ||
Name: string | ||
Label: string | ||
'Value Type': string | ||
'Value Registry': string | ||
Description: string | ||
Reference: string | ||
} | ||
export const IANACOSEHeaderParameters: Record<string, IANACOSEHeaderParameter> = ${JSON.stringify(IANACOSEHeaderParameters, null, 2)}; | ||
` | ||
fs.writeFileSync('./src/cose/headers.ts', file.trim()) | ||
}); | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<section id="urn:ietf:params:cose:cose-sign1:sha-256:base64url:t-eQXtHHgwyH7hIuhnqwHIiPWpvXa4ZFPtRFo2dZWU8" class="edn-cose-sign1"> | ||
<style> | ||
|
||
.edn-cose-sign1 { font-family: monospace; } | ||
.edn-cose-sign1 * { margin: 0; padding: 0; } | ||
.edn-cose-sign1 dt, dd { display: inline-block; padding-left: 8px; } | ||
.edn-cose-sign1 ol li { | ||
list-style: none; | ||
padding-left: 8px; | ||
} | ||
|
||
</style> | ||
|
||
/ cose-sign1 / 18([ | ||
<ol><li>/ protected / h'a1013822',</li> | ||
<li>/ unprotected / {<dl><dt>/ kid / 4 : </dt><dd>h'50333834'</dd><dl>},</li> | ||
<li>/ payload / h'54686973...656e742e',</li> | ||
<li>/ signature / h'5f150abd...59622a3c'</li></ol> | ||
]) | ||
|
||
|
||
<section> | ||
{<dl><dt>/ alg / 1 : </dt><dd>-35</dd><dl>} | ||
</section> | ||
|
||
|
||
<section> |
Oops, something went wrong.