Skip to content

Commit d3cd0cd

Browse files
author
lukpueh
authored
Merge pull request #1229 from lukpueh/adr0004
ADR0004: Justify extent of OOP in metadata model
2 parents 2a376ae + 229e9df commit d3cd0cd

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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)

docs/adr/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This log lists the architectural decisions for tuf.
88
- [ADR-0001](0001-python-version-3-6-plus.md) - Default to Python 3.6 or newer for new development
99
- [ADR-0002](0002-pre-1-0-deprecation-strategy.md) - Deprecation strategy
1010
- [ADR-0003](0003-where-to-develop-TUF-1-0-0.md) - Develop TUF 1.0.0 in a subdirectory of the current TUF implementation
11+
- [ADR-0004](0004-extent-of-OOP-in-metadata-model.md) - Add classes for complex metadata attributes
1112

1213
<!-- adrlogstop -->
1314

0 commit comments

Comments
 (0)