|
| 1 | +# Add classes for complex metadata attributes |
| 2 | + |
| 3 | +* Status: accepted |
| 4 | +* Date: 2020-11-30 |
| 5 | + |
| 6 | +Technical Story: https://github.com/theupdateframework/tuf/issues/1133 |
| 7 | + |
| 8 | +## Context and Problem Statement |
| 9 | +Custom classes for the TUF signed metadata wrapper (Metadata) and metadata |
| 10 | +payload containers (Root, Timestamp, Snapshot, Targets) were added recently. |
| 11 | +Complex attributes on these classes are still represented as dictionaries. |
| 12 | +Should we add classes for these attributes too? |
| 13 | + |
| 14 | +## Decision Drivers |
| 15 | + |
| 16 | +* Transition to class-based role metadata containers in progress (see *"class |
| 17 | + model"* links below) |
| 18 | +* Harden in-memory representation of metadata model |
| 19 | +* Replace `securesystemslib` schema validation (see *"schema checker"* link |
| 20 | + below) |
| 21 | + |
| 22 | +## Considered Options |
| 23 | + |
| 24 | +* Use custom classes for complex attributes |
| 25 | +* Use dictionaries for complex attributes |
| 26 | + |
| 27 | +## Decision Outcome |
| 28 | + |
| 29 | +Chosen option: "Use custom classes for complex attributes", to provide a |
| 30 | +consistently object-oriented, well-defined, single source of truth about the |
| 31 | +TUF metadata model (not only its containers). In addition to convenience update |
| 32 | +methods, the model may be extended with self-validation behavior (see |
| 33 | +*"validation guidelines"* link below) to replace `securesystemslib` schema |
| 34 | +checks. |
| 35 | + |
| 36 | +### Negative Consequences |
| 37 | + |
| 38 | +* Implementation overhead |
| 39 | +* Less flexibility in usage and development (this is actually desired) |
| 40 | +* Maybe less idiomatic than dictionaries |
| 41 | + |
| 42 | +## Links |
| 43 | + |
| 44 | +* [class model](https://github.com/theupdateframework/tuf/pull/1112) |
| 45 | +* [class model (root)](https://github.com/theupdateframework/tuf/pull/1193) |
| 46 | +* [WIP: class model (complex attributes)](https://github.com/theupdateframework/tuf/pull/1223) |
| 47 | +* [new TUF validation guidelines](https://github.com/theupdateframework/tuf/issues/1130) |
| 48 | +* [securesystemslib schema checker issues](https://github.com/secure-systems-lab/securesystemslib/issues/183) |
0 commit comments