theupdateframework / theupdateframework/python-tuf
Snapshot and Timestamp default content
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.7k
- Forks
- 304
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
Snapshot and Timestamp constructors try to be clever:
self.meta = meta if meta is not None else {"targets.json": MetaFile(1)}
and
self.snapshot_meta = snapshot_meta or MetaFile(1)
So they set the metafile content without knowing what it really should be
this is annoying as Repository.snapshot() and Repository.timestamp() now think a snapshot and timestamp are not needed -- even though none have been generated yet.
I can work around this but especially for snapshot the default value seems wrong: empty dict would be more correct -- the meta dict should be filled by a conscious decision not by a default value that might be right.
For timestamp there might not be a correct value though. I think MetaFile(0) would be best (although it requires loosening the check for valid MetaFiles): it's at least clear that timestamp doesn't have a snapshot version yet
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Konstruktoren von Snapshot und Timestamp sowie die Methoden Repository.snapshot() und Repository.timestamp() zu lesen, um zu verstehen, wie sich ihre Standardmetadaten auf die Generierungsprüfungen auswirken. Vergleiche die vorgeschlagenen Standardwerte empty-dict und MetaFile(0) mit den bestehenden Gültigkeitsregeln für MetaFile; die Aufgabe ist abgeschlossen, wenn neu erstellte Objekte nicht fälschlicherweise anzeigen, dass Snapshot- oder Timestamp-Metadaten generiert wurden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- security
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100