Skip to content

Commit 49eafc2

Browse files
committed
index hosted attestations: Try to model both versions at same time
It's not very pretty but maybe it is now more comprehensive?
1 parent 4f87c8d commit 49eafc2

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

source/specifications/index-hosted-attestations.rst

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ object is provided as pseudocode below.
3939

4040
.. code-block:: python
4141
42+
Attestation = AttestationV1 | AttestationV2
4243
4344
@dataclass
44-
class Attestation:
45-
version: Literal[1, 2]
45+
class AttestationV1:
46+
version: Literal[1]
4647
"""
47-
The attestation object's version. Current version is 2.
48-
49-
version 2 added verification_material.timestamps, in practice allowing the
50-
use of rekor v2 entries in verification_material.transparency_entries.
48+
The attestation object's version.
5149
"""
5250
5351
verification_material: VerificationMaterial
@@ -60,6 +58,23 @@ object is provided as pseudocode below.
6058
The enveloped attestation statement and signature.
6159
"""
6260
61+
@dataclass
62+
class AttestationV2:
63+
version: Literal[2]
64+
"""
65+
The attestation object's version.
66+
"""
67+
68+
verification_material: VerificationMaterialV2
69+
"""
70+
Cryptographic materials used to verify `envelope`.
71+
"""
72+
73+
envelope: Envelope
74+
"""
75+
The enveloped attestation statement and signature.
76+
"""
77+
6378
6479
@dataclass
6580
class Envelope:
@@ -89,13 +104,16 @@ object is provided as pseudocode below.
89104
and certificate.
90105
"""
91106
107+
@dataclass
108+
class VerificationMaterialV2(VerificationMaterial):
92109
timestamps: list[bytes]
93110
"""
94111
List of base64 encoded RFC3161 timestamp responses.
95112
96-
Added in Attestation version 2.
113+
Added in V2. In practice this allows the use of dsse 0.0.2 entries (used in Rekor v2
114+
transparency log) within VerificationMaterialV2.transparency_entries.
97115
98-
Note that list may be empty even for valid attestations: see "Attestation Verification"
116+
Note that list may be empty when dsse 0.0.1 entries are used: see "Attestation Verification"
99117
"""
100118
101119
A full data model for each object in ``transparency_entries`` is provided in
@@ -302,9 +320,9 @@ lies within the signing certificate's validity period: Inclusion time is provide
302320
in one of two ways:
303321

304322
* Attestation V1: Inclusion time is embedded in the entry (``integrated_time``)
305-
* Attestation V2: Inclusion time may embedded in the entry (``integrated_time``) for dsse 0.0.1 entries
323+
* Attestation V2: Inclusion time may embedded in the entry (``integrated_time``) for "dsse 0.0.1" entries
306324
or it may be provided as RFC3161 timestamp(s) in ``verification_material.timestamps`` for
307-
dsse 0.0.2 entries
325+
"dsse 0.0.2" entries
308326

309327
.. _appendix:
310328

0 commit comments

Comments
 (0)