question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rewriting the workflow to call out to sub-sections

See original GitHub issue

The TUF spec is written in a prose form, especially the update workflow. One of the challenges with this that we have duplicated paragraphs that describe essentially the same thing. For example:

2.1. Check signatures. The new timestamp metadata file must have been signed by a threshold of keys specified in the trusted root metadata file. If the new timestamp metadata file is not properly signed, discard it, abort the update cycle, and report the signature failure. … 3.2. Check signatures. The new snapshot metadata file MUST have been signed by a threshold of keys specified in the trusted root metadata file. If the new snapshot metadata file is not signed as required, discard it, abort the update cycle, and report the signature failure. … 4.2. Check for an arbitrary software attack. The new targets metadata file MUST have been signed by a threshold of keys specified in the trusted root metadata file. If the new targets metadata file is not signed as required, discard it, abort the update cycle, and report the failure.

Note each section has a slight change from each other, which happens as small corrections happen in one, but we forget to fix it in the others. Instead, I think it’s worth considering restructuring the workflow (and possibly the rest of the doc) to be more in the style of the whatwg specs (such as https://url.spec.whatwg.org/), where we call out to sub-sections to implement these major steps. For example, parsing the signatures could be written as:

2.1 Check the signatures.

  1. Let sig_result be the result of check signatures with metadata being the new timestamp metadata, role being timestamp, and root being the trusted root metadata.
  2. If sig_result is failure, then return failure. …

Check signatures:

The signature checker takes a metadata metadata, and a role type role, and a root metadata.

  1. Canonicalize the metadata as canonical_metadata_bytes.
  2. For each signature sig in the metadata`'s signature field:
    1. If sig is in a processed_sig set, skip the signature.
    2. If it signed canonical_metadata_bytes. Increment a threshold counter.
  3. If threshold counter is less than role’s threshold in the root metadata, return failure.

I think this sort of thing would really be helpful in making sure we don’t make subtle copy-paste errors when changing the spec, and make it much easier on a client library to implement the spec correctly.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
joshuaglcommented, Nov 27, 2020

bs looks good, thanks for identifying it as a potential solution and starting to PoC converting the spec @erickt !

I’d like to help with this effort. Ideally we would get #118 and #122 merged first, then make a concerted effort to port the specification to bikeshed. How does that sound?

1reaction
lukpuehcommented, Sep 30, 2020

➕ from my side. On a mildly related note, I wonder if there are any good cross-referencing plugins for GitHub markdown. Manually updating section numbers and references is really tedious.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Workflows | Chapter 6 - Digital Rhetoric Collaborative
By mapping their workflows, writers can make space for metacognition, and they can examine and emphasize how mediated practices work within—and change across— ......
Read more >
The Ultimate Workflow for Writers Obsessed with Quality
A seven-step workflow for writing, to ensure quality every time (plus the essential tools and software you need to make it happen)
Read more >
Writing a Script Workflow | Microsoft Learn
Begin by enumerating the tasks that the workflow will perform. Mark the sections that can run concurrently or do not need to run...
Read more >
Using Workflows to Orchestrate Jobs - CircleCI
A workflow is a set of rules for defining a collection of jobs and their run order. Workflows support complex job orchestration using...
Read more >
Lyonizing Word: Workflow for Writing | An American Editor
I've tried nearly every writing program out there, and the best solution I've found is ... and the boxes could be sections of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found