diff --git a/specs.json b/specs.json index b42293d1..49c88d4e 100644 --- a/specs.json +++ b/specs.json @@ -6,6 +6,103 @@ } }, "https://console.spec.whatwg.org/", + { + "url": "https://datatracker.ietf.org/doc/html/rfc6265", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc6265.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc6454", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc6454.xml" + }, + "groups": [ + { + "name": "Web Security Working Group", + "url": "https://datatracker.ietf.org/group/websec/" + } + ] + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7230", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7230.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7231", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7231.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7232", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7232.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7233", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7233.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7234", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7234.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7235", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7235.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7239", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7239.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7469", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7469.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7538", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7538.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc7540", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc7540.xml" + } + }, + { + "url": "https://datatracker.ietf.org/doc/html/rfc8470", + "nightly": { + "repository": "https://github.com/httpwg/httpwg.github.io", + "sourcePath": "specs/rfc8470.xml" + } + }, "https://dom.spec.whatwg.org/", "https://drafts.css-houdini.org/css-typed-om-2/ delta", "https://drafts.css-houdini.org/font-metrics-api-1/", diff --git a/src/build-index.js b/src/build-index.js index a61caa6b..a1c776e5 100644 --- a/src/build-index.js +++ b/src/build-index.js @@ -2,8 +2,9 @@ * Script that compiles and returns the final list of specs from the * "specs.json" input file. * - * The script will extract the W3C API key it needs from a "config.json" file - * in the root folder, which must exist and contain a "w3cApiKey" key. + * The script will extract the W3C API key and the github token it needs + * from a "config.json" file in the root folder + * which must exist and contain "w3cApiKey" and "githubToken" keys. */ const fs = require("fs").promises; diff --git a/src/compute-shortname.js b/src/compute-shortname.js index 358ea8dd..11a69fe7 100644 --- a/src/compute-shortname.js +++ b/src/compute-shortname.js @@ -96,6 +96,12 @@ function computeShortname(url) { return "svg-" + svg[1]; } + // Handle IETF RFCs + const rfcs = url.match(/\/datatracker\.ietf\.org\/doc\/html\/(rfc[0-9]+)/); + if (rfcs) { + return rfcs[1]; + } + // Return name when one was given if (!url.match(/\//)) { return url; diff --git a/src/fetch-groups.js b/src/fetch-groups.js index 96ef21b1..059950fc 100644 --- a/src/fetch-groups.js +++ b/src/fetch-groups.js @@ -50,6 +50,29 @@ module.exports = async function (specs, options) { for (const spec of specs) { const info = parseSpecUrl(spec.url); if (!info) { + // No general rule to identify repos and groups for IETF specs + // instead, fetching info on groups from https://www.rfc-editor.org/in-notes/rfcXXX.json + if (spec.url.match(/ietf\.org/)) { + spec.organization = spec.organization ?? "IETF"; + if (spec.groups) continue; + const rfcNumber = spec.url.slice(spec.url.lastIndexOf('/') + 1); + const rfcJSON = await fetchJSON(`https://www.rfc-editor.org/in-notes/${rfcNumber}.json`); + const wgName = rfcJSON.source; + // draft-ietf-websec-origin-06 → websec + // per https://www.ietf.org/standards/ids/guidelines/#7 + // not clear there is anything forbidding hyphens in WG acronyms though + // https://datatracker.ietf.org/doc/html/rfc2418#section-2.2 + const wgId = rfcJSON.draft.split('-')[2]; + if (wgName && wgId) { + spec.groups = [{ + name: `${wgName} Working Group`, + url: `https://datatracker.ietf.org/wg/${wgId}/` + }]; + continue; + } else { + throw new Error(`Could not identify IETF group producing ${spec.url}`); + } + } throw new Error(`Cannot extract any useful info from ${spec.url}`); } @@ -153,4 +176,4 @@ module.exports = async function (specs, options) { } return specs; -}; \ No newline at end of file +};