@@ -12,7 +12,7 @@ class ProposedEntry(BaseModel):
12
12
kind : StrictStr
13
13
14
14
15
- class Format (Enum ):
15
+ class Format (str , Enum ):
16
16
"""Specifies the format of the signature."""
17
17
18
18
PGP = "pgp"
@@ -58,7 +58,7 @@ class PublicKey1(BaseModel):
58
58
"""The public key that can verify the signature; this can also be an X509 code signing certificate that contains the raw public key information."""
59
59
60
60
content : Optional [str ] = Field (
61
- None ,
61
+ default = None ,
62
62
description = (
63
63
"Specifies the content of the public key or code signing certificate inline within the"
64
64
" document"
@@ -70,11 +70,11 @@ class Signature1(BaseModel):
70
70
"""Information about the detached signature associated with the entry."""
71
71
72
72
content : Optional [str ] = Field (
73
- None ,
73
+ default = None ,
74
74
description = "Specifies the content of the signature inline within the document" ,
75
75
)
76
76
public_key : Optional [PublicKey1 ] = Field (
77
- None ,
77
+ default = None ,
78
78
alias = "publicKey" ,
79
79
description = (
80
80
"The public key that can verify the signature; this can also be an X509 code signing"
@@ -83,7 +83,7 @@ class Signature1(BaseModel):
83
83
)
84
84
85
85
86
- class Algorithm (Enum ):
86
+ class Algorithm (str , Enum ):
87
87
"""The hashing function used to compute the hash value."""
88
88
89
89
SHA256 = "sha256"
@@ -103,7 +103,7 @@ class Data(BaseModel):
103
103
"""Information about the content associated with the entry."""
104
104
105
105
hash : Optional [Hash ] = Field (
106
- None ,
106
+ default = None ,
107
107
description = "Specifies the hash algorithm and value for the content" ,
108
108
)
109
109
@@ -158,7 +158,7 @@ class Root(BaseModel):
158
158
class TufV001Schema (BaseModel ):
159
159
"""Schema for TUF metadata entries."""
160
160
161
- spec_version : Optional [StrictStr ] = Field (None , description = "TUF specification version" )
161
+ spec_version : Optional [StrictStr ] = Field (default = None , description = "TUF specification version" )
162
162
metadata : Metadata = Field (..., description = "TUF metadata" )
163
163
root : Root = Field (
164
164
...,
@@ -199,7 +199,7 @@ class Chart(BaseModel):
199
199
"""Information about the Helm chart associated with the entry."""
200
200
201
201
hash : Optional [Hash1 ] = Field (
202
- None ,
202
+ default = None ,
203
203
description = "Specifies the hash algorithm and value for the chart" ,
204
204
)
205
205
@@ -239,16 +239,16 @@ class PayloadHash(BaseModel):
239
239
240
240
241
241
class Content (BaseModel ):
242
- envelope : Optional [StrictStr ] = Field (None , description = "envelope" )
242
+ envelope : Optional [StrictStr ] = Field (default = None , description = "envelope" )
243
243
hash : Optional [Hash2 ] = Field (
244
- None ,
244
+ default = None ,
245
245
description = (
246
246
"Specifies the hash algorithm and value encompassing the entire signed envelope; this"
247
247
" is computed by the rekor server, client-provided values are ignored"
248
248
),
249
249
)
250
250
payload_hash : Optional [PayloadHash ] = Field (
251
- None ,
251
+ default = None ,
252
252
alias = "payloadHash" ,
253
253
description = (
254
254
"Specifies the hash algorithm and value covering the payload within the DSSE envelope;"
@@ -272,7 +272,7 @@ class Signature2(BaseModel):
272
272
"""a signature of the envelope's payload along with the public key for the signature."""
273
273
274
274
keyid : Optional [StrictStr ] = Field (
275
- None ,
275
+ default = None ,
276
276
description = "optional id of the key used to create the signature" ,
277
277
)
278
278
sig : str = Field (..., description = "signature of the payload" )
@@ -286,7 +286,7 @@ class Signature2(BaseModel):
286
286
class Envelope (BaseModel ):
287
287
"""dsse envelope."""
288
288
289
- payload : Optional [str ] = Field (None , description = "payload of the envelope" )
289
+ payload : Optional [str ] = Field (default = None , description = "payload of the envelope" )
290
290
payload_type : StrictStr = Field (
291
291
...,
292
292
alias = "payloadType" ,
@@ -322,13 +322,13 @@ class PayloadHash1(BaseModel):
322
322
class Content1 (BaseModel ):
323
323
envelope : Envelope = Field (..., description = "dsse envelope" )
324
324
hash : Optional [Hash3 ] = Field (
325
- None ,
325
+ default = None ,
326
326
description = (
327
327
"Specifies the hash algorithm and value encompassing the entire signed envelope"
328
328
),
329
329
)
330
330
payload_hash : Optional [PayloadHash1 ] = Field (
331
- None ,
331
+ default = None ,
332
332
alias = "payloadHash" ,
333
333
description = (
334
334
"Specifies the hash algorithm and value covering the payload within the DSSE envelope"
@@ -342,15 +342,9 @@ class IntotoV002Schema(BaseModel):
342
342
content : Content1
343
343
344
344
345
- class PayloadHash2 (BaseModel ):
345
+ class PayloadHash2 (Hash ):
346
346
"""Specifies the hash algorithm and value for the content."""
347
347
348
- algorithm : Algorithm = Field (
349
- ...,
350
- description = "The hashing function used to compute the hash value" ,
351
- )
352
- value : StrictStr = Field (..., description = "The hash value for the content" )
353
-
354
348
355
349
class EnvelopeHash (BaseModel ):
356
350
"""Specifies the hash algorithm and value for the COSE envelope."""
@@ -366,25 +360,25 @@ class Data1(BaseModel):
366
360
"""Information about the content associated with the entry."""
367
361
368
362
payload_hash : Optional [PayloadHash2 ] = Field (
369
- None ,
363
+ default = None ,
370
364
alias = "payloadHash" ,
371
365
description = "Specifies the hash algorithm and value for the content" ,
372
366
)
373
367
envelope_hash : Optional [EnvelopeHash ] = Field (
374
- None ,
368
+ default = None ,
375
369
alias = "envelopeHash" ,
376
370
description = "Specifies the hash algorithm and value for the COSE envelope" ,
377
371
)
378
372
aad : Optional [str ] = Field (
379
- None ,
373
+ default = None ,
380
374
description = "Specifies the additional authenticated data required to verify the signature" ,
381
375
)
382
376
383
377
384
378
class CoseV001Schema (BaseModel ):
385
379
"""Schema for cose object."""
386
380
387
- message : Optional [str ] = Field (None , description = "The COSE Sign1 Message" )
381
+ message : Optional [str ] = Field (default = None , description = "The COSE Sign1 Message" )
388
382
public_key : str = Field (
389
383
...,
390
384
alias = "publicKey" ,
@@ -426,7 +420,7 @@ class JarV001Schema(BaseModel):
426
420
"""Schema for JAR entries."""
427
421
428
422
signature : Optional [Signature3 ] = Field (
429
- None ,
423
+ default = None ,
430
424
description = "Information about the included signature in the JAR file" ,
431
425
)
432
426
@@ -503,24 +497,24 @@ class PayloadHash3(BaseModel):
503
497
class DsseV001Schema (BaseModel ):
504
498
"""Schema for DSSE envelopes."""
505
499
506
- proposed_content : Optional [ProposedContent ] = Field (None , alias = "proposedContent" )
500
+ proposed_content : Optional [ProposedContent ] = Field (default = None , alias = "proposedContent" )
507
501
signatures : Optional [List [Signature4 ]] = Field (
508
- None ,
502
+ default = None ,
509
503
description = (
510
504
"extracted collection of all signatures of the envelope's payload; elements will be"
511
505
" sorted by lexicographical order of the base64 encoded signature strings"
512
506
),
513
507
min_length = 1 ,
514
508
)
515
509
envelope_hash : Optional [EnvelopeHash1 ] = Field (
516
- None ,
510
+ default = None ,
517
511
alias = "envelopeHash" ,
518
512
description = (
519
513
"Specifies the hash algorithm and value encompassing the entire envelope sent to Rekor"
520
514
),
521
515
)
522
516
payload_hash : Optional [PayloadHash3 ] = Field (
523
- None ,
517
+ default = None ,
524
518
alias = "payloadHash" ,
525
519
description = (
526
520
"Specifies the hash algorithm and value covering the payload within the DSSE envelope"
@@ -532,7 +526,7 @@ class Attestation(BaseModel):
532
526
data : Optional [Dict [str , Any ]] = None
533
527
534
528
535
- class Format1 (Enum ):
529
+ class Format1 (str , Enum ):
536
530
PGP = "pgp"
537
531
X509 = "x509"
538
532
MINISIGN = "minisign"
@@ -543,20 +537,20 @@ class Format1(Enum):
543
537
class PublicKey6 (BaseModel ):
544
538
format : Format1
545
539
content : Optional [str ] = Field (
546
- None ,
540
+ default = None ,
547
541
pattern = "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" ,
548
542
)
549
543
url : Optional [AnyUrl ] = None
550
544
551
545
552
- class Operator (Enum ):
546
+ class Operator (str , Enum ):
553
547
AND_ = "and"
554
548
OR_ = "or"
555
549
556
550
557
551
class SearchIndex (BaseModel ):
558
552
email : Optional [EmailStr ] = None
559
- public_key : Optional [PublicKey6 ] = Field (None , alias = "publicKey" )
553
+ public_key : Optional [PublicKey6 ] = Field (default = None , alias = "publicKey" )
560
554
hash : Optional [StrictStr ] = None
561
555
operator : Optional [Operator ] = None
562
556
@@ -571,18 +565,18 @@ class LogIndex(RootModel[StrictInt]):
571
565
572
566
class SearchLogQuery (BaseModel ):
573
567
entry_uui_ds : Optional [List [EntryUuiD ]] = Field (
574
- None ,
568
+ default = None ,
575
569
alias = "entryUUIDs" ,
576
570
max_length = 10 ,
577
571
min_length = 1 ,
578
572
)
579
573
log_indexes : Optional [List [LogIndex ]] = Field (
580
- None ,
574
+ default = None ,
581
575
alias = "logIndexes" ,
582
576
max_length = 10 ,
583
577
min_length = 1 ,
584
578
)
585
- entries : Optional [List [ProposedEntry ]] = Field (None , max_length = 10 , min_length = 1 )
579
+ entries : Optional [List [ProposedEntry ]] = Field (default = None , max_length = 10 , min_length = 1 )
586
580
587
581
588
582
class InactiveShardLogInfo (BaseModel ):
@@ -730,9 +724,9 @@ class DsseSchema(RootModel[DsseV001Schema]):
730
724
731
725
732
726
class Verification (BaseModel ):
733
- inclusion_proof : Optional [InclusionProof ] = Field (None , alias = "inclusionProof" )
727
+ inclusion_proof : Optional [InclusionProof ] = Field (default = None , alias = "inclusionProof" )
734
728
signed_entry_timestamp : Optional [str ] = Field (
735
- None ,
729
+ default = None ,
736
730
alias = "signedEntryTimestamp" ,
737
731
description = "Signature over the logID, logIndex, body and integratedTime." ,
738
732
pattern = "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" ,
@@ -780,7 +774,10 @@ class LogInfo(BaseModel):
780
774
description = "The current signed tree head" ,
781
775
)
782
776
tree_id : StrictStr = Field (..., alias = "treeID" , description = "The current treeID" )
783
- inactive_shards : Optional [List [InactiveShardLogInfo ]] = Field (None , alias = "inactiveShards" )
777
+ inactive_shards : Optional [List [InactiveShardLogInfo ]] = Field (
778
+ default = None ,
779
+ alias = "inactiveShards" ,
780
+ )
784
781
785
782
786
783
class Rekord (ProposedEntry ):
0 commit comments