Skip to content

Add clarification on unknown key-value pairs in file format #163

Closed

Description

@jku

Spec says:

All of the formats described below include the ability to add more attribute-value fields for backwards-compatible format changes.

This does not make it very clear

  • that anyone de/serializing the format needs to be able to cope with undefined key-value pairs in various places in the file format: those key-value pairs are part of the data for the purposes of calculating hashes or signatures and MUST then be preserved if data is re-serialized
  • where those key-value pairs can appear

My own understanding of the last point is that they can appear in every "object-like" dictionary at or below signed, meaning every dictionary in the format except ["hashes", "keys", "meta", "roles", "targets"].

Activity

  1. asraa commented on Jun 3, 2021

    @asraa
    Contributor

    Nice! I have a use case for unknown key-values that @trishankatdatadog linked this issue to.

    I completely agree that these key-value pairs must be preserved by an implementation so that hash/signature calculations can be consistent.

    As far as where they can appear: my personal use case is key-values that may appear as auxiliary information in the KEYVAL dictionary (https://theupdateframework.github.io/specification/latest/#keyval). My linked PR adds a custom dictionary to this to append additional public key information (a certificate attesting to the public key).

  2. trishankatdatadog commented on Jun 3, 2021

    @trishankatdatadog
    Contributor

    Thanks, Asra! I think the next step is to add some text to the spec to clarify how to preserve and yet ignore these superset fields...

  3. asraa commented on Jun 8, 2021

    @asraa
    Contributor

    Would it suffice to have it be similar to CUSTOM in targets (opaque to implementation, as a json object) and submit a PR in this repo with the change?

  4. trishankatdatadog commented on Jun 8, 2021

    @trishankatdatadog
    Contributor

    I don't think we even need to mention any specific field 🙂 We can add CUSTOM and your field as examples, but the important thing is to advise implementations what to do when seeing these added/superset fields. Makes sense?

  5. linked a pull request that will close this issueAdd guidance about unknown fields #169on Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions