diff --git a/pyproject.toml b/pyproject.toml index cb69c5e..74be3c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,11 +58,11 @@ warn_unused_ignores = true [tool.ruff] line-length = 100 select = ["ALL"] -target-version = "py38" [tool.ruff.per-file-ignores] "sigstore_rekor_types/_internal/*.py" = [ - "A003", # some fields shadow python builtins + "A003", # some fields shadow python builtins + "UP007", # pydantic doesn't support PEP 604 below Python 3.10 ] "test/**/*.py" = [ "D", # no docstrings in tests diff --git a/sigstore_rekor_types/_internal/alpine.py b/sigstore_rekor_types/_internal/alpine.py index 36ad4c7..51ed5cf 100644 --- a/sigstore_rekor_types/_internal/alpine.py +++ b/sigstore_rekor_types/_internal/alpine.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:55+00:00 +# timestamp: 2023-10-04T14:54:07+00:00 from __future__ import annotations diff --git a/sigstore_rekor_types/_internal/cose.py b/sigstore_rekor_types/_internal/cose.py index a117dfd..f48ee66 100644 --- a/sigstore_rekor_types/_internal/cose.py +++ b/sigstore_rekor_types/_internal/cose.py @@ -1,9 +1,10 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:55+00:00 +# timestamp: 2023-10-04T14:54:07+00:00 from __future__ import annotations from enum import Enum +from typing import Optional from pydantic import BaseModel, Field, RootModel, StrictStr @@ -29,24 +30,24 @@ class EnvelopeHash(BaseModel): class Data(BaseModel): - payload_hash: PayloadHash | None = Field( + payload_hash: Optional[PayloadHash] = Field( None, alias="payloadHash", description="Specifies the hash algorithm and value for the content", ) - envelope_hash: EnvelopeHash | None = Field( + envelope_hash: Optional[EnvelopeHash] = Field( None, alias="envelopeHash", description="Specifies the hash algorithm and value for the COSE envelope", ) - aad: str | None = Field( + aad: Optional[str] = Field( None, description="Specifies the additional authenticated data required to verify the signature", ) class CoseV001Schema(BaseModel): - message: str | None = Field(None, description="The COSE Sign1 Message") + message: Optional[str] = Field(None, description="The COSE Sign1 Message") public_key: str = Field( ..., alias="publicKey", diff --git a/sigstore_rekor_types/_internal/dsse.py b/sigstore_rekor_types/_internal/dsse.py index 1de3e2e..3e579e1 100644 --- a/sigstore_rekor_types/_internal/dsse.py +++ b/sigstore_rekor_types/_internal/dsse.py @@ -1,9 +1,10 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:56+00:00 +# timestamp: 2023-10-04T14:54:07+00:00 from __future__ import annotations from enum import Enum +from typing import Optional from pydantic import BaseModel, Field, RootModel, StrictStr @@ -61,8 +62,8 @@ class PayloadHash(BaseModel): class DsseV001Schema(BaseModel): - proposed_content: ProposedContent | None = Field(None, alias="proposedContent") - signatures: list[Signature] | None = Field( + proposed_content: Optional[ProposedContent] = Field(None, alias="proposedContent") + signatures: Optional[list[Signature]] = Field( None, description=( "extracted collection of all signatures of the envelope's payload; elements will be" @@ -70,14 +71,14 @@ class DsseV001Schema(BaseModel): ), min_length=1, ) - envelope_hash: EnvelopeHash | None = Field( + envelope_hash: Optional[EnvelopeHash] = Field( None, alias="envelopeHash", description=( "Specifies the hash algorithm and value encompassing the entire envelope sent to Rekor" ), ) - payload_hash: PayloadHash | None = Field( + payload_hash: Optional[PayloadHash] = Field( None, alias="payloadHash", description=( diff --git a/sigstore_rekor_types/_internal/hashedrekord.py b/sigstore_rekor_types/_internal/hashedrekord.py index 43171c1..346203c 100644 --- a/sigstore_rekor_types/_internal/hashedrekord.py +++ b/sigstore_rekor_types/_internal/hashedrekord.py @@ -1,15 +1,16 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:56+00:00 +# timestamp: 2023-10-04T14:54:08+00:00 from __future__ import annotations from enum import Enum +from typing import Optional from pydantic import BaseModel, Field, RootModel, StrictStr class PublicKey(BaseModel): - content: str | None = Field( + content: Optional[str] = Field( None, description=( "Specifies the content of the public key or code signing certificate inline within the" @@ -19,11 +20,11 @@ class PublicKey(BaseModel): class Signature(BaseModel): - content: str | None = Field( + content: Optional[str] = Field( None, description="Specifies the content of the signature inline within the document", ) - public_key: PublicKey | None = Field( + public_key: Optional[PublicKey] = Field( None, alias="publicKey", description=( @@ -46,7 +47,7 @@ class Hash(BaseModel): class Data(BaseModel): - hash: Hash | None = Field( + hash: Optional[Hash] = Field( None, description="Specifies the hash algorithm and value for the content", ) diff --git a/sigstore_rekor_types/_internal/helm.py b/sigstore_rekor_types/_internal/helm.py index 9f02a7b..6c0515e 100644 --- a/sigstore_rekor_types/_internal/helm.py +++ b/sigstore_rekor_types/_internal/helm.py @@ -1,9 +1,10 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:56+00:00 +# timestamp: 2023-10-04T14:54:08+00:00 from __future__ import annotations from enum import Enum +from typing import Optional from pydantic import BaseModel, Field, RootModel, StrictStr @@ -28,7 +29,7 @@ class Hash(BaseModel): class Chart(BaseModel): - hash: Hash | None = Field( + hash: Optional[Hash] = Field( None, description="Specifies the hash algorithm and value for the chart", ) diff --git a/sigstore_rekor_types/_internal/intoto.py b/sigstore_rekor_types/_internal/intoto.py index 5b0d139..bd2380b 100644 --- a/sigstore_rekor_types/_internal/intoto.py +++ b/sigstore_rekor_types/_internal/intoto.py @@ -1,10 +1,10 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:56+00:00 +# timestamp: 2023-10-04T14:54:08+00:00 from __future__ import annotations from enum import Enum -from typing import Union +from typing import Optional, Union from pydantic import BaseModel, Field, RootModel, StrictStr @@ -30,15 +30,15 @@ class PayloadHash(BaseModel): class Content(BaseModel): - envelope: StrictStr | None = Field(None, description="envelope") - hash: Hash | None = Field( + envelope: Optional[StrictStr] = Field(None, description="envelope") + hash: Optional[Hash] = Field( None, description=( "Specifies the hash algorithm and value encompassing the entire signed envelope; this" " is computed by the rekor server, client-provided values are ignored" ), ) - payload_hash: PayloadHash | None = Field( + payload_hash: Optional[PayloadHash] = Field( None, alias="payloadHash", description=( @@ -58,7 +58,7 @@ class IntotoV001Schema(BaseModel): class Signature(BaseModel): - keyid: StrictStr | None = Field( + keyid: Optional[StrictStr] = Field( None, description="optional id of the key used to create the signature", ) @@ -71,7 +71,7 @@ class Signature(BaseModel): class Envelope(BaseModel): - payload: str | None = Field(None, description="payload of the envelope") + payload: Optional[str] = Field(None, description="payload of the envelope") payload_type: StrictStr = Field( ..., alias="payloadType", @@ -102,13 +102,13 @@ class PayloadHash1(BaseModel): class Content1(BaseModel): envelope: Envelope = Field(..., description="dsse envelope") - hash: Hash1 | None = Field( + hash: Optional[Hash1] = Field( None, description=( "Specifies the hash algorithm and value encompassing the entire signed envelope" ), ) - payload_hash: PayloadHash1 | None = Field( + payload_hash: Optional[PayloadHash1] = Field( None, alias="payloadHash", description=( @@ -122,7 +122,7 @@ class IntotoV002Schema(BaseModel): class IntotoSchema(RootModel[Union[IntotoV001Schema, IntotoV002Schema]]): - root: IntotoV001Schema | IntotoV002Schema = Field( + root: Union[IntotoV001Schema, IntotoV002Schema] = Field( ..., description="Intoto for Rekord objects", title="Intoto Schema", diff --git a/sigstore_rekor_types/_internal/jar.py b/sigstore_rekor_types/_internal/jar.py index 2fd4a7f..e1864ca 100644 --- a/sigstore_rekor_types/_internal/jar.py +++ b/sigstore_rekor_types/_internal/jar.py @@ -1,8 +1,10 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:57+00:00 +# timestamp: 2023-10-04T14:54:08+00:00 from __future__ import annotations +from typing import Optional + from pydantic import BaseModel, Field, RootModel @@ -32,7 +34,7 @@ class Signature(BaseModel): class JarV001Schema(BaseModel): - signature: Signature | None = Field( + signature: Optional[Signature] = Field( None, description="Information about the included signature in the JAR file", ) diff --git a/sigstore_rekor_types/_internal/rekord.py b/sigstore_rekor_types/_internal/rekord.py index 0f72e0a..8151201 100644 --- a/sigstore_rekor_types/_internal/rekord.py +++ b/sigstore_rekor_types/_internal/rekord.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:57+00:00 +# timestamp: 2023-10-04T14:54:09+00:00 from __future__ import annotations diff --git a/sigstore_rekor_types/_internal/rfc3161.py b/sigstore_rekor_types/_internal/rfc3161.py index b745ea5..d1fa546 100644 --- a/sigstore_rekor_types/_internal/rfc3161.py +++ b/sigstore_rekor_types/_internal/rfc3161.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:57+00:00 +# timestamp: 2023-10-04T14:54:09+00:00 from __future__ import annotations diff --git a/sigstore_rekor_types/_internal/rpm.py b/sigstore_rekor_types/_internal/rpm.py index 903ddb9..1c342d0 100644 --- a/sigstore_rekor_types/_internal/rpm.py +++ b/sigstore_rekor_types/_internal/rpm.py @@ -1,5 +1,5 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:57+00:00 +# timestamp: 2023-10-04T14:54:09+00:00 from __future__ import annotations diff --git a/sigstore_rekor_types/_internal/tuf.py b/sigstore_rekor_types/_internal/tuf.py index 157b595..112a1e5 100644 --- a/sigstore_rekor_types/_internal/tuf.py +++ b/sigstore_rekor_types/_internal/tuf.py @@ -1,9 +1,9 @@ # generated by datamodel-codegen: -# timestamp: 2023-10-03T20:01:58+00:00 +# timestamp: 2023-10-04T14:54:10+00:00 from __future__ import annotations -from typing import Any +from typing import Any, Optional from pydantic import BaseModel, Field, RootModel, StrictStr @@ -23,7 +23,7 @@ class Root(BaseModel): class TufV001Schema(BaseModel): - spec_version: StrictStr | None = Field(None, description="TUF specification version") + spec_version: Optional[StrictStr] = Field(None, description="TUF specification version") metadata: Metadata = Field(..., description="TUF metadata") root: Root = Field( ...,