From df43a3b8bfca8a7620c672fd06d4599591522f5c Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Wed, 2 Aug 2023 10:09:29 -0400 Subject: [PATCH 1/7] codegen: init schemafy includes the modules structure definitions needed have full package prefixes, like ```rust use sigstore_protobuf_specs::dev::sigstore::verification::v1::Input ``` Signed-off-by: Jack Leightcap --- gen/pb-rust/Cargo.lock | 226 +- gen/pb-rust/Cargo.toml | 8 +- gen/pb-rust/codegen/Cargo.lock | 278 -- gen/pb-rust/codegen/Cargo.toml | 12 - gen/pb-rust/codegen/src/main.rs | 25 - gen/pb-rust/schema/Artifact.schema.json | 35 + .../ArtifactVerificationOptions.schema.json | 332 ++ gen/pb-rust/schema/Bundle.schema.json | 381 +++ .../schema/CertificateAuthority.schema.json | 98 + .../schema/CertificateIdentities.schema.json | 123 + .../schema/CertificateIdentity.schema.json | 109 + gen/pb-rust/schema/Checkpoint.schema.json | 17 + gen/pb-rust/schema/CloudEvent.schema.json | 146 + .../schema/CloudEventBatch.schema.json | 161 + .../schema/DistinguishedName.schema.json | 19 + gen/pb-rust/schema/Envelope.schema.json | 49 + gen/pb-rust/schema/HashOutput.schema.json | 38 + .../schema/InclusionPromise.schema.json | 19 + gen/pb-rust/schema/InclusionProof.schema.json | 53 + gen/pb-rust/schema/Input.schema.json | 893 +++++ gen/pb-rust/schema/KindVersion.schema.json | 22 + gen/pb-rust/schema/LogId.schema.json | 20 + .../schema/MessageSignature.schema.json | 57 + .../schema/ObjectIdentifier.schema.json | 20 + .../ObjectIdentifierValuePair.schema.json | 37 + gen/pb-rust/schema/PublicKey.schema.json | 89 + .../schema/PublicKeyIdentifier.schema.json | 18 + .../schema/PublicKeyIdentities.schema.json | 103 + .../schema/RFC3161SignedTimestamp.schema.json | 20 + gen/pb-rust/schema/Signature.schema.json | 23 + .../schema/SubjectAlternativeName.schema.json | 54 + gen/pb-rust/schema/TimeRange.schema.json | 29 + .../TimestampVerificationData.schema.json | 36 + .../schema/TransparencyLogEntry.schema.json | 138 + .../TransparencyLogInstance.schema.json | 143 + gen/pb-rust/schema/TrustedRoot.schema.json | 256 ++ .../schema/VerificationMaterial.schema.json | 250 ++ .../schema/X509Certificate.schema.json | 19 + .../schema/X509CertificateChain.schema.json | 35 + gen/pb-rust/src/envelope.rs | 497 --- gen/pb-rust/src/events.rs | 1341 -------- gen/pb-rust/src/lib.rs | 14 + gen/pb-rust/src/mod.rs | 9 - gen/pb-rust/src/sigstore_bundle.rs | 998 ------ gen/pb-rust/src/sigstore_common.rs | 2919 ----------------- gen/pb-rust/src/sigstore_rekor.rs | 1367 -------- gen/pb-rust/src/sigstore_trustroot.rs | 1050 ------ gen/pb-rust/src/sigstore_verification.rs | 2501 -------------- 48 files changed, 4081 insertions(+), 11006 deletions(-) delete mode 100644 gen/pb-rust/codegen/Cargo.lock delete mode 100644 gen/pb-rust/codegen/Cargo.toml delete mode 100644 gen/pb-rust/codegen/src/main.rs create mode 100644 gen/pb-rust/schema/Artifact.schema.json create mode 100644 gen/pb-rust/schema/ArtifactVerificationOptions.schema.json create mode 100644 gen/pb-rust/schema/Bundle.schema.json create mode 100644 gen/pb-rust/schema/CertificateAuthority.schema.json create mode 100644 gen/pb-rust/schema/CertificateIdentities.schema.json create mode 100644 gen/pb-rust/schema/CertificateIdentity.schema.json create mode 100644 gen/pb-rust/schema/Checkpoint.schema.json create mode 100644 gen/pb-rust/schema/CloudEvent.schema.json create mode 100644 gen/pb-rust/schema/CloudEventBatch.schema.json create mode 100644 gen/pb-rust/schema/DistinguishedName.schema.json create mode 100644 gen/pb-rust/schema/Envelope.schema.json create mode 100644 gen/pb-rust/schema/HashOutput.schema.json create mode 100644 gen/pb-rust/schema/InclusionPromise.schema.json create mode 100644 gen/pb-rust/schema/InclusionProof.schema.json create mode 100644 gen/pb-rust/schema/Input.schema.json create mode 100644 gen/pb-rust/schema/KindVersion.schema.json create mode 100644 gen/pb-rust/schema/LogId.schema.json create mode 100644 gen/pb-rust/schema/MessageSignature.schema.json create mode 100644 gen/pb-rust/schema/ObjectIdentifier.schema.json create mode 100644 gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json create mode 100644 gen/pb-rust/schema/PublicKey.schema.json create mode 100644 gen/pb-rust/schema/PublicKeyIdentifier.schema.json create mode 100644 gen/pb-rust/schema/PublicKeyIdentities.schema.json create mode 100644 gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json create mode 100644 gen/pb-rust/schema/Signature.schema.json create mode 100644 gen/pb-rust/schema/SubjectAlternativeName.schema.json create mode 100644 gen/pb-rust/schema/TimeRange.schema.json create mode 100644 gen/pb-rust/schema/TimestampVerificationData.schema.json create mode 100644 gen/pb-rust/schema/TransparencyLogEntry.schema.json create mode 100644 gen/pb-rust/schema/TransparencyLogInstance.schema.json create mode 100644 gen/pb-rust/schema/TrustedRoot.schema.json create mode 100644 gen/pb-rust/schema/VerificationMaterial.schema.json create mode 100644 gen/pb-rust/schema/X509Certificate.schema.json create mode 100644 gen/pb-rust/schema/X509CertificateChain.schema.json delete mode 100644 gen/pb-rust/src/envelope.rs delete mode 100644 gen/pb-rust/src/events.rs create mode 100644 gen/pb-rust/src/lib.rs delete mode 100644 gen/pb-rust/src/mod.rs delete mode 100644 gen/pb-rust/src/sigstore_bundle.rs delete mode 100644 gen/pb-rust/src/sigstore_common.rs delete mode 100644 gen/pb-rust/src/sigstore_rekor.rs delete mode 100644 gen/pb-rust/src/sigstore_trustroot.rs delete mode 100644 gen/pb-rust/src/sigstore_verification.rs diff --git a/gen/pb-rust/Cargo.lock b/gen/pb-rust/Cargo.lock index 5d73a352..859ba368 100644 --- a/gen/pb-rust/Cargo.lock +++ b/gen/pb-rust/Cargo.lock @@ -3,14 +3,230 @@ version = 3 [[package]] -name = "protobuf" -version = "2.28.0" +name = "Inflector" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schemafy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9725c16a64e85972fcb3630677be83fef699a1cd8e4bfbdcf3b3c6675f838a19" +dependencies = [ + "Inflector", + "schemafy_core", + "schemafy_lib", + "serde", + "serde_derive", + "serde_json", + "serde_repr", + "syn 1.0.109", +] + +[[package]] +name = "schemafy_core" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bec29dddcfe60f92f3c0d422707b8b56473983ef0481df8d5236ed3ab8fdf24" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "schemafy_lib" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3d87f1df246a9b7e2bfd1f4ee5f88e48b11ef9cfc62e63f0dead255b1a6f5f" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "schemafy_core", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "uriparse", +] + +[[package]] +name = "serde" +version = "1.0.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] [[package]] name = "sigstore_protobuf_specs" -version = "0.1.0-rc.0" +version = "0.1.0-rc.1" +dependencies = [ + "schemafy", + "schemafy_core", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" dependencies = [ - "protobuf", + "fnv", + "lazy_static", ] diff --git a/gen/pb-rust/Cargo.toml b/gen/pb-rust/Cargo.toml index 4d22f7fc..01ab073e 100644 --- a/gen/pb-rust/Cargo.toml +++ b/gen/pb-rust/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["sigstore"] categories = ["encoding", "parser-implementations"] [dependencies] -protobuf = "2.28" - -[lib] -path = "src/mod.rs" +schemafy = "0.6" +schemafy_core = "0.6" +serde = "1.0" +serde_json = "1.0" \ No newline at end of file diff --git a/gen/pb-rust/codegen/Cargo.lock b/gen/pb-rust/codegen/Cargo.lock deleted file mode 100644 index 07c08a70..00000000 --- a/gen/pb-rust/codegen/Cargo.lock +++ /dev/null @@ -1,278 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - -[[package]] -name = "protobuf-codegen" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" -dependencies = [ - "protobuf", -] - -[[package]] -name = "protoc" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" -dependencies = [ - "log", - "which", -] - -[[package]] -name = "protoc-rust" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838" -dependencies = [ - "protobuf", - "protobuf-codegen", - "protoc", - "tempfile", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - -[[package]] -name = "rustix" -version = "0.37.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "sigstore_protobuf_specs_codegen" -version = "0.1.0" -dependencies = [ - "glob", - "protoc-rust", -] - -[[package]] -name = "tempfile" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" -dependencies = [ - "autocfg", - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys", -] - -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/gen/pb-rust/codegen/Cargo.toml b/gen/pb-rust/codegen/Cargo.toml deleted file mode 100644 index 6f238b31..00000000 --- a/gen/pb-rust/codegen/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "sigstore_protobuf_specs_codegen" -version = "0.1.0" -authors = ["Sigstore Authors "] -edition = "2021" -description = "Rust AOT codegen for sigstore protobuf-specs" -readme = "../README.md" -license-file = "../LICENSE" - -[dependencies] -protoc-rust = "2.28" -glob = "0.3" diff --git a/gen/pb-rust/codegen/src/main.rs b/gen/pb-rust/codegen/src/main.rs deleted file mode 100644 index becbfb60..00000000 --- a/gen/pb-rust/codegen/src/main.rs +++ /dev/null @@ -1,25 +0,0 @@ -use glob::glob; -extern crate protoc_rust; - -fn main() { - protoc_rust::Codegen::new() - .includes([ - concat!(env!("CARGO_MANIFEST_DIR"), "/../../../protos"), - "/opt/include", - ]) - .inputs( - glob(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../../protos/*.proto" - )) - .expect("invalid protobuf inputs!") - .flatten(), - ) - .out_dir("../src") - .customize(protoc_rust::Customize { - gen_mod_rs: Some(true), - ..Default::default() - }) - .run() - .expect("Running protoc failed."); -} diff --git a/gen/pb-rust/schema/Artifact.schema.json b/gen/pb-rust/schema/Artifact.schema.json new file mode 100644 index 00000000..23f6cbab --- /dev/null +++ b/gen/pb-rust/schema/Artifact.schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Artifact", + "definitions": { + "Artifact": { + "properties": { + "artifact_uri": { + "type": "string", + "description": "Location of the artifact" + }, + "artifact": { + "type": "string", + "description": "The raw bytes of the artifact", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "artifact_uri" + ] + }, + { + "required": [ + "artifact" + ] + } + ], + "title": "Artifact" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/ArtifactVerificationOptions.schema.json b/gen/pb-rust/schema/ArtifactVerificationOptions.schema.json new file mode 100644 index 00000000..46dc0ba1 --- /dev/null +++ b/gen/pb-rust/schema/ArtifactVerificationOptions.schema.json @@ -0,0 +1,332 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/ArtifactVerificationOptions", + "definitions": { + "ArtifactVerificationOptions": { + "properties": { + "certificate_identities": { + "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentities", + "additionalProperties": false + }, + "public_keys": { + "$ref": "#/definitions/dev.sigstore.verification.v1.PublicKeyIdentities", + "additionalProperties": false, + "description": "To simplify verification implementation, the logic for bundle verification should be implemented as a higher-order function, where one of argument should be an interface over the set of trusted public keys, like this: `Verify(bytes artifact, bytes signature, string key_id)`. This way the caller is in full control of mapping the identified (or hinted) key in the bundle to one of the trusted keys, as this process is inherently application specific." + }, + "tlog_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions", + "additionalProperties": false, + "description": "Optional options for artifact transparency log verification. If none is provided, the default verification options are: Threshold: 1 Online verification: false Disable: false" + }, + "ctlog_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions", + "additionalProperties": false, + "description": "Optional options for certificate transparency log verification. If none is provided, the default verification options are: Threshold: 1 Detached SCT: false Disable: false" + }, + "tsa_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions", + "additionalProperties": false, + "description": "Optional options for certificate signed timestamp verification. If none is provided, the default verification options are: Threshold: 1 Disable: false" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "certificate_identities" + ] + }, + { + "required": [ + "public_keys" + ] + }, + { + "required": [ + "tlog_options" + ] + }, + { + "required": [ + "ctlog_options" + ] + }, + { + "required": [ + "tsa_options" + ] + } + ], + "title": "Artifact Verification Options", + "description": "A light-weight set of options/policies for identifying trusted signers, used during verification of a single artifact." + }, + "dev.sigstore.common.v1.ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + }, + "dev.sigstore.common.v1.ObjectIdentifierValuePair": { + "properties": { + "oid": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifier", + "additionalProperties": false + }, + "value": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier Value Pair", + "description": "An OID and the corresponding (byte) value." + }, + "dev.sigstore.common.v1.PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.SubjectAlternativeName": { + "properties": { + "type": { + "enum": [ + "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", + 0, + "EMAIL", + 1, + "URI", + 2, + "OTHER_NAME", + 3 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Subject Alternative Name Type" + }, + "regexp": { + "type": "string", + "description": "A regular expression describing the expected value for the SAN." + }, + "value": { + "type": "string", + "description": "The exact value to match against." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "regexp" + ] + }, + { + "required": [ + "value" + ] + } + ], + "title": "Subject Alternative Name" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "The number of ct transparency logs the certificate must appear on." + }, + "detached_sct": { + "type": "boolean", + "description": "Expect detached SCTs. This is not supported right now as we can't capture an detached SCT in the bundle." + }, + "disable": { + "type": "boolean", + "description": "Disable ct transparency log verification" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Ctlog Options" + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "The number of signed timestamps that are expected." + }, + "disable": { + "type": "boolean", + "description": "Disable signed timestamp verification." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Timestamp Authority Options" + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "Number of transparency logs the entry must appear on." + }, + "perform_online_verification": { + "type": "boolean", + "description": "Perform an online inclusion proof." + }, + "disable": { + "type": "boolean", + "description": "Disable verification for transparency logs." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Tlog Options" + }, + "dev.sigstore.verification.v1.CertificateIdentities": { + "properties": { + "identities": { + "items": { + "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentity" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identities" + }, + "dev.sigstore.verification.v1.CertificateIdentity": { + "properties": { + "issuer": { + "type": "string", + "description": "The X.509v3 issuer extension (OID 1.3.6.1.4.1.57264.1.1)" + }, + "san": { + "$ref": "#/definitions/dev.sigstore.common.v1.SubjectAlternativeName", + "additionalProperties": false + }, + "oids": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifierValuePair" + }, + "additionalProperties": false, + "type": "array", + "description": "An unordered list of OIDs that must be verified. All OID/values provided in this list MUST exactly match against the values in the certificate for verification to be successful." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identity", + "description": "The identity of a X.509 Certificate signer." + }, + "dev.sigstore.verification.v1.PublicKeyIdentities": { + "properties": { + "public_keys": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identities" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/Bundle.schema.json b/gen/pb-rust/schema/Bundle.schema.json new file mode 100644 index 00000000..ce779b80 --- /dev/null +++ b/gen/pb-rust/schema/Bundle.schema.json @@ -0,0 +1,381 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Bundle", + "definitions": { + "Bundle": { + "properties": { + "media_type": { + "type": "string", + "description": "MUST be application/vnd.dev.sigstore.bundle+json;version=0.1 or application/vnd.dev.sigstore.bundle+json;version=0.2 when encoded as JSON." + }, + "verification_material": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.VerificationMaterial", + "additionalProperties": false, + "description": "When a signer is identified by a X.509 certificate, a verifier MUST verify that the signature was computed at the time the certificate was valid as described in the Sigstore client spec: \"Verification using a Bundle\". \u003chttps://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln\u003e" + }, + "message_signature": { + "$ref": "#/definitions/dev.sigstore.common.v1.MessageSignature", + "additionalProperties": false + }, + "dsse_envelope": { + "$ref": "#/definitions/io.intoto.Envelope", + "additionalProperties": false, + "description": "A DSSE envelope can contain arbitrary payloads. Verifiers must verify that the payload type is a supported and expected type. This is part of the DSSE protocol which is defined here: \u003chttps://github.com/secure-systems-lab/dsse/blob/master/protocol.md\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "message_signature" + ] + }, + { + "required": [ + "dsse_envelope" + ] + } + ], + "title": "Bundle" + }, + "dev.sigstore.bundle.v1.TimestampVerificationData": { + "properties": { + "rfc3161_timestamps": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" + }, + "additionalProperties": false, + "type": "array", + "description": "A list of RFC3161 signed timestamps provided by the user. This can be used when the entry has not been stored on a transparency log, or in conjunction for a stronger trust model. Clients MUST verify the hashed message in the message imprint against the signature in the bundle." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Notes on versioning.\n The primary message ('Bundle') MUST be versioned, by populating the\n 'media_type' field. Semver-ish (only major/minor versions) scheme MUST\n be used. The current version as specified by this file is:\n application/vnd.dev.sigstore.bundle+json;version=0.2\n The semantic version is thus '0.2'.", + "description": "Notes on versioning. The primary message ('Bundle') MUST be versioned, by populating the 'media_type' field. Semver-ish (only major/minor versions) scheme MUST be used. The current version as specified by this file is: application/vnd.dev.sigstore.bundle+json;version=0.2 The semantic version is thus '0.2'. Various timestamped counter signatures over the artifacts signature. Currently only RFC3161 signatures are provided. More formats may be added in the future." + }, + "dev.sigstore.bundle.v1.VerificationMaterial": { + "properties": { + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", + "additionalProperties": false + }, + "x509_certificate_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false + }, + "tlog_entries": { + "items": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" + }, + "additionalProperties": false, + "type": "array", + "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." + }, + "timestamp_verification_data": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", + "additionalProperties": false, + "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "public_key" + ] + }, + { + "required": [ + "x509_certificate_chain" + ] + } + ], + "title": "Verification Material", + "description": "VerificationMaterial captures details on the materials used to verify signatures." + }, + "dev.sigstore.common.v1.HashOutput": { + "properties": { + "algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "digest": { + "type": "string", + "description": "This is the raw octets of the message digest as computed by the hash algorithm.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Hash Output", + "description": "HashOutput captures a digest of a 'message' (generic octet sequence) and the corresponding hash algorithm used." + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.common.v1.MessageSignature": { + "properties": { + "message_digest": { + "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", + "additionalProperties": false, + "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." + }, + "signature": { + "type": "string", + "description": "The raw bytes as returned from the signature algorithm. The signature algorithm (and so the format of the signature bytes) are determined by the contents of the 'verification_material', either a key-pair or a certificate. If using a certificate, the certificate contains the required information on the signature algorithm. When using a key pair, the algorithm MUST be part of the public key, which MUST be communicated out-of-band.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Message Signature", + "description": "MessageSignature stores the computed signature over a message." + }, + "dev.sigstore.common.v1.PublicKeyIdentifier": { + "properties": { + "hint": { + "type": "string", + "description": "Optional unauthenticated hint on which key to use. The format of the hint must be agreed upon out of band by the signer and the verifiers, and so is not subject to this specification. Example use-case is to specify the public key to use, from a trusted key-ring. Implementors are RECOMMENDED to derive the value from the public key as described in RFC 6962. See: \u003chttps://www.rfc-editor.org/rfc/rfc6962#section-3.2\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identifier", + "description": "PublicKeyIdentifier can be used to identify an (out of band) delivered key, to verify a signature." + }, + "dev.sigstore.common.v1.RFC3161SignedTimestamp": { + "properties": { + "signed_timestamp": { + "type": "string", + "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "RFC 3161 Signed Timestamp", + "description": "This message holds a RFC 3161 timestamp." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + }, + "dev.sigstore.common.v1.X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + }, + "dev.sigstore.rekor.v1.Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + }, + "dev.sigstore.rekor.v1.InclusionPromise": { + "properties": { + "signed_entry_timestamp": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Promise", + "description": "The inclusion promise is calculated by Rekor. It's calculated as a signature over a canonical JSON serialization of the persisted entry, the log ID, log index and the integration timestamp. See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54 The format of the signature depends on the transparency log's public key. If the signature algorithm requires a hash function and/or a signature scheme (e.g. RSA) those has to be retrieved out-of-band from the log's operators, together with the public key. This is used to verify the integration timestamp's value and that the log has promised to include the entry." + }, + "dev.sigstore.rekor.v1.InclusionProof": { + "properties": { + "log_index": { + "type": "string", + "description": "The index of the entry in the tree it was written to." + }, + "root_hash": { + "type": "string", + "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", + "format": "binary", + "binaryEncoding": "base64" + }, + "tree_size": { + "type": "string", + "description": "The size of the merkle tree at the time the proof was generated." + }, + "hashes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of hashes required to compute the inclusion proof, sorted in order from leaf to root. Note that leaf and root hashes are not included. The root hash is available separately in this message, and the leaf hash should be calculated by the client.", + "format": "binary", + "binaryEncoding": "base64" + }, + "checkpoint": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.Checkpoint", + "additionalProperties": false, + "description": "Signature of the tree head, as of the time of this proof was generated. See above info on 'Checkpoint' for more details." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Proof", + "description": "InclusionProof is the proof returned from the transparency log. Can be used for offline or online verification against the log." + }, + "dev.sigstore.rekor.v1.KindVersion": { + "properties": { + "kind": { + "type": "string", + "description": "Kind is the type of entry being stored in the log. See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types" + }, + "version": { + "type": "string", + "description": "The specific api version of the type." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Kind Version", + "description": "KindVersion contains the entry's kind and api version." + }, + "dev.sigstore.rekor.v1.TransparencyLogEntry": { + "properties": { + "log_index": { + "type": "string", + "description": "The global index of the entry, used when querying the log by index." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier of the log." + }, + "kind_version": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", + "additionalProperties": false, + "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." + }, + "integrated_time": { + "type": "string", + "description": "The UNIX timestamp from the log when the entry was persisted." + }, + "inclusion_promise": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", + "additionalProperties": false, + "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." + }, + "inclusion_proof": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", + "additionalProperties": false, + "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." + }, + "canonicalized_body": { + "type": "string", + "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Entry", + "description": "TransparencyLogEntry captures all the details required from Rekor to reconstruct an entry, given that the payload is provided via other means. This type can easily be created from the existing response from Rekor. Future iterations could rely on Rekor returning the minimal set of attributes (excluding the payload) that are required for verifying the inclusion promise. The inclusion promise (called SignedEntryTimestamp in the response from Rekor) is similar to a Signed Certificate Timestamp as described here https://www.rfc-editor.org/rfc/rfc6962.html#section-3.2." + }, + "io.intoto.Envelope": { + "properties": { + "payload": { + "type": "string", + "description": "Message to be signed. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "payloadType": { + "type": "string", + "description": "String unambiguously identifying how to interpret payload. REQUIRED." + }, + "signatures": { + "items": { + "$ref": "#/definitions/io.intoto.Signature" + }, + "additionalProperties": false, + "type": "array", + "description": "Signature over: PAE(type, payload) Where PAE is defined as: PAE(type, payload) = \"DSSEv1\" + SP + LEN(type) + SP + type + SP + LEN(payload) + SP + payload + = concatenation SP = ASCII space [0x20] \"DSSEv1\" = ASCII [0x44, 0x53, 0x53, 0x45, 0x76, 0x31] LEN(s) = ASCII decimal encoding of the byte length of s, with no leading zeros REQUIRED (length \u003e= 1)." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Envelope", + "description": "An authenticated message of arbitrary type." + }, + "io.intoto.Signature": { + "properties": { + "sig": { + "type": "string", + "description": "Signature itself. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "keyid": { + "type": "string", + "description": "*Unauthenticated* hint identifying which public key was used. OPTIONAL." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Signature" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/CertificateAuthority.schema.json b/gen/pb-rust/schema/CertificateAuthority.schema.json new file mode 100644 index 00000000..4c6fece0 --- /dev/null +++ b/gen/pb-rust/schema/CertificateAuthority.schema.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/CertificateAuthority", + "definitions": { + "CertificateAuthority": { + "properties": { + "subject": { + "$ref": "#/definitions/dev.sigstore.common.v1.DistinguishedName", + "additionalProperties": false, + "description": "The root certificate MUST be self-signed, and so the subject and issuer are the same." + }, + "uri": { + "type": "string", + "description": "The URI at which the CA can be accessed." + }, + "cert_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false, + "description": "The certificate chain for this CA." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Authority", + "description": "CertificateAuthority enlists the information required to identify which CA to use and perform signature verification." + }, + "dev.sigstore.common.v1.DistinguishedName": { + "properties": { + "organization": { + "type": "string" + }, + "common_name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Distinguished Name" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + }, + "dev.sigstore.common.v1.X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/CertificateIdentities.schema.json b/gen/pb-rust/schema/CertificateIdentities.schema.json new file mode 100644 index 00000000..b00d284a --- /dev/null +++ b/gen/pb-rust/schema/CertificateIdentities.schema.json @@ -0,0 +1,123 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/CertificateIdentities", + "definitions": { + "CertificateIdentities": { + "properties": { + "identities": { + "items": { + "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentity" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identities" + }, + "dev.sigstore.common.v1.ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + }, + "dev.sigstore.common.v1.ObjectIdentifierValuePair": { + "properties": { + "oid": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifier", + "additionalProperties": false + }, + "value": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier Value Pair", + "description": "An OID and the corresponding (byte) value." + }, + "dev.sigstore.common.v1.SubjectAlternativeName": { + "properties": { + "type": { + "enum": [ + "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", + 0, + "EMAIL", + 1, + "URI", + 2, + "OTHER_NAME", + 3 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Subject Alternative Name Type" + }, + "regexp": { + "type": "string", + "description": "A regular expression describing the expected value for the SAN." + }, + "value": { + "type": "string", + "description": "The exact value to match against." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "regexp" + ] + }, + { + "required": [ + "value" + ] + } + ], + "title": "Subject Alternative Name" + }, + "dev.sigstore.verification.v1.CertificateIdentity": { + "properties": { + "issuer": { + "type": "string", + "description": "The X.509v3 issuer extension (OID 1.3.6.1.4.1.57264.1.1)" + }, + "san": { + "$ref": "#/definitions/dev.sigstore.common.v1.SubjectAlternativeName", + "additionalProperties": false + }, + "oids": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifierValuePair" + }, + "additionalProperties": false, + "type": "array", + "description": "An unordered list of OIDs that must be verified. All OID/values provided in this list MUST exactly match against the values in the certificate for verification to be successful." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identity", + "description": "The identity of a X.509 Certificate signer." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/CertificateIdentity.schema.json b/gen/pb-rust/schema/CertificateIdentity.schema.json new file mode 100644 index 00000000..117f4852 --- /dev/null +++ b/gen/pb-rust/schema/CertificateIdentity.schema.json @@ -0,0 +1,109 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/CertificateIdentity", + "definitions": { + "CertificateIdentity": { + "properties": { + "issuer": { + "type": "string", + "description": "The X.509v3 issuer extension (OID 1.3.6.1.4.1.57264.1.1)" + }, + "san": { + "$ref": "#/definitions/dev.sigstore.common.v1.SubjectAlternativeName", + "additionalProperties": false + }, + "oids": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifierValuePair" + }, + "additionalProperties": false, + "type": "array", + "description": "An unordered list of OIDs that must be verified. All OID/values provided in this list MUST exactly match against the values in the certificate for verification to be successful." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identity", + "description": "The identity of a X.509 Certificate signer." + }, + "dev.sigstore.common.v1.ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + }, + "dev.sigstore.common.v1.ObjectIdentifierValuePair": { + "properties": { + "oid": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifier", + "additionalProperties": false + }, + "value": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier Value Pair", + "description": "An OID and the corresponding (byte) value." + }, + "dev.sigstore.common.v1.SubjectAlternativeName": { + "properties": { + "type": { + "enum": [ + "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", + 0, + "EMAIL", + 1, + "URI", + 2, + "OTHER_NAME", + 3 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Subject Alternative Name Type" + }, + "regexp": { + "type": "string", + "description": "A regular expression describing the expected value for the SAN." + }, + "value": { + "type": "string", + "description": "The exact value to match against." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "regexp" + ] + }, + { + "required": [ + "value" + ] + } + ], + "title": "Subject Alternative Name" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/Checkpoint.schema.json b/gen/pb-rust/schema/Checkpoint.schema.json new file mode 100644 index 00000000..e2180700 --- /dev/null +++ b/gen/pb-rust/schema/Checkpoint.schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Checkpoint", + "definitions": { + "Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/CloudEvent.schema.json b/gen/pb-rust/schema/CloudEvent.schema.json new file mode 100644 index 00000000..85bd429c --- /dev/null +++ b/gen/pb-rust/schema/CloudEvent.schema.json @@ -0,0 +1,146 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/CloudEvent", + "definitions": { + "CloudEvent": { + "properties": { + "id": { + "type": "string", + "title": "-- CloudEvent Context Attributes", + "description": "-- CloudEvent Context Attributes Required Attributes" + }, + "source": { + "type": "string", + "description": "URI-reference" + }, + "spec_version": { + "type": "string" + }, + "type": { + "type": "string" + }, + "attributes": { + "additionalProperties": { + "$ref": "#/definitions/dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue", + "additionalProperties": false + }, + "type": "object", + "description": "Optional \u0026 Extension Attributes" + }, + "binary_data": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + }, + "text_data": { + "type": "string" + }, + "proto_data": { + "properties": { + "type_url": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." + }, + "value": { + "type": "string", + "description": "Must be a valid serialized protocol buffer of the above specified type.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "binary_data" + ] + }, + { + "required": [ + "text_data" + ] + }, + { + "required": [ + "proto_data" + ] + } + ], + "title": "Cloud Event" + }, + "dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue": { + "properties": { + "ce_boolean": { + "type": "boolean" + }, + "ce_integer": { + "type": "integer" + }, + "ce_string": { + "type": "string" + }, + "ce_bytes": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + }, + "ce_uri": { + "type": "string" + }, + "ce_uri_ref": { + "type": "string" + }, + "ce_timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "ce_boolean" + ] + }, + { + "required": [ + "ce_integer" + ] + }, + { + "required": [ + "ce_string" + ] + }, + { + "required": [ + "ce_bytes" + ] + }, + { + "required": [ + "ce_uri" + ] + }, + { + "required": [ + "ce_uri_ref" + ] + }, + { + "required": [ + "ce_timestamp" + ] + } + ], + "title": "*\n The CloudEvent specification defines\n seven attribute value types...", + "description": "* The CloudEvent specification defines seven attribute value types..." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/CloudEventBatch.schema.json b/gen/pb-rust/schema/CloudEventBatch.schema.json new file mode 100644 index 00000000..d2dfb2ef --- /dev/null +++ b/gen/pb-rust/schema/CloudEventBatch.schema.json @@ -0,0 +1,161 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/CloudEventBatch", + "definitions": { + "CloudEventBatch": { + "properties": { + "events": { + "items": { + "$ref": "#/definitions/dev.sigstore.events.v1.CloudEvent" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "*\n CloudEvent Protobuf Batch Format", + "description": "* CloudEvent Protobuf Batch Format" + }, + "dev.sigstore.events.v1.CloudEvent": { + "properties": { + "id": { + "type": "string", + "title": "-- CloudEvent Context Attributes", + "description": "-- CloudEvent Context Attributes Required Attributes" + }, + "source": { + "type": "string", + "description": "URI-reference" + }, + "spec_version": { + "type": "string" + }, + "type": { + "type": "string" + }, + "attributes": { + "additionalProperties": { + "$ref": "#/definitions/dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue", + "additionalProperties": false + }, + "type": "object", + "description": "Optional \u0026 Extension Attributes" + }, + "binary_data": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + }, + "text_data": { + "type": "string" + }, + "proto_data": { + "properties": { + "type_url": { + "type": "string", + "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." + }, + "value": { + "type": "string", + "description": "Must be a valid serialized protocol buffer of the above specified type.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "binary_data" + ] + }, + { + "required": [ + "text_data" + ] + }, + { + "required": [ + "proto_data" + ] + } + ], + "title": "Cloud Event" + }, + "dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue": { + "properties": { + "ce_boolean": { + "type": "boolean" + }, + "ce_integer": { + "type": "integer" + }, + "ce_string": { + "type": "string" + }, + "ce_bytes": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + }, + "ce_uri": { + "type": "string" + }, + "ce_uri_ref": { + "type": "string" + }, + "ce_timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "ce_boolean" + ] + }, + { + "required": [ + "ce_integer" + ] + }, + { + "required": [ + "ce_string" + ] + }, + { + "required": [ + "ce_bytes" + ] + }, + { + "required": [ + "ce_uri" + ] + }, + { + "required": [ + "ce_uri_ref" + ] + }, + { + "required": [ + "ce_timestamp" + ] + } + ], + "title": "*\n The CloudEvent specification defines\n seven attribute value types...", + "description": "* The CloudEvent specification defines seven attribute value types..." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/DistinguishedName.schema.json b/gen/pb-rust/schema/DistinguishedName.schema.json new file mode 100644 index 00000000..7bf473bc --- /dev/null +++ b/gen/pb-rust/schema/DistinguishedName.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/DistinguishedName", + "definitions": { + "DistinguishedName": { + "properties": { + "organization": { + "type": "string" + }, + "common_name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Distinguished Name" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/Envelope.schema.json b/gen/pb-rust/schema/Envelope.schema.json new file mode 100644 index 00000000..b6e49891 --- /dev/null +++ b/gen/pb-rust/schema/Envelope.schema.json @@ -0,0 +1,49 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Envelope", + "definitions": { + "Envelope": { + "properties": { + "payload": { + "type": "string", + "description": "Message to be signed. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "payloadType": { + "type": "string", + "description": "String unambiguously identifying how to interpret payload. REQUIRED." + }, + "signatures": { + "items": { + "$ref": "#/definitions/io.intoto.Signature" + }, + "additionalProperties": false, + "type": "array", + "description": "Signature over: PAE(type, payload) Where PAE is defined as: PAE(type, payload) = \"DSSEv1\" + SP + LEN(type) + SP + type + SP + LEN(payload) + SP + payload + = concatenation SP = ASCII space [0x20] \"DSSEv1\" = ASCII [0x44, 0x53, 0x53, 0x45, 0x76, 0x31] LEN(s) = ASCII decimal encoding of the byte length of s, with no leading zeros REQUIRED (length \u003e= 1)." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Envelope", + "description": "An authenticated message of arbitrary type." + }, + "io.intoto.Signature": { + "properties": { + "sig": { + "type": "string", + "description": "Signature itself. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "keyid": { + "type": "string", + "description": "*Unauthenticated* hint identifying which public key was used. OPTIONAL." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Signature" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/HashOutput.schema.json b/gen/pb-rust/schema/HashOutput.schema.json new file mode 100644 index 00000000..2687ef4f --- /dev/null +++ b/gen/pb-rust/schema/HashOutput.schema.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/HashOutput", + "definitions": { + "HashOutput": { + "properties": { + "algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "digest": { + "type": "string", + "description": "This is the raw octets of the message digest as computed by the hash algorithm.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Hash Output", + "description": "HashOutput captures a digest of a 'message' (generic octet sequence) and the corresponding hash algorithm used." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/InclusionPromise.schema.json b/gen/pb-rust/schema/InclusionPromise.schema.json new file mode 100644 index 00000000..ea457e5a --- /dev/null +++ b/gen/pb-rust/schema/InclusionPromise.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/InclusionPromise", + "definitions": { + "InclusionPromise": { + "properties": { + "signed_entry_timestamp": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Promise", + "description": "The inclusion promise is calculated by Rekor. It's calculated as a signature over a canonical JSON serialization of the persisted entry, the log ID, log index and the integration timestamp. See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54 The format of the signature depends on the transparency log's public key. If the signature algorithm requires a hash function and/or a signature scheme (e.g. RSA) those has to be retrieved out-of-band from the log's operators, together with the public key. This is used to verify the integration timestamp's value and that the log has promised to include the entry." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/InclusionProof.schema.json b/gen/pb-rust/schema/InclusionProof.schema.json new file mode 100644 index 00000000..ae9617a1 --- /dev/null +++ b/gen/pb-rust/schema/InclusionProof.schema.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/InclusionProof", + "definitions": { + "InclusionProof": { + "properties": { + "log_index": { + "type": "string", + "description": "The index of the entry in the tree it was written to." + }, + "root_hash": { + "type": "string", + "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", + "format": "binary", + "binaryEncoding": "base64" + }, + "tree_size": { + "type": "string", + "description": "The size of the merkle tree at the time the proof was generated." + }, + "hashes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of hashes required to compute the inclusion proof, sorted in order from leaf to root. Note that leaf and root hashes are not included. The root hash is available separately in this message, and the leaf hash should be calculated by the client.", + "format": "binary", + "binaryEncoding": "base64" + }, + "checkpoint": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.Checkpoint", + "additionalProperties": false, + "description": "Signature of the tree head, as of the time of this proof was generated. See above info on 'Checkpoint' for more details." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Proof", + "description": "InclusionProof is the proof returned from the transparency log. Can be used for offline or online verification against the log." + }, + "dev.sigstore.rekor.v1.Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/Input.schema.json b/gen/pb-rust/schema/Input.schema.json new file mode 100644 index 00000000..c2667286 --- /dev/null +++ b/gen/pb-rust/schema/Input.schema.json @@ -0,0 +1,893 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Input", + "definitions": { + "Input": { + "properties": { + "artifact_trust_root": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.TrustedRoot", + "additionalProperties": false, + "description": "The verification materials provided during a bundle verification. The running process is usually preloaded with a \"global\" dev.sisgtore.trustroot.TrustedRoot.v1 instance. Prior to verifying an artifact (i.e a bundle), and/or based on current policy, some selection is expected to happen, to filter out the exact certificate authority to use, which transparency logs are relevant etc. The result should b ecaptured in the `artifact_trust_root`." + }, + "artifact_verification_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions", + "additionalProperties": false + }, + "bundle": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.Bundle", + "additionalProperties": false + }, + "artifact": { + "$ref": "#/definitions/dev.sigstore.verification.v1.Artifact", + "additionalProperties": false, + "description": "If the bundle contains a message signature, the artifact must be provided." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "artifact" + ] + } + ], + "title": "Input", + "description": "Input captures all that is needed to call the bundle verification method, to verify a single artifact referenced by the bundle." + }, + "dev.sigstore.bundle.v1.Bundle": { + "properties": { + "media_type": { + "type": "string", + "description": "MUST be application/vnd.dev.sigstore.bundle+json;version=0.1 or application/vnd.dev.sigstore.bundle+json;version=0.2 when encoded as JSON." + }, + "verification_material": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.VerificationMaterial", + "additionalProperties": false, + "description": "When a signer is identified by a X.509 certificate, a verifier MUST verify that the signature was computed at the time the certificate was valid as described in the Sigstore client spec: \"Verification using a Bundle\". \u003chttps://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln\u003e" + }, + "message_signature": { + "$ref": "#/definitions/dev.sigstore.common.v1.MessageSignature", + "additionalProperties": false + }, + "dsse_envelope": { + "$ref": "#/definitions/io.intoto.Envelope", + "additionalProperties": false, + "description": "A DSSE envelope can contain arbitrary payloads. Verifiers must verify that the payload type is a supported and expected type. This is part of the DSSE protocol which is defined here: \u003chttps://github.com/secure-systems-lab/dsse/blob/master/protocol.md\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "message_signature" + ] + }, + { + "required": [ + "dsse_envelope" + ] + } + ], + "title": "Bundle" + }, + "dev.sigstore.bundle.v1.TimestampVerificationData": { + "properties": { + "rfc3161_timestamps": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" + }, + "additionalProperties": false, + "type": "array", + "description": "A list of RFC3161 signed timestamps provided by the user. This can be used when the entry has not been stored on a transparency log, or in conjunction for a stronger trust model. Clients MUST verify the hashed message in the message imprint against the signature in the bundle." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Notes on versioning.\n The primary message ('Bundle') MUST be versioned, by populating the\n 'media_type' field. Semver-ish (only major/minor versions) scheme MUST\n be used. The current version as specified by this file is:\n application/vnd.dev.sigstore.bundle+json;version=0.2\n The semantic version is thus '0.2'.", + "description": "Notes on versioning. The primary message ('Bundle') MUST be versioned, by populating the 'media_type' field. Semver-ish (only major/minor versions) scheme MUST be used. The current version as specified by this file is: application/vnd.dev.sigstore.bundle+json;version=0.2 The semantic version is thus '0.2'. Various timestamped counter signatures over the artifacts signature. Currently only RFC3161 signatures are provided. More formats may be added in the future." + }, + "dev.sigstore.bundle.v1.VerificationMaterial": { + "properties": { + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", + "additionalProperties": false + }, + "x509_certificate_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false + }, + "tlog_entries": { + "items": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" + }, + "additionalProperties": false, + "type": "array", + "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." + }, + "timestamp_verification_data": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", + "additionalProperties": false, + "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "public_key" + ] + }, + { + "required": [ + "x509_certificate_chain" + ] + } + ], + "title": "Verification Material", + "description": "VerificationMaterial captures details on the materials used to verify signatures." + }, + "dev.sigstore.common.v1.DistinguishedName": { + "properties": { + "organization": { + "type": "string" + }, + "common_name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Distinguished Name" + }, + "dev.sigstore.common.v1.HashOutput": { + "properties": { + "algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "digest": { + "type": "string", + "description": "This is the raw octets of the message digest as computed by the hash algorithm.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Hash Output", + "description": "HashOutput captures a digest of a 'message' (generic octet sequence) and the corresponding hash algorithm used." + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.common.v1.MessageSignature": { + "properties": { + "message_digest": { + "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", + "additionalProperties": false, + "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." + }, + "signature": { + "type": "string", + "description": "The raw bytes as returned from the signature algorithm. The signature algorithm (and so the format of the signature bytes) are determined by the contents of the 'verification_material', either a key-pair or a certificate. If using a certificate, the certificate contains the required information on the signature algorithm. When using a key pair, the algorithm MUST be part of the public key, which MUST be communicated out-of-band.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Message Signature", + "description": "MessageSignature stores the computed signature over a message." + }, + "dev.sigstore.common.v1.ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + }, + "dev.sigstore.common.v1.ObjectIdentifierValuePair": { + "properties": { + "oid": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifier", + "additionalProperties": false + }, + "value": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier Value Pair", + "description": "An OID and the corresponding (byte) value." + }, + "dev.sigstore.common.v1.PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.PublicKeyIdentifier": { + "properties": { + "hint": { + "type": "string", + "description": "Optional unauthenticated hint on which key to use. The format of the hint must be agreed upon out of band by the signer and the verifiers, and so is not subject to this specification. Example use-case is to specify the public key to use, from a trusted key-ring. Implementors are RECOMMENDED to derive the value from the public key as described in RFC 6962. See: \u003chttps://www.rfc-editor.org/rfc/rfc6962#section-3.2\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identifier", + "description": "PublicKeyIdentifier can be used to identify an (out of band) delivered key, to verify a signature." + }, + "dev.sigstore.common.v1.RFC3161SignedTimestamp": { + "properties": { + "signed_timestamp": { + "type": "string", + "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "RFC 3161 Signed Timestamp", + "description": "This message holds a RFC 3161 timestamp." + }, + "dev.sigstore.common.v1.SubjectAlternativeName": { + "properties": { + "type": { + "enum": [ + "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", + 0, + "EMAIL", + 1, + "URI", + 2, + "OTHER_NAME", + 3 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Subject Alternative Name Type" + }, + "regexp": { + "type": "string", + "description": "A regular expression describing the expected value for the SAN." + }, + "value": { + "type": "string", + "description": "The exact value to match against." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "regexp" + ] + }, + { + "required": [ + "value" + ] + } + ], + "title": "Subject Alternative Name" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + }, + "dev.sigstore.common.v1.X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + }, + "dev.sigstore.rekor.v1.Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + }, + "dev.sigstore.rekor.v1.InclusionPromise": { + "properties": { + "signed_entry_timestamp": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Promise", + "description": "The inclusion promise is calculated by Rekor. It's calculated as a signature over a canonical JSON serialization of the persisted entry, the log ID, log index and the integration timestamp. See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54 The format of the signature depends on the transparency log's public key. If the signature algorithm requires a hash function and/or a signature scheme (e.g. RSA) those has to be retrieved out-of-band from the log's operators, together with the public key. This is used to verify the integration timestamp's value and that the log has promised to include the entry." + }, + "dev.sigstore.rekor.v1.InclusionProof": { + "properties": { + "log_index": { + "type": "string", + "description": "The index of the entry in the tree it was written to." + }, + "root_hash": { + "type": "string", + "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", + "format": "binary", + "binaryEncoding": "base64" + }, + "tree_size": { + "type": "string", + "description": "The size of the merkle tree at the time the proof was generated." + }, + "hashes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of hashes required to compute the inclusion proof, sorted in order from leaf to root. Note that leaf and root hashes are not included. The root hash is available separately in this message, and the leaf hash should be calculated by the client.", + "format": "binary", + "binaryEncoding": "base64" + }, + "checkpoint": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.Checkpoint", + "additionalProperties": false, + "description": "Signature of the tree head, as of the time of this proof was generated. See above info on 'Checkpoint' for more details." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Proof", + "description": "InclusionProof is the proof returned from the transparency log. Can be used for offline or online verification against the log." + }, + "dev.sigstore.rekor.v1.KindVersion": { + "properties": { + "kind": { + "type": "string", + "description": "Kind is the type of entry being stored in the log. See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types" + }, + "version": { + "type": "string", + "description": "The specific api version of the type." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Kind Version", + "description": "KindVersion contains the entry's kind and api version." + }, + "dev.sigstore.rekor.v1.TransparencyLogEntry": { + "properties": { + "log_index": { + "type": "string", + "description": "The global index of the entry, used when querying the log by index." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier of the log." + }, + "kind_version": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", + "additionalProperties": false, + "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." + }, + "integrated_time": { + "type": "string", + "description": "The UNIX timestamp from the log when the entry was persisted." + }, + "inclusion_promise": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", + "additionalProperties": false, + "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." + }, + "inclusion_proof": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", + "additionalProperties": false, + "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." + }, + "canonicalized_body": { + "type": "string", + "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Entry", + "description": "TransparencyLogEntry captures all the details required from Rekor to reconstruct an entry, given that the payload is provided via other means. This type can easily be created from the existing response from Rekor. Future iterations could rely on Rekor returning the minimal set of attributes (excluding the payload) that are required for verifying the inclusion promise. The inclusion promise (called SignedEntryTimestamp in the response from Rekor) is similar to a Signed Certificate Timestamp as described here https://www.rfc-editor.org/rfc/rfc6962.html#section-3.2." + }, + "dev.sigstore.trustroot.v1.CertificateAuthority": { + "properties": { + "subject": { + "$ref": "#/definitions/dev.sigstore.common.v1.DistinguishedName", + "additionalProperties": false, + "description": "The root certificate MUST be self-signed, and so the subject and issuer are the same." + }, + "uri": { + "type": "string", + "description": "The URI at which the CA can be accessed." + }, + "cert_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false, + "description": "The certificate chain for this CA." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Authority", + "description": "CertificateAuthority enlists the information required to identify which CA to use and perform signature verification." + }, + "dev.sigstore.trustroot.v1.TransparencyLogInstance": { + "properties": { + "base_url": { + "type": "string", + "description": "The base URL at which can be used to URLs for the client." + }, + "hash_algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", + "additionalProperties": false, + "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier for this transparency log." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Instance", + "description": "TransparencyLogInstance describes the immutable parameters from a transparency log. See https://www.rfc-editor.org/rfc/rfc9162.html#name-log-parameters for more details. The included parameters are the minimal set required to identify a log, and verify an inclusion proof/promise." + }, + "dev.sigstore.trustroot.v1.TrustedRoot": { + "properties": { + "media_type": { + "type": "string", + "description": "MUST be application/vnd.dev.sigstore.trustedroot+json;version=0.1" + }, + "tlogs": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.TransparencyLogInstance" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted Rekor servers." + }, + "certificate_authorities": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted certificate authorities (e.g Fulcio), and any intermediate certificates they provide. If a CA is issuing multiple intermediate certificate, each combination shall be represented as separate chain. I.e, a single root cert may appear in multiple chains but with different intermediate and/or leaf certificates. The certificates are intended to be used for verifying artifact signatures." + }, + "ctlogs": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.TransparencyLogInstance" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted certificate transparency logs." + }, + "timestamp_authorities": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted timestamping authorities." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Trusted Root", + "description": "TrustedRoot describes the client's complete set of trusted entities. How the TrustedRoot is populated is not specified, but can be a combination of many sources such as TUF repositories, files on disk etc. The TrustedRoot is not meant to be used for any artifact verification, only to capture the complete/global set of trusted verification materials. When verifying an artifact, based on the artifact and policies, a selection of keys/authorities are expected to be extracted and provided to the verification function. This way the set of keys/authorities can be kept to a minimal set by the policy to gain better control over what signatures that are allowed. The embedded transparency logs, CT logs, CAs and TSAs MUST include any previously used instance -- otherwise signatures made in the past cannot be verified. The currently used instances MUST NOT have their 'end' timestamp set in their 'valid_for' attribute for easy identification. All the listed instances SHOULD be sorted by the 'valid_for' in ascending order, that is, the oldest instance first and the current instance last." + }, + "dev.sigstore.verification.v1.Artifact": { + "properties": { + "artifact_uri": { + "type": "string", + "description": "Location of the artifact" + }, + "artifact": { + "type": "string", + "description": "The raw bytes of the artifact", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "artifact_uri" + ] + }, + { + "required": [ + "artifact" + ] + } + ], + "title": "Artifact" + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions": { + "properties": { + "certificate_identities": { + "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentities", + "additionalProperties": false + }, + "public_keys": { + "$ref": "#/definitions/dev.sigstore.verification.v1.PublicKeyIdentities", + "additionalProperties": false, + "description": "To simplify verification implementation, the logic for bundle verification should be implemented as a higher-order function, where one of argument should be an interface over the set of trusted public keys, like this: `Verify(bytes artifact, bytes signature, string key_id)`. This way the caller is in full control of mapping the identified (or hinted) key in the bundle to one of the trusted keys, as this process is inherently application specific." + }, + "tlog_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions", + "additionalProperties": false, + "description": "Optional options for artifact transparency log verification. If none is provided, the default verification options are: Threshold: 1 Online verification: false Disable: false" + }, + "ctlog_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions", + "additionalProperties": false, + "description": "Optional options for certificate transparency log verification. If none is provided, the default verification options are: Threshold: 1 Detached SCT: false Disable: false" + }, + "tsa_options": { + "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions", + "additionalProperties": false, + "description": "Optional options for certificate signed timestamp verification. If none is provided, the default verification options are: Threshold: 1 Disable: false" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "certificate_identities" + ] + }, + { + "required": [ + "public_keys" + ] + }, + { + "required": [ + "tlog_options" + ] + }, + { + "required": [ + "ctlog_options" + ] + }, + { + "required": [ + "tsa_options" + ] + } + ], + "title": "Artifact Verification Options", + "description": "A light-weight set of options/policies for identifying trusted signers, used during verification of a single artifact." + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "The number of ct transparency logs the certificate must appear on." + }, + "detached_sct": { + "type": "boolean", + "description": "Expect detached SCTs. This is not supported right now as we can't capture an detached SCT in the bundle." + }, + "disable": { + "type": "boolean", + "description": "Disable ct transparency log verification" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Ctlog Options" + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "The number of signed timestamps that are expected." + }, + "disable": { + "type": "boolean", + "description": "Disable signed timestamp verification." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Timestamp Authority Options" + }, + "dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions": { + "properties": { + "threshold": { + "type": "integer", + "description": "Number of transparency logs the entry must appear on." + }, + "perform_online_verification": { + "type": "boolean", + "description": "Perform an online inclusion proof." + }, + "disable": { + "type": "boolean", + "description": "Disable verification for transparency logs." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Tlog Options" + }, + "dev.sigstore.verification.v1.CertificateIdentities": { + "properties": { + "identities": { + "items": { + "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentity" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identities" + }, + "dev.sigstore.verification.v1.CertificateIdentity": { + "properties": { + "issuer": { + "type": "string", + "description": "The X.509v3 issuer extension (OID 1.3.6.1.4.1.57264.1.1)" + }, + "san": { + "$ref": "#/definitions/dev.sigstore.common.v1.SubjectAlternativeName", + "additionalProperties": false + }, + "oids": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifierValuePair" + }, + "additionalProperties": false, + "type": "array", + "description": "An unordered list of OIDs that must be verified. All OID/values provided in this list MUST exactly match against the values in the certificate for verification to be successful." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Identity", + "description": "The identity of a X.509 Certificate signer." + }, + "dev.sigstore.verification.v1.PublicKeyIdentities": { + "properties": { + "public_keys": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identities" + }, + "io.intoto.Envelope": { + "properties": { + "payload": { + "type": "string", + "description": "Message to be signed. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "payloadType": { + "type": "string", + "description": "String unambiguously identifying how to interpret payload. REQUIRED." + }, + "signatures": { + "items": { + "$ref": "#/definitions/io.intoto.Signature" + }, + "additionalProperties": false, + "type": "array", + "description": "Signature over: PAE(type, payload) Where PAE is defined as: PAE(type, payload) = \"DSSEv1\" + SP + LEN(type) + SP + type + SP + LEN(payload) + SP + payload + = concatenation SP = ASCII space [0x20] \"DSSEv1\" = ASCII [0x44, 0x53, 0x53, 0x45, 0x76, 0x31] LEN(s) = ASCII decimal encoding of the byte length of s, with no leading zeros REQUIRED (length \u003e= 1)." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Envelope", + "description": "An authenticated message of arbitrary type." + }, + "io.intoto.Signature": { + "properties": { + "sig": { + "type": "string", + "description": "Signature itself. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "keyid": { + "type": "string", + "description": "*Unauthenticated* hint identifying which public key was used. OPTIONAL." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Signature" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/KindVersion.schema.json b/gen/pb-rust/schema/KindVersion.schema.json new file mode 100644 index 00000000..6b6cbe05 --- /dev/null +++ b/gen/pb-rust/schema/KindVersion.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/KindVersion", + "definitions": { + "KindVersion": { + "properties": { + "kind": { + "type": "string", + "description": "Kind is the type of entry being stored in the log. See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types" + }, + "version": { + "type": "string", + "description": "The specific api version of the type." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Kind Version", + "description": "KindVersion contains the entry's kind and api version." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/LogId.schema.json b/gen/pb-rust/schema/LogId.schema.json new file mode 100644 index 00000000..77b1f8c5 --- /dev/null +++ b/gen/pb-rust/schema/LogId.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/LogId", + "definitions": { + "LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/MessageSignature.schema.json b/gen/pb-rust/schema/MessageSignature.schema.json new file mode 100644 index 00000000..07e26fdf --- /dev/null +++ b/gen/pb-rust/schema/MessageSignature.schema.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/MessageSignature", + "definitions": { + "MessageSignature": { + "properties": { + "message_digest": { + "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", + "additionalProperties": false, + "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." + }, + "signature": { + "type": "string", + "description": "The raw bytes as returned from the signature algorithm. The signature algorithm (and so the format of the signature bytes) are determined by the contents of the 'verification_material', either a key-pair or a certificate. If using a certificate, the certificate contains the required information on the signature algorithm. When using a key pair, the algorithm MUST be part of the public key, which MUST be communicated out-of-band.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Message Signature", + "description": "MessageSignature stores the computed signature over a message." + }, + "dev.sigstore.common.v1.HashOutput": { + "properties": { + "algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "digest": { + "type": "string", + "description": "This is the raw octets of the message digest as computed by the hash algorithm.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Hash Output", + "description": "HashOutput captures a digest of a 'message' (generic octet sequence) and the corresponding hash algorithm used." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/ObjectIdentifier.schema.json b/gen/pb-rust/schema/ObjectIdentifier.schema.json new file mode 100644 index 00000000..109a0d23 --- /dev/null +++ b/gen/pb-rust/schema/ObjectIdentifier.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/ObjectIdentifier", + "definitions": { + "ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json b/gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json new file mode 100644 index 00000000..b1c5488e --- /dev/null +++ b/gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/ObjectIdentifierValuePair", + "definitions": { + "ObjectIdentifierValuePair": { + "properties": { + "oid": { + "$ref": "#/definitions/dev.sigstore.common.v1.ObjectIdentifier", + "additionalProperties": false + }, + "value": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier Value Pair", + "description": "An OID and the corresponding (byte) value." + }, + "dev.sigstore.common.v1.ObjectIdentifier": { + "properties": { + "id": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Object Identifier", + "description": "An ASN.1 OBJECT IDENTIFIER" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/PublicKey.schema.json b/gen/pb-rust/schema/PublicKey.schema.json new file mode 100644 index 00000000..d41e5eaf --- /dev/null +++ b/gen/pb-rust/schema/PublicKey.schema.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/PublicKey", + "definitions": { + "PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/PublicKeyIdentifier.schema.json b/gen/pb-rust/schema/PublicKeyIdentifier.schema.json new file mode 100644 index 00000000..663bf2d2 --- /dev/null +++ b/gen/pb-rust/schema/PublicKeyIdentifier.schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/PublicKeyIdentifier", + "definitions": { + "PublicKeyIdentifier": { + "properties": { + "hint": { + "type": "string", + "description": "Optional unauthenticated hint on which key to use. The format of the hint must be agreed upon out of band by the signer and the verifiers, and so is not subject to this specification. Example use-case is to specify the public key to use, from a trusted key-ring. Implementors are RECOMMENDED to derive the value from the public key as described in RFC 6962. See: \u003chttps://www.rfc-editor.org/rfc/rfc6962#section-3.2\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identifier", + "description": "PublicKeyIdentifier can be used to identify an (out of band) delivered key, to verify a signature." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/PublicKeyIdentities.schema.json b/gen/pb-rust/schema/PublicKeyIdentities.schema.json new file mode 100644 index 00000000..940b468d --- /dev/null +++ b/gen/pb-rust/schema/PublicKeyIdentities.schema.json @@ -0,0 +1,103 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/PublicKeyIdentities", + "definitions": { + "PublicKeyIdentities": { + "properties": { + "public_keys": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" + }, + "additionalProperties": false, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identities" + }, + "dev.sigstore.common.v1.PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json b/gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json new file mode 100644 index 00000000..7aa04537 --- /dev/null +++ b/gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/RFC3161SignedTimestamp", + "definitions": { + "RFC3161SignedTimestamp": { + "properties": { + "signed_timestamp": { + "type": "string", + "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "RFC 3161 Signed Timestamp", + "description": "This message holds a RFC 3161 timestamp." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/Signature.schema.json b/gen/pb-rust/schema/Signature.schema.json new file mode 100644 index 00000000..a78066c2 --- /dev/null +++ b/gen/pb-rust/schema/Signature.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/Signature", + "definitions": { + "Signature": { + "properties": { + "sig": { + "type": "string", + "description": "Signature itself. (In JSON, this is encoded as base64.) REQUIRED.", + "format": "binary", + "binaryEncoding": "base64" + }, + "keyid": { + "type": "string", + "description": "*Unauthenticated* hint identifying which public key was used. OPTIONAL." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Signature" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/SubjectAlternativeName.schema.json b/gen/pb-rust/schema/SubjectAlternativeName.schema.json new file mode 100644 index 00000000..ff25d78f --- /dev/null +++ b/gen/pb-rust/schema/SubjectAlternativeName.schema.json @@ -0,0 +1,54 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/SubjectAlternativeName", + "definitions": { + "SubjectAlternativeName": { + "properties": { + "type": { + "enum": [ + "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", + 0, + "EMAIL", + 1, + "URI", + 2, + "OTHER_NAME", + 3 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Subject Alternative Name Type" + }, + "regexp": { + "type": "string", + "description": "A regular expression describing the expected value for the SAN." + }, + "value": { + "type": "string", + "description": "The exact value to match against." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "regexp" + ] + }, + { + "required": [ + "value" + ] + } + ], + "title": "Subject Alternative Name" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/TimeRange.schema.json b/gen/pb-rust/schema/TimeRange.schema.json new file mode 100644 index 00000000..4928e9e0 --- /dev/null +++ b/gen/pb-rust/schema/TimeRange.schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/TimeRange", + "definitions": { + "TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/TimestampVerificationData.schema.json b/gen/pb-rust/schema/TimestampVerificationData.schema.json new file mode 100644 index 00000000..cb9f52d8 --- /dev/null +++ b/gen/pb-rust/schema/TimestampVerificationData.schema.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/TimestampVerificationData", + "definitions": { + "TimestampVerificationData": { + "properties": { + "rfc3161_timestamps": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" + }, + "additionalProperties": false, + "type": "array", + "description": "A list of RFC3161 signed timestamps provided by the user. This can be used when the entry has not been stored on a transparency log, or in conjunction for a stronger trust model. Clients MUST verify the hashed message in the message imprint against the signature in the bundle." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Notes on versioning.\n The primary message ('Bundle') MUST be versioned, by populating the\n 'media_type' field. Semver-ish (only major/minor versions) scheme MUST\n be used. The current version as specified by this file is:\n application/vnd.dev.sigstore.bundle+json;version=0.2\n The semantic version is thus '0.2'.", + "description": "Notes on versioning. The primary message ('Bundle') MUST be versioned, by populating the 'media_type' field. Semver-ish (only major/minor versions) scheme MUST be used. The current version as specified by this file is: application/vnd.dev.sigstore.bundle+json;version=0.2 The semantic version is thus '0.2'. Various timestamped counter signatures over the artifacts signature. Currently only RFC3161 signatures are provided. More formats may be added in the future." + }, + "dev.sigstore.common.v1.RFC3161SignedTimestamp": { + "properties": { + "signed_timestamp": { + "type": "string", + "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "RFC 3161 Signed Timestamp", + "description": "This message holds a RFC 3161 timestamp." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/TransparencyLogEntry.schema.json b/gen/pb-rust/schema/TransparencyLogEntry.schema.json new file mode 100644 index 00000000..e130ab5d --- /dev/null +++ b/gen/pb-rust/schema/TransparencyLogEntry.schema.json @@ -0,0 +1,138 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/TransparencyLogEntry", + "definitions": { + "TransparencyLogEntry": { + "properties": { + "log_index": { + "type": "string", + "description": "The global index of the entry, used when querying the log by index." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier of the log." + }, + "kind_version": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", + "additionalProperties": false, + "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." + }, + "integrated_time": { + "type": "string", + "description": "The UNIX timestamp from the log when the entry was persisted." + }, + "inclusion_promise": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", + "additionalProperties": false, + "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." + }, + "inclusion_proof": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", + "additionalProperties": false, + "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." + }, + "canonicalized_body": { + "type": "string", + "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Entry", + "description": "TransparencyLogEntry captures all the details required from Rekor to reconstruct an entry, given that the payload is provided via other means. This type can easily be created from the existing response from Rekor. Future iterations could rely on Rekor returning the minimal set of attributes (excluding the payload) that are required for verifying the inclusion promise. The inclusion promise (called SignedEntryTimestamp in the response from Rekor) is similar to a Signed Certificate Timestamp as described here https://www.rfc-editor.org/rfc/rfc6962.html#section-3.2." + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.rekor.v1.Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + }, + "dev.sigstore.rekor.v1.InclusionPromise": { + "properties": { + "signed_entry_timestamp": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Promise", + "description": "The inclusion promise is calculated by Rekor. It's calculated as a signature over a canonical JSON serialization of the persisted entry, the log ID, log index and the integration timestamp. See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54 The format of the signature depends on the transparency log's public key. If the signature algorithm requires a hash function and/or a signature scheme (e.g. RSA) those has to be retrieved out-of-band from the log's operators, together with the public key. This is used to verify the integration timestamp's value and that the log has promised to include the entry." + }, + "dev.sigstore.rekor.v1.InclusionProof": { + "properties": { + "log_index": { + "type": "string", + "description": "The index of the entry in the tree it was written to." + }, + "root_hash": { + "type": "string", + "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", + "format": "binary", + "binaryEncoding": "base64" + }, + "tree_size": { + "type": "string", + "description": "The size of the merkle tree at the time the proof was generated." + }, + "hashes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of hashes required to compute the inclusion proof, sorted in order from leaf to root. Note that leaf and root hashes are not included. The root hash is available separately in this message, and the leaf hash should be calculated by the client.", + "format": "binary", + "binaryEncoding": "base64" + }, + "checkpoint": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.Checkpoint", + "additionalProperties": false, + "description": "Signature of the tree head, as of the time of this proof was generated. See above info on 'Checkpoint' for more details." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Proof", + "description": "InclusionProof is the proof returned from the transparency log. Can be used for offline or online verification against the log." + }, + "dev.sigstore.rekor.v1.KindVersion": { + "properties": { + "kind": { + "type": "string", + "description": "Kind is the type of entry being stored in the log. See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types" + }, + "version": { + "type": "string", + "description": "The specific api version of the type." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Kind Version", + "description": "KindVersion contains the entry's kind and api version." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/TransparencyLogInstance.schema.json b/gen/pb-rust/schema/TransparencyLogInstance.schema.json new file mode 100644 index 00000000..17fa8a8c --- /dev/null +++ b/gen/pb-rust/schema/TransparencyLogInstance.schema.json @@ -0,0 +1,143 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/TransparencyLogInstance", + "definitions": { + "TransparencyLogInstance": { + "properties": { + "base_url": { + "type": "string", + "description": "The base URL at which can be used to URLs for the client." + }, + "hash_algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", + "additionalProperties": false, + "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier for this transparency log." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Instance", + "description": "TransparencyLogInstance describes the immutable parameters from a transparency log. See https://www.rfc-editor.org/rfc/rfc9162.html#name-log-parameters for more details. The included parameters are the minimal set required to identify a log, and verify an inclusion proof/promise." + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.common.v1.PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/TrustedRoot.schema.json b/gen/pb-rust/schema/TrustedRoot.schema.json new file mode 100644 index 00000000..70df3df4 --- /dev/null +++ b/gen/pb-rust/schema/TrustedRoot.schema.json @@ -0,0 +1,256 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/TrustedRoot", + "definitions": { + "TrustedRoot": { + "properties": { + "media_type": { + "type": "string", + "description": "MUST be application/vnd.dev.sigstore.trustedroot+json;version=0.1" + }, + "tlogs": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.TransparencyLogInstance" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted Rekor servers." + }, + "certificate_authorities": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted certificate authorities (e.g Fulcio), and any intermediate certificates they provide. If a CA is issuing multiple intermediate certificate, each combination shall be represented as separate chain. I.e, a single root cert may appear in multiple chains but with different intermediate and/or leaf certificates. The certificates are intended to be used for verifying artifact signatures." + }, + "ctlogs": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.TransparencyLogInstance" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted certificate transparency logs." + }, + "timestamp_authorities": { + "items": { + "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" + }, + "additionalProperties": false, + "type": "array", + "description": "A set of trusted timestamping authorities." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Trusted Root", + "description": "TrustedRoot describes the client's complete set of trusted entities. How the TrustedRoot is populated is not specified, but can be a combination of many sources such as TUF repositories, files on disk etc. The TrustedRoot is not meant to be used for any artifact verification, only to capture the complete/global set of trusted verification materials. When verifying an artifact, based on the artifact and policies, a selection of keys/authorities are expected to be extracted and provided to the verification function. This way the set of keys/authorities can be kept to a minimal set by the policy to gain better control over what signatures that are allowed. The embedded transparency logs, CT logs, CAs and TSAs MUST include any previously used instance -- otherwise signatures made in the past cannot be verified. The currently used instances MUST NOT have their 'end' timestamp set in their 'valid_for' attribute for easy identification. All the listed instances SHOULD be sorted by the 'valid_for' in ascending order, that is, the oldest instance first and the current instance last." + }, + "dev.sigstore.common.v1.DistinguishedName": { + "properties": { + "organization": { + "type": "string" + }, + "common_name": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Distinguished Name" + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.common.v1.PublicKey": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", + "format": "binary", + "binaryEncoding": "base64" + }, + "key_details": { + "enum": [ + "PUBLIC_KEY_DETAILS_UNSPECIFIED", + 0, + "PKCS1_RSA_PKCS1V5", + 1, + "PKCS1_RSA_PSS", + 2, + "PKIX_RSA_PKCS1V5", + 3, + "PKIX_RSA_PSS", + 4, + "PKIX_ECDSA_P256_SHA_256", + 5, + "PKIX_ECDSA_P256_HMAC_SHA_256", + 6, + "PKIX_ED25519", + 7 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "Public Key Details", + "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "Optional validity period for this key, *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "raw_bytes" + ] + }, + { + "required": [ + "valid_for" + ] + } + ], + "title": "Public Key" + }, + "dev.sigstore.common.v1.TimeRange": { + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "end" + ] + } + ], + "title": "Time Range", + "description": "The time range is closed and includes both the start and end times, (i.e., [start, end]). End is optional to be able to capture a period that has started but has no known end." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + }, + "dev.sigstore.common.v1.X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + }, + "dev.sigstore.trustroot.v1.CertificateAuthority": { + "properties": { + "subject": { + "$ref": "#/definitions/dev.sigstore.common.v1.DistinguishedName", + "additionalProperties": false, + "description": "The root certificate MUST be self-signed, and so the subject and issuer are the same." + }, + "uri": { + "type": "string", + "description": "The URI at which the CA can be accessed." + }, + "cert_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false, + "description": "The certificate chain for this CA." + }, + "valid_for": { + "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", + "additionalProperties": false, + "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Certificate Authority", + "description": "CertificateAuthority enlists the information required to identify which CA to use and perform signature verification." + }, + "dev.sigstore.trustroot.v1.TransparencyLogInstance": { + "properties": { + "base_url": { + "type": "string", + "description": "The base URL at which can be used to URLs for the client." + }, + "hash_algorithm": { + "enum": [ + "HASH_ALGORITHM_UNSPECIFIED", + 0, + "SHA2_256", + 1 + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "title": "This package defines commonly used message types within the Sigstore\n community.", + "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." + }, + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", + "additionalProperties": false, + "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier for this transparency log." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Instance", + "description": "TransparencyLogInstance describes the immutable parameters from a transparency log. See https://www.rfc-editor.org/rfc/rfc9162.html#name-log-parameters for more details. The included parameters are the minimal set required to identify a log, and verify an inclusion proof/promise." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/VerificationMaterial.schema.json b/gen/pb-rust/schema/VerificationMaterial.schema.json new file mode 100644 index 00000000..3c7ba4d5 --- /dev/null +++ b/gen/pb-rust/schema/VerificationMaterial.schema.json @@ -0,0 +1,250 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/VerificationMaterial", + "definitions": { + "VerificationMaterial": { + "properties": { + "public_key": { + "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", + "additionalProperties": false + }, + "x509_certificate_chain": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", + "additionalProperties": false + }, + "tlog_entries": { + "items": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" + }, + "additionalProperties": false, + "type": "array", + "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." + }, + "timestamp_verification_data": { + "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", + "additionalProperties": false, + "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." + } + }, + "additionalProperties": false, + "type": "object", + "oneOf": [ + { + "required": [ + "public_key" + ] + }, + { + "required": [ + "x509_certificate_chain" + ] + } + ], + "title": "Verification Material", + "description": "VerificationMaterial captures details on the materials used to verify signatures." + }, + "dev.sigstore.bundle.v1.TimestampVerificationData": { + "properties": { + "rfc3161_timestamps": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" + }, + "additionalProperties": false, + "type": "array", + "description": "A list of RFC3161 signed timestamps provided by the user. This can be used when the entry has not been stored on a transparency log, or in conjunction for a stronger trust model. Clients MUST verify the hashed message in the message imprint against the signature in the bundle." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Notes on versioning.\n The primary message ('Bundle') MUST be versioned, by populating the\n 'media_type' field. Semver-ish (only major/minor versions) scheme MUST\n be used. The current version as specified by this file is:\n application/vnd.dev.sigstore.bundle+json;version=0.2\n The semantic version is thus '0.2'.", + "description": "Notes on versioning. The primary message ('Bundle') MUST be versioned, by populating the 'media_type' field. Semver-ish (only major/minor versions) scheme MUST be used. The current version as specified by this file is: application/vnd.dev.sigstore.bundle+json;version=0.2 The semantic version is thus '0.2'. Various timestamped counter signatures over the artifacts signature. Currently only RFC3161 signatures are provided. More formats may be added in the future." + }, + "dev.sigstore.common.v1.LogId": { + "properties": { + "key_id": { + "type": "string", + "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Log Id", + "description": "LogId captures the identity of a transparency log." + }, + "dev.sigstore.common.v1.PublicKeyIdentifier": { + "properties": { + "hint": { + "type": "string", + "description": "Optional unauthenticated hint on which key to use. The format of the hint must be agreed upon out of band by the signer and the verifiers, and so is not subject to this specification. Example use-case is to specify the public key to use, from a trusted key-ring. Implementors are RECOMMENDED to derive the value from the public key as described in RFC 6962. See: \u003chttps://www.rfc-editor.org/rfc/rfc6962#section-3.2\u003e" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Public Key Identifier", + "description": "PublicKeyIdentifier can be used to identify an (out of band) delivered key, to verify a signature." + }, + "dev.sigstore.common.v1.RFC3161SignedTimestamp": { + "properties": { + "signed_timestamp": { + "type": "string", + "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "RFC 3161 Signed Timestamp", + "description": "This message holds a RFC 3161 timestamp." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + }, + "dev.sigstore.common.v1.X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + }, + "dev.sigstore.rekor.v1.Checkpoint": { + "properties": { + "envelope": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Checkpoint", + "description": "The checkpoint contains a signature of the tree head (root hash), size of the tree, the transparency log's unique identifier (log ID), hostname and the current time. The result is a string, the format is described here https://github.com/transparency-dev/formats/blob/main/log/README.md The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114 The signature has the same format as InclusionPromise.signed_entry_timestamp. See below for more details." + }, + "dev.sigstore.rekor.v1.InclusionPromise": { + "properties": { + "signed_entry_timestamp": { + "type": "string", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Promise", + "description": "The inclusion promise is calculated by Rekor. It's calculated as a signature over a canonical JSON serialization of the persisted entry, the log ID, log index and the integration timestamp. See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54 The format of the signature depends on the transparency log's public key. If the signature algorithm requires a hash function and/or a signature scheme (e.g. RSA) those has to be retrieved out-of-band from the log's operators, together with the public key. This is used to verify the integration timestamp's value and that the log has promised to include the entry." + }, + "dev.sigstore.rekor.v1.InclusionProof": { + "properties": { + "log_index": { + "type": "string", + "description": "The index of the entry in the tree it was written to." + }, + "root_hash": { + "type": "string", + "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", + "format": "binary", + "binaryEncoding": "base64" + }, + "tree_size": { + "type": "string", + "description": "The size of the merkle tree at the time the proof was generated." + }, + "hashes": { + "items": { + "type": "string" + }, + "type": "array", + "description": "A list of hashes required to compute the inclusion proof, sorted in order from leaf to root. Note that leaf and root hashes are not included. The root hash is available separately in this message, and the leaf hash should be calculated by the client.", + "format": "binary", + "binaryEncoding": "base64" + }, + "checkpoint": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.Checkpoint", + "additionalProperties": false, + "description": "Signature of the tree head, as of the time of this proof was generated. See above info on 'Checkpoint' for more details." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Inclusion Proof", + "description": "InclusionProof is the proof returned from the transparency log. Can be used for offline or online verification against the log." + }, + "dev.sigstore.rekor.v1.KindVersion": { + "properties": { + "kind": { + "type": "string", + "description": "Kind is the type of entry being stored in the log. See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types" + }, + "version": { + "type": "string", + "description": "The specific api version of the type." + } + }, + "additionalProperties": false, + "type": "object", + "title": "Kind Version", + "description": "KindVersion contains the entry's kind and api version." + }, + "dev.sigstore.rekor.v1.TransparencyLogEntry": { + "properties": { + "log_index": { + "type": "string", + "description": "The global index of the entry, used when querying the log by index." + }, + "log_id": { + "$ref": "#/definitions/dev.sigstore.common.v1.LogId", + "additionalProperties": false, + "description": "The unique identifier of the log." + }, + "kind_version": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", + "additionalProperties": false, + "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." + }, + "integrated_time": { + "type": "string", + "description": "The UNIX timestamp from the log when the entry was persisted." + }, + "inclusion_promise": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", + "additionalProperties": false, + "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." + }, + "inclusion_proof": { + "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", + "additionalProperties": false, + "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." + }, + "canonicalized_body": { + "type": "string", + "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "Transparency Log Entry", + "description": "TransparencyLogEntry captures all the details required from Rekor to reconstruct an entry, given that the payload is provided via other means. This type can easily be created from the existing response from Rekor. Future iterations could rely on Rekor returning the minimal set of attributes (excluding the payload) that are required for verifying the inclusion promise. The inclusion promise (called SignedEntryTimestamp in the response from Rekor) is similar to a Signed Certificate Timestamp as described here https://www.rfc-editor.org/rfc/rfc6962.html#section-3.2." + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/X509Certificate.schema.json b/gen/pb-rust/schema/X509Certificate.schema.json new file mode 100644 index 00000000..ed058fca --- /dev/null +++ b/gen/pb-rust/schema/X509Certificate.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/X509Certificate", + "definitions": { + "X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/schema/X509CertificateChain.schema.json b/gen/pb-rust/schema/X509CertificateChain.schema.json new file mode 100644 index 00000000..c6f714e2 --- /dev/null +++ b/gen/pb-rust/schema/X509CertificateChain.schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/X509CertificateChain", + "definitions": { + "X509CertificateChain": { + "properties": { + "certificates": { + "items": { + "$ref": "#/definitions/dev.sigstore.common.v1.X509Certificate" + }, + "additionalProperties": false, + "type": "array", + "description": "The chain of certificates, with indices 0 to n. The first certificate in the array must be the leaf certificate used for signing. Signers MUST NOT include their root CA certificates in their embedded certificate chains, and SHOULD NOT include intermediate CA certificates that appear in independent roots of trust. Verifiers MUST validate the chain carefully to ensure that it chains up to a root CA certificate that they trust, regardless of whether the chain includes additional intermediate/root CA certificates. Verifiers MAY enforce additional constraints, such as requiring that all intermediate CA certificates appear in an independent root of trust. Verifiers SHOULD handle old or non-complying bundles that have additional intermediate/root CA certificates." + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate Chain", + "description": "A chain of X.509 certificates." + }, + "dev.sigstore.common.v1.X509Certificate": { + "properties": { + "raw_bytes": { + "type": "string", + "description": "DER-encoded X.509 certificate.", + "format": "binary", + "binaryEncoding": "base64" + } + }, + "additionalProperties": false, + "type": "object", + "title": "X 509 Certificate" + } + } +} \ No newline at end of file diff --git a/gen/pb-rust/src/envelope.rs b/gen/pb-rust/src/envelope.rs deleted file mode 100644 index b7a1f8aa..00000000 --- a/gen/pb-rust/src/envelope.rs +++ /dev/null @@ -1,497 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `envelope.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct Envelope { - // message fields - pub payload: ::std::vec::Vec, - pub payloadType: ::std::string::String, - pub signatures: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Envelope { - fn default() -> &'a Envelope { - ::default_instance() - } -} - -impl Envelope { - pub fn new() -> Envelope { - ::std::default::Default::default() - } - - // bytes payload = 1; - - - pub fn get_payload(&self) -> &[u8] { - &self.payload - } - pub fn clear_payload(&mut self) { - self.payload.clear(); - } - - // Param is passed by value, moved - pub fn set_payload(&mut self, v: ::std::vec::Vec) { - self.payload = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec { - &mut self.payload - } - - // Take field - pub fn take_payload(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.payload, ::std::vec::Vec::new()) - } - - // string payloadType = 2; - - - pub fn get_payloadType(&self) -> &str { - &self.payloadType - } - pub fn clear_payloadType(&mut self) { - self.payloadType.clear(); - } - - // Param is passed by value, moved - pub fn set_payloadType(&mut self, v: ::std::string::String) { - self.payloadType = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_payloadType(&mut self) -> &mut ::std::string::String { - &mut self.payloadType - } - - // Take field - pub fn take_payloadType(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.payloadType, ::std::string::String::new()) - } - - // repeated .io.intoto.Signature signatures = 3; - - - pub fn get_signatures(&self) -> &[Signature] { - &self.signatures - } - pub fn clear_signatures(&mut self) { - self.signatures.clear(); - } - - // Param is passed by value, moved - pub fn set_signatures(&mut self, v: ::protobuf::RepeatedField) { - self.signatures = v; - } - - // Mutable pointer to the field. - pub fn mut_signatures(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.signatures - } - - // Take field - pub fn take_signatures(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.signatures, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for Envelope { - fn is_initialized(&self) -> bool { - for v in &self.signatures { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.payload)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.payloadType)?; - }, - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.signatures)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.payload.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.payload); - } - if !self.payloadType.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.payloadType); - } - for value in &self.signatures { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.payload.is_empty() { - os.write_bytes(1, &self.payload)?; - } - if !self.payloadType.is_empty() { - os.write_string(2, &self.payloadType)?; - } - for v in &self.signatures { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Envelope { - Envelope::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "payload", - |m: &Envelope| { &m.payload }, - |m: &mut Envelope| { &mut m.payload }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "payloadType", - |m: &Envelope| { &m.payloadType }, - |m: &mut Envelope| { &mut m.payloadType }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "signatures", - |m: &Envelope| { &m.signatures }, - |m: &mut Envelope| { &mut m.signatures }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Envelope", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Envelope { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Envelope::new) - } -} - -impl ::protobuf::Clear for Envelope { - fn clear(&mut self) { - self.payload.clear(); - self.payloadType.clear(); - self.signatures.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Envelope { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Envelope { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Signature { - // message fields - pub sig: ::std::vec::Vec, - pub keyid: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Signature { - fn default() -> &'a Signature { - ::default_instance() - } -} - -impl Signature { - pub fn new() -> Signature { - ::std::default::Default::default() - } - - // bytes sig = 1; - - - pub fn get_sig(&self) -> &[u8] { - &self.sig - } - pub fn clear_sig(&mut self) { - self.sig.clear(); - } - - // Param is passed by value, moved - pub fn set_sig(&mut self, v: ::std::vec::Vec) { - self.sig = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_sig(&mut self) -> &mut ::std::vec::Vec { - &mut self.sig - } - - // Take field - pub fn take_sig(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.sig, ::std::vec::Vec::new()) - } - - // string keyid = 2; - - - pub fn get_keyid(&self) -> &str { - &self.keyid - } - pub fn clear_keyid(&mut self) { - self.keyid.clear(); - } - - // Param is passed by value, moved - pub fn set_keyid(&mut self, v: ::std::string::String) { - self.keyid = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_keyid(&mut self) -> &mut ::std::string::String { - &mut self.keyid - } - - // Take field - pub fn take_keyid(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.keyid, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for Signature { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.sig)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.keyid)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.sig.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.sig); - } - if !self.keyid.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.keyid); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.sig.is_empty() { - os.write_bytes(1, &self.sig)?; - } - if !self.keyid.is_empty() { - os.write_string(2, &self.keyid)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Signature { - Signature::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "sig", - |m: &Signature| { &m.sig }, - |m: &mut Signature| { &mut m.sig }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "keyid", - |m: &Signature| { &m.keyid }, - |m: &mut Signature| { &mut m.keyid }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Signature", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Signature { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Signature::new) - } -} - -impl ::protobuf::Clear for Signature { - fn clear(&mut self) { - self.sig.clear(); - self.keyid.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Signature { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Signature { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0eenvelope.proto\x12\tio.intoto\"|\n\x08Envelope\x12\x18\n\x07payloa\ - d\x18\x01\x20\x01(\x0cR\x07payload\x12\x20\n\x0bpayloadType\x18\x02\x20\ - \x01(\tR\x0bpayloadType\x124\n\nsignatures\x18\x03\x20\x03(\x0b2\x14.io.\ - intoto.SignatureR\nsignatures\"3\n\tSignature\x12\x10\n\x03sig\x18\x01\ - \x20\x01(\x0cR\x03sig\x12\x14\n\x05keyid\x18\x02\x20\x01(\tR\x05keyidBDZ\ - 1github.com/sigstore/protobuf-specs/gen/pb-go/dsse\xea\x02\x0eSigstore::\ - DSSEb\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/events.rs b/gen/pb-rust/src/events.rs deleted file mode 100644 index 2fb08ca0..00000000 --- a/gen/pb-rust/src/events.rs +++ /dev/null @@ -1,1341 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `events.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct CloudEvent { - // message fields - pub id: ::std::string::String, - pub source: ::std::string::String, - pub spec_version: ::std::string::String, - pub field_type: ::std::string::String, - pub attributes: ::std::collections::HashMap<::std::string::String, CloudEvent_CloudEventAttributeValue>, - // message oneof groups - pub data: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CloudEvent { - fn default() -> &'a CloudEvent { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum CloudEvent_oneof_data { - binary_data(::std::vec::Vec), - text_data(::std::string::String), - proto_data(::protobuf::well_known_types::Any), -} - -impl CloudEvent { - pub fn new() -> CloudEvent { - ::std::default::Default::default() - } - - // string id = 1; - - - pub fn get_id(&self) -> &str { - &self.id - } - pub fn clear_id(&mut self) { - self.id.clear(); - } - - // Param is passed by value, moved - pub fn set_id(&mut self, v: ::std::string::String) { - self.id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_id(&mut self) -> &mut ::std::string::String { - &mut self.id - } - - // Take field - pub fn take_id(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.id, ::std::string::String::new()) - } - - // string source = 2; - - - pub fn get_source(&self) -> &str { - &self.source - } - pub fn clear_source(&mut self) { - self.source.clear(); - } - - // Param is passed by value, moved - pub fn set_source(&mut self, v: ::std::string::String) { - self.source = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_source(&mut self) -> &mut ::std::string::String { - &mut self.source - } - - // Take field - pub fn take_source(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.source, ::std::string::String::new()) - } - - // string spec_version = 3; - - - pub fn get_spec_version(&self) -> &str { - &self.spec_version - } - pub fn clear_spec_version(&mut self) { - self.spec_version.clear(); - } - - // Param is passed by value, moved - pub fn set_spec_version(&mut self, v: ::std::string::String) { - self.spec_version = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_spec_version(&mut self) -> &mut ::std::string::String { - &mut self.spec_version - } - - // Take field - pub fn take_spec_version(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.spec_version, ::std::string::String::new()) - } - - // string type = 4; - - - pub fn get_field_type(&self) -> &str { - &self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type.clear(); - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: ::std::string::String) { - self.field_type = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_field_type(&mut self) -> &mut ::std::string::String { - &mut self.field_type - } - - // Take field - pub fn take_field_type(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.field_type, ::std::string::String::new()) - } - - // repeated .dev.sigstore.events.v1.CloudEvent.AttributesEntry attributes = 5; - - - pub fn get_attributes(&self) -> &::std::collections::HashMap<::std::string::String, CloudEvent_CloudEventAttributeValue> { - &self.attributes - } - pub fn clear_attributes(&mut self) { - self.attributes.clear(); - } - - // Param is passed by value, moved - pub fn set_attributes(&mut self, v: ::std::collections::HashMap<::std::string::String, CloudEvent_CloudEventAttributeValue>) { - self.attributes = v; - } - - // Mutable pointer to the field. - pub fn mut_attributes(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, CloudEvent_CloudEventAttributeValue> { - &mut self.attributes - } - - // Take field - pub fn take_attributes(&mut self) -> ::std::collections::HashMap<::std::string::String, CloudEvent_CloudEventAttributeValue> { - ::std::mem::replace(&mut self.attributes, ::std::collections::HashMap::new()) - } - - // bytes binary_data = 6; - - - pub fn get_binary_data(&self) -> &[u8] { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(ref v)) => v, - _ => &[], - } - } - pub fn clear_binary_data(&mut self) { - self.data = ::std::option::Option::None; - } - - pub fn has_binary_data(&self) -> bool { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_binary_data(&mut self, v: ::std::vec::Vec) { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(v)) - } - - // Mutable pointer to the field. - pub fn mut_binary_data(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(_)) = self.data { - } else { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(::std::vec::Vec::new())); - } - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_binary_data(&mut self) -> ::std::vec::Vec { - if self.has_binary_data() { - match self.data.take() { - ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } - - // string text_data = 7; - - - pub fn get_text_data(&self) -> &str { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::text_data(ref v)) => v, - _ => "", - } - } - pub fn clear_text_data(&mut self) { - self.data = ::std::option::Option::None; - } - - pub fn has_text_data(&self) -> bool { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::text_data(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_text_data(&mut self, v: ::std::string::String) { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::text_data(v)) - } - - // Mutable pointer to the field. - pub fn mut_text_data(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(CloudEvent_oneof_data::text_data(_)) = self.data { - } else { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::text_data(::std::string::String::new())); - } - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::text_data(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_text_data(&mut self) -> ::std::string::String { - if self.has_text_data() { - match self.data.take() { - ::std::option::Option::Some(CloudEvent_oneof_data::text_data(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // .google.protobuf.Any proto_data = 8; - - - pub fn get_proto_data(&self) -> &::protobuf::well_known_types::Any { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(ref v)) => v, - _ => <::protobuf::well_known_types::Any as ::protobuf::Message>::default_instance(), - } - } - pub fn clear_proto_data(&mut self) { - self.data = ::std::option::Option::None; - } - - pub fn has_proto_data(&self) -> bool { - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_proto_data(&mut self, v: ::protobuf::well_known_types::Any) { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(v)) - } - - // Mutable pointer to the field. - pub fn mut_proto_data(&mut self) -> &mut ::protobuf::well_known_types::Any { - if let ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(_)) = self.data { - } else { - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(::protobuf::well_known_types::Any::new())); - } - match self.data { - ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_proto_data(&mut self) -> ::protobuf::well_known_types::Any { - if self.has_proto_data() { - match self.data.take() { - ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(v)) => v, - _ => panic!(), - } - } else { - ::protobuf::well_known_types::Any::new() - } - } -} - -impl ::protobuf::Message for CloudEvent { - fn is_initialized(&self) -> bool { - if let Some(CloudEvent_oneof_data::proto_data(ref v)) = self.data { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.source)?; - }, - 3 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.spec_version)?; - }, - 4 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.field_type)?; - }, - 5 => { - ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.attributes)?; - }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::binary_data(is.read_bytes()?)); - }, - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::text_data(is.read_string()?)); - }, - 8 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.data = ::std::option::Option::Some(CloudEvent_oneof_data::proto_data(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.id.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.id); - } - if !self.source.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.source); - } - if !self.spec_version.is_empty() { - my_size += ::protobuf::rt::string_size(3, &self.spec_version); - } - if !self.field_type.is_empty() { - my_size += ::protobuf::rt::string_size(4, &self.field_type); - } - my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(5, &self.attributes); - if let ::std::option::Option::Some(ref v) = self.data { - match v { - &CloudEvent_oneof_data::binary_data(ref v) => { - my_size += ::protobuf::rt::bytes_size(6, &v); - }, - &CloudEvent_oneof_data::text_data(ref v) => { - my_size += ::protobuf::rt::string_size(7, &v); - }, - &CloudEvent_oneof_data::proto_data(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.id.is_empty() { - os.write_string(1, &self.id)?; - } - if !self.source.is_empty() { - os.write_string(2, &self.source)?; - } - if !self.spec_version.is_empty() { - os.write_string(3, &self.spec_version)?; - } - if !self.field_type.is_empty() { - os.write_string(4, &self.field_type)?; - } - ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(5, &self.attributes, os)?; - if let ::std::option::Option::Some(ref v) = self.data { - match v { - &CloudEvent_oneof_data::binary_data(ref v) => { - os.write_bytes(6, v)?; - }, - &CloudEvent_oneof_data::text_data(ref v) => { - os.write_string(7, v)?; - }, - &CloudEvent_oneof_data::proto_data(ref v) => { - os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CloudEvent { - CloudEvent::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "id", - |m: &CloudEvent| { &m.id }, - |m: &mut CloudEvent| { &mut m.id }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "source", - |m: &CloudEvent| { &m.source }, - |m: &mut CloudEvent| { &mut m.source }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "spec_version", - |m: &CloudEvent| { &m.spec_version }, - |m: &mut CloudEvent| { &mut m.spec_version }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "type", - |m: &CloudEvent| { &m.field_type }, - |m: &mut CloudEvent| { &mut m.field_type }, - )); - fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>( - "attributes", - |m: &CloudEvent| { &m.attributes }, - |m: &mut CloudEvent| { &mut m.attributes }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "binary_data", - CloudEvent::has_binary_data, - CloudEvent::get_binary_data, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "text_data", - CloudEvent::has_text_data, - CloudEvent::get_text_data, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ::protobuf::well_known_types::Any>( - "proto_data", - CloudEvent::has_proto_data, - CloudEvent::get_proto_data, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CloudEvent", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CloudEvent { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CloudEvent::new) - } -} - -impl ::protobuf::Clear for CloudEvent { - fn clear(&mut self) { - self.id.clear(); - self.source.clear(); - self.spec_version.clear(); - self.field_type.clear(); - self.attributes.clear(); - self.data = ::std::option::Option::None; - self.data = ::std::option::Option::None; - self.data = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CloudEvent { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CloudEvent { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CloudEvent_CloudEventAttributeValue { - // message oneof groups - pub attr: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CloudEvent_CloudEventAttributeValue { - fn default() -> &'a CloudEvent_CloudEventAttributeValue { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum CloudEvent_CloudEventAttributeValue_oneof_attr { - ce_boolean(bool), - ce_integer(i32), - ce_string(::std::string::String), - ce_bytes(::std::vec::Vec), - ce_uri(::std::string::String), - ce_uri_ref(::std::string::String), - ce_timestamp(::protobuf::well_known_types::Timestamp), -} - -impl CloudEvent_CloudEventAttributeValue { - pub fn new() -> CloudEvent_CloudEventAttributeValue { - ::std::default::Default::default() - } - - // bool ce_boolean = 1; - - - pub fn get_ce_boolean(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(v)) => v, - _ => false, - } - } - pub fn clear_ce_boolean(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_boolean(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_boolean(&mut self, v: bool) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(v)) - } - - // int32 ce_integer = 2; - - - pub fn get_ce_integer(&self) -> i32 { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(v)) => v, - _ => 0, - } - } - pub fn clear_ce_integer(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_integer(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_integer(&mut self, v: i32) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(v)) - } - - // string ce_string = 3; - - - pub fn get_ce_string(&self) -> &str { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(ref v)) => v, - _ => "", - } - } - pub fn clear_ce_string(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_string(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_string(&mut self, v: ::std::string::String) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(v)) - } - - // Mutable pointer to the field. - pub fn mut_ce_string(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(_)) = self.attr { - } else { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(::std::string::String::new())); - } - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ce_string(&mut self) -> ::std::string::String { - if self.has_ce_string() { - match self.attr.take() { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // bytes ce_bytes = 4; - - - pub fn get_ce_bytes(&self) -> &[u8] { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(ref v)) => v, - _ => &[], - } - } - pub fn clear_ce_bytes(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_bytes(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_bytes(&mut self, v: ::std::vec::Vec) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(v)) - } - - // Mutable pointer to the field. - pub fn mut_ce_bytes(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(_)) = self.attr { - } else { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(::std::vec::Vec::new())); - } - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ce_bytes(&mut self) -> ::std::vec::Vec { - if self.has_ce_bytes() { - match self.attr.take() { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } - - // string ce_uri = 5; - - - pub fn get_ce_uri(&self) -> &str { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(ref v)) => v, - _ => "", - } - } - pub fn clear_ce_uri(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_uri(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_uri(&mut self, v: ::std::string::String) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(v)) - } - - // Mutable pointer to the field. - pub fn mut_ce_uri(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(_)) = self.attr { - } else { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(::std::string::String::new())); - } - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ce_uri(&mut self) -> ::std::string::String { - if self.has_ce_uri() { - match self.attr.take() { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // string ce_uri_ref = 6; - - - pub fn get_ce_uri_ref(&self) -> &str { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(ref v)) => v, - _ => "", - } - } - pub fn clear_ce_uri_ref(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_uri_ref(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_uri_ref(&mut self, v: ::std::string::String) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(v)) - } - - // Mutable pointer to the field. - pub fn mut_ce_uri_ref(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(_)) = self.attr { - } else { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(::std::string::String::new())); - } - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ce_uri_ref(&mut self) -> ::std::string::String { - if self.has_ce_uri_ref() { - match self.attr.take() { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // .google.protobuf.Timestamp ce_timestamp = 7; - - - pub fn get_ce_timestamp(&self) -> &::protobuf::well_known_types::Timestamp { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(ref v)) => v, - _ => <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance(), - } - } - pub fn clear_ce_timestamp(&mut self) { - self.attr = ::std::option::Option::None; - } - - pub fn has_ce_timestamp(&self) -> bool { - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ce_timestamp(&mut self, v: ::protobuf::well_known_types::Timestamp) { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(v)) - } - - // Mutable pointer to the field. - pub fn mut_ce_timestamp(&mut self) -> &mut ::protobuf::well_known_types::Timestamp { - if let ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(_)) = self.attr { - } else { - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(::protobuf::well_known_types::Timestamp::new())); - } - match self.attr { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ce_timestamp(&mut self) -> ::protobuf::well_known_types::Timestamp { - if self.has_ce_timestamp() { - match self.attr.take() { - ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(v)) => v, - _ => panic!(), - } - } else { - ::protobuf::well_known_types::Timestamp::new() - } - } -} - -impl ::protobuf::Message for CloudEvent_CloudEventAttributeValue { - fn is_initialized(&self) -> bool { - if let Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(ref v)) = self.attr { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(is.read_bool()?)); - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(is.read_int32()?)); - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(is.read_string()?)); - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(is.read_bytes()?)); - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(is.read_string()?)); - }, - 6 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(is.read_string()?)); - }, - 7 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.attr = ::std::option::Option::Some(CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.attr { - match v { - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(v) => { - my_size += 2; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(v) => { - my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(ref v) => { - my_size += ::protobuf::rt::bytes_size(4, &v); - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(ref v) => { - my_size += ::protobuf::rt::string_size(5, &v); - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(ref v) => { - my_size += ::protobuf::rt::string_size(6, &v); - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.attr { - match v { - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_boolean(v) => { - os.write_bool(1, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_integer(v) => { - os.write_int32(2, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_string(ref v) => { - os.write_string(3, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_bytes(ref v) => { - os.write_bytes(4, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri(ref v) => { - os.write_string(5, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_uri_ref(ref v) => { - os.write_string(6, v)?; - }, - &CloudEvent_CloudEventAttributeValue_oneof_attr::ce_timestamp(ref v) => { - os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CloudEvent_CloudEventAttributeValue { - CloudEvent_CloudEventAttributeValue::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( - "ce_boolean", - CloudEvent_CloudEventAttributeValue::has_ce_boolean, - CloudEvent_CloudEventAttributeValue::get_ce_boolean, - )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>( - "ce_integer", - CloudEvent_CloudEventAttributeValue::has_ce_integer, - CloudEvent_CloudEventAttributeValue::get_ce_integer, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "ce_string", - CloudEvent_CloudEventAttributeValue::has_ce_string, - CloudEvent_CloudEventAttributeValue::get_ce_string, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "ce_bytes", - CloudEvent_CloudEventAttributeValue::has_ce_bytes, - CloudEvent_CloudEventAttributeValue::get_ce_bytes, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "ce_uri", - CloudEvent_CloudEventAttributeValue::has_ce_uri, - CloudEvent_CloudEventAttributeValue::get_ce_uri, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "ce_uri_ref", - CloudEvent_CloudEventAttributeValue::has_ce_uri_ref, - CloudEvent_CloudEventAttributeValue::get_ce_uri_ref, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ::protobuf::well_known_types::Timestamp>( - "ce_timestamp", - CloudEvent_CloudEventAttributeValue::has_ce_timestamp, - CloudEvent_CloudEventAttributeValue::get_ce_timestamp, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CloudEvent.CloudEventAttributeValue", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CloudEvent_CloudEventAttributeValue { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CloudEvent_CloudEventAttributeValue::new) - } -} - -impl ::protobuf::Clear for CloudEvent_CloudEventAttributeValue { - fn clear(&mut self) { - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.attr = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CloudEvent_CloudEventAttributeValue { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CloudEvent_CloudEventAttributeValue { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CloudEventBatch { - // message fields - pub events: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CloudEventBatch { - fn default() -> &'a CloudEventBatch { - ::default_instance() - } -} - -impl CloudEventBatch { - pub fn new() -> CloudEventBatch { - ::std::default::Default::default() - } - - // repeated .dev.sigstore.events.v1.CloudEvent events = 1; - - - pub fn get_events(&self) -> &[CloudEvent] { - &self.events - } - pub fn clear_events(&mut self) { - self.events.clear(); - } - - // Param is passed by value, moved - pub fn set_events(&mut self, v: ::protobuf::RepeatedField) { - self.events = v; - } - - // Mutable pointer to the field. - pub fn mut_events(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.events - } - - // Take field - pub fn take_events(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.events, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CloudEventBatch { - fn is_initialized(&self) -> bool { - for v in &self.events { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.events)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.events { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.events { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CloudEventBatch { - CloudEventBatch::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "events", - |m: &CloudEventBatch| { &m.events }, - |m: &mut CloudEventBatch| { &mut m.events }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CloudEventBatch", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CloudEventBatch { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CloudEventBatch::new) - } -} - -impl ::protobuf::Clear for CloudEventBatch { - fn clear(&mut self) { - self.events.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CloudEventBatch { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CloudEventBatch { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0cevents.proto\x12\x16dev.sigstore.events.v1\x1a\x19google/protobuf/\ - any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\x05\n\nCloudEvent\ - \x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x16\n\x06source\x18\x02\ - \x20\x01(\tR\x06source\x12!\n\x0cspec_version\x18\x03\x20\x01(\tR\x0bspe\ - cVersion\x12\x12\n\x04type\x18\x04\x20\x01(\tR\x04type\x12R\n\nattribute\ - s\x18\x05\x20\x03(\x0b22.dev.sigstore.events.v1.CloudEvent.AttributesEnt\ - ryR\nattributes\x12!\n\x0bbinary_data\x18\x06\x20\x01(\x0cH\0R\nbinaryDa\ - ta\x12\x1d\n\ttext_data\x18\x07\x20\x01(\tH\0R\x08textData\x125\n\nproto\ - _data\x18\x08\x20\x01(\x0b2\x14.google.protobuf.AnyH\0R\tprotoData\x1az\ - \n\x0fAttributesEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12Q\n\ - \x05value\x18\x02\x20\x01(\x0b2;.dev.sigstore.events.v1.CloudEvent.Cloud\ - EventAttributeValueR\x05value:\x028\x01\x1a\x9a\x02\n\x18CloudEventAttri\ - buteValue\x12\x1f\n\nce_boolean\x18\x01\x20\x01(\x08H\0R\tceBoolean\x12\ - \x1f\n\nce_integer\x18\x02\x20\x01(\x05H\0R\tceInteger\x12\x1d\n\tce_str\ - ing\x18\x03\x20\x01(\tH\0R\x08ceString\x12\x1b\n\x08ce_bytes\x18\x04\x20\ - \x01(\x0cH\0R\x07ceBytes\x12\x17\n\x06ce_uri\x18\x05\x20\x01(\tH\0R\x05c\ - eUri\x12\x1e\n\nce_uri_ref\x18\x06\x20\x01(\tH\0R\x08ceUriRef\x12?\n\x0c\ - ce_timestamp\x18\x07\x20\x01(\x0b2\x1a.google.protobuf.TimestampH\0R\x0b\ - ceTimestampB\x06\n\x04attrB\x06\n\x04data\"M\n\x0fCloudEventBatch\x12:\n\ - \x06events\x18\x01\x20\x03(\x0b2\".dev.sigstore.events.v1.CloudEventR\ - \x06eventsBX\n\x1cdev.sigstore.proto.events.v1P\x01Z6github.com/sigstore\ - /protobuf-specs/gen/pb-go/events/v1b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/lib.rs b/gen/pb-rust/src/lib.rs new file mode 100644 index 00000000..5f903d21 --- /dev/null +++ b/gen/pb-rust/src/lib.rs @@ -0,0 +1,14 @@ +use schemafy_core; +use serde; +use serde_json; + +use serde::{Deserialize, Serialize}; + +pub mod sigstore { + pub mod verification { + pub mod v1 { + use super::super::super::*; + schemafy::schemafy!("schema/Artifact.schema.json"); + } + } +} diff --git a/gen/pb-rust/src/mod.rs b/gen/pb-rust/src/mod.rs deleted file mode 100644 index ccb40d56..00000000 --- a/gen/pb-rust/src/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -// @generated - -pub mod envelope; -pub mod events; -pub mod sigstore_bundle; -pub mod sigstore_common; -pub mod sigstore_rekor; -pub mod sigstore_trustroot; -pub mod sigstore_verification; diff --git a/gen/pb-rust/src/sigstore_bundle.rs b/gen/pb-rust/src/sigstore_bundle.rs deleted file mode 100644 index dd0c696b..00000000 --- a/gen/pb-rust/src/sigstore_bundle.rs +++ /dev/null @@ -1,998 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `sigstore_bundle.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct TimestampVerificationData { - // message fields - pub rfc3161_timestamps: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TimestampVerificationData { - fn default() -> &'a TimestampVerificationData { - ::default_instance() - } -} - -impl TimestampVerificationData { - pub fn new() -> TimestampVerificationData { - ::std::default::Default::default() - } - - // repeated .dev.sigstore.common.v1.RFC3161SignedTimestamp rfc3161_timestamps = 1; - - - pub fn get_rfc3161_timestamps(&self) -> &[super::sigstore_common::RFC3161SignedTimestamp] { - &self.rfc3161_timestamps - } - pub fn clear_rfc3161_timestamps(&mut self) { - self.rfc3161_timestamps.clear(); - } - - // Param is passed by value, moved - pub fn set_rfc3161_timestamps(&mut self, v: ::protobuf::RepeatedField) { - self.rfc3161_timestamps = v; - } - - // Mutable pointer to the field. - pub fn mut_rfc3161_timestamps(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.rfc3161_timestamps - } - - // Take field - pub fn take_rfc3161_timestamps(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.rfc3161_timestamps, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TimestampVerificationData { - fn is_initialized(&self) -> bool { - for v in &self.rfc3161_timestamps { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.rfc3161_timestamps)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.rfc3161_timestamps { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.rfc3161_timestamps { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TimestampVerificationData { - TimestampVerificationData::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "rfc3161_timestamps", - |m: &TimestampVerificationData| { &m.rfc3161_timestamps }, - |m: &mut TimestampVerificationData| { &mut m.rfc3161_timestamps }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TimestampVerificationData", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static TimestampVerificationData { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TimestampVerificationData::new) - } -} - -impl ::protobuf::Clear for TimestampVerificationData { - fn clear(&mut self) { - self.rfc3161_timestamps.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TimestampVerificationData { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TimestampVerificationData { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct VerificationMaterial { - // message fields - pub tlog_entries: ::protobuf::RepeatedField, - pub timestamp_verification_data: ::protobuf::SingularPtrField, - // message oneof groups - pub content: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a VerificationMaterial { - fn default() -> &'a VerificationMaterial { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum VerificationMaterial_oneof_content { - public_key(super::sigstore_common::PublicKeyIdentifier), - x509_certificate_chain(super::sigstore_common::X509CertificateChain), -} - -impl VerificationMaterial { - pub fn new() -> VerificationMaterial { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.PublicKeyIdentifier public_key = 1; - - - pub fn get_public_key(&self) -> &super::sigstore_common::PublicKeyIdentifier { - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_public_key(&mut self) { - self.content = ::std::option::Option::None; - } - - pub fn has_public_key(&self) -> bool { - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_public_key(&mut self, v: super::sigstore_common::PublicKeyIdentifier) { - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(v)) - } - - // Mutable pointer to the field. - pub fn mut_public_key(&mut self) -> &mut super::sigstore_common::PublicKeyIdentifier { - if let ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(_)) = self.content { - } else { - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(super::sigstore_common::PublicKeyIdentifier::new())); - } - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_public_key(&mut self) -> super::sigstore_common::PublicKeyIdentifier { - if self.has_public_key() { - match self.content.take() { - ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(v)) => v, - _ => panic!(), - } - } else { - super::sigstore_common::PublicKeyIdentifier::new() - } - } - - // .dev.sigstore.common.v1.X509CertificateChain x509_certificate_chain = 2; - - - pub fn get_x509_certificate_chain(&self) -> &super::sigstore_common::X509CertificateChain { - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_x509_certificate_chain(&mut self) { - self.content = ::std::option::Option::None; - } - - pub fn has_x509_certificate_chain(&self) -> bool { - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_x509_certificate_chain(&mut self, v: super::sigstore_common::X509CertificateChain) { - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(v)) - } - - // Mutable pointer to the field. - pub fn mut_x509_certificate_chain(&mut self) -> &mut super::sigstore_common::X509CertificateChain { - if let ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(_)) = self.content { - } else { - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(super::sigstore_common::X509CertificateChain::new())); - } - match self.content { - ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_x509_certificate_chain(&mut self) -> super::sigstore_common::X509CertificateChain { - if self.has_x509_certificate_chain() { - match self.content.take() { - ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(v)) => v, - _ => panic!(), - } - } else { - super::sigstore_common::X509CertificateChain::new() - } - } - - // repeated .dev.sigstore.rekor.v1.TransparencyLogEntry tlog_entries = 3; - - - pub fn get_tlog_entries(&self) -> &[super::sigstore_rekor::TransparencyLogEntry] { - &self.tlog_entries - } - pub fn clear_tlog_entries(&mut self) { - self.tlog_entries.clear(); - } - - // Param is passed by value, moved - pub fn set_tlog_entries(&mut self, v: ::protobuf::RepeatedField) { - self.tlog_entries = v; - } - - // Mutable pointer to the field. - pub fn mut_tlog_entries(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.tlog_entries - } - - // Take field - pub fn take_tlog_entries(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.tlog_entries, ::protobuf::RepeatedField::new()) - } - - // .dev.sigstore.bundle.v1.TimestampVerificationData timestamp_verification_data = 4; - - - pub fn get_timestamp_verification_data(&self) -> &TimestampVerificationData { - self.timestamp_verification_data.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_timestamp_verification_data(&mut self) { - self.timestamp_verification_data.clear(); - } - - pub fn has_timestamp_verification_data(&self) -> bool { - self.timestamp_verification_data.is_some() - } - - // Param is passed by value, moved - pub fn set_timestamp_verification_data(&mut self, v: TimestampVerificationData) { - self.timestamp_verification_data = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_timestamp_verification_data(&mut self) -> &mut TimestampVerificationData { - if self.timestamp_verification_data.is_none() { - self.timestamp_verification_data.set_default(); - } - self.timestamp_verification_data.as_mut().unwrap() - } - - // Take field - pub fn take_timestamp_verification_data(&mut self) -> TimestampVerificationData { - self.timestamp_verification_data.take().unwrap_or_else(|| TimestampVerificationData::new()) - } -} - -impl ::protobuf::Message for VerificationMaterial { - fn is_initialized(&self) -> bool { - if let Some(VerificationMaterial_oneof_content::public_key(ref v)) = self.content { - if !v.is_initialized() { - return false; - } - } - if let Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref v)) = self.content { - if !v.is_initialized() { - return false; - } - } - for v in &self.tlog_entries { - if !v.is_initialized() { - return false; - } - }; - for v in &self.timestamp_verification_data { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(is.read_message()?)); - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(is.read_message()?)); - }, - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tlog_entries)?; - }, - 4 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.timestamp_verification_data)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.tlog_entries { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - if let Some(ref v) = self.timestamp_verification_data.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self.content { - match v { - &VerificationMaterial_oneof_content::public_key(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - &VerificationMaterial_oneof_content::x509_certificate_chain(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.tlog_entries { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - if let Some(ref v) = self.timestamp_verification_data.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self.content { - match v { - &VerificationMaterial_oneof_content::public_key(ref v) => { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - &VerificationMaterial_oneof_content::x509_certificate_chain(ref v) => { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> VerificationMaterial { - VerificationMaterial::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::PublicKeyIdentifier>( - "public_key", - VerificationMaterial::has_public_key, - VerificationMaterial::get_public_key, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::X509CertificateChain>( - "x509_certificate_chain", - VerificationMaterial::has_x509_certificate_chain, - VerificationMaterial::get_x509_certificate_chain, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "tlog_entries", - |m: &VerificationMaterial| { &m.tlog_entries }, - |m: &mut VerificationMaterial| { &mut m.tlog_entries }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "timestamp_verification_data", - |m: &VerificationMaterial| { &m.timestamp_verification_data }, - |m: &mut VerificationMaterial| { &mut m.timestamp_verification_data }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "VerificationMaterial", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static VerificationMaterial { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(VerificationMaterial::new) - } -} - -impl ::protobuf::Clear for VerificationMaterial { - fn clear(&mut self) { - self.content = ::std::option::Option::None; - self.content = ::std::option::Option::None; - self.tlog_entries.clear(); - self.timestamp_verification_data.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for VerificationMaterial { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for VerificationMaterial { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Bundle { - // message fields - pub media_type: ::std::string::String, - pub verification_material: ::protobuf::SingularPtrField, - // message oneof groups - pub content: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Bundle { - fn default() -> &'a Bundle { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum Bundle_oneof_content { - message_signature(super::sigstore_common::MessageSignature), - dsse_envelope(super::envelope::Envelope), -} - -impl Bundle { - pub fn new() -> Bundle { - ::std::default::Default::default() - } - - // string media_type = 1; - - - pub fn get_media_type(&self) -> &str { - &self.media_type - } - pub fn clear_media_type(&mut self) { - self.media_type.clear(); - } - - // Param is passed by value, moved - pub fn set_media_type(&mut self, v: ::std::string::String) { - self.media_type = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_media_type(&mut self) -> &mut ::std::string::String { - &mut self.media_type - } - - // Take field - pub fn take_media_type(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.media_type, ::std::string::String::new()) - } - - // .dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2; - - - pub fn get_verification_material(&self) -> &VerificationMaterial { - self.verification_material.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_verification_material(&mut self) { - self.verification_material.clear(); - } - - pub fn has_verification_material(&self) -> bool { - self.verification_material.is_some() - } - - // Param is passed by value, moved - pub fn set_verification_material(&mut self, v: VerificationMaterial) { - self.verification_material = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_verification_material(&mut self) -> &mut VerificationMaterial { - if self.verification_material.is_none() { - self.verification_material.set_default(); - } - self.verification_material.as_mut().unwrap() - } - - // Take field - pub fn take_verification_material(&mut self) -> VerificationMaterial { - self.verification_material.take().unwrap_or_else(|| VerificationMaterial::new()) - } - - // .dev.sigstore.common.v1.MessageSignature message_signature = 3; - - - pub fn get_message_signature(&self) -> &super::sigstore_common::MessageSignature { - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::message_signature(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_message_signature(&mut self) { - self.content = ::std::option::Option::None; - } - - pub fn has_message_signature(&self) -> bool { - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::message_signature(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_message_signature(&mut self, v: super::sigstore_common::MessageSignature) { - self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(v)) - } - - // Mutable pointer to the field. - pub fn mut_message_signature(&mut self) -> &mut super::sigstore_common::MessageSignature { - if let ::std::option::Option::Some(Bundle_oneof_content::message_signature(_)) = self.content { - } else { - self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(super::sigstore_common::MessageSignature::new())); - } - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::message_signature(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_message_signature(&mut self) -> super::sigstore_common::MessageSignature { - if self.has_message_signature() { - match self.content.take() { - ::std::option::Option::Some(Bundle_oneof_content::message_signature(v)) => v, - _ => panic!(), - } - } else { - super::sigstore_common::MessageSignature::new() - } - } - - // .io.intoto.Envelope dsse_envelope = 4; - - - pub fn get_dsse_envelope(&self) -> &super::envelope::Envelope { - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_dsse_envelope(&mut self) { - self.content = ::std::option::Option::None; - } - - pub fn has_dsse_envelope(&self) -> bool { - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_dsse_envelope(&mut self, v: super::envelope::Envelope) { - self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(v)) - } - - // Mutable pointer to the field. - pub fn mut_dsse_envelope(&mut self) -> &mut super::envelope::Envelope { - if let ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(_)) = self.content { - } else { - self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(super::envelope::Envelope::new())); - } - match self.content { - ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_dsse_envelope(&mut self) -> super::envelope::Envelope { - if self.has_dsse_envelope() { - match self.content.take() { - ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(v)) => v, - _ => panic!(), - } - } else { - super::envelope::Envelope::new() - } - } -} - -impl ::protobuf::Message for Bundle { - fn is_initialized(&self) -> bool { - for v in &self.verification_material { - if !v.is_initialized() { - return false; - } - }; - if let Some(Bundle_oneof_content::message_signature(ref v)) = self.content { - if !v.is_initialized() { - return false; - } - } - if let Some(Bundle_oneof_content::dsse_envelope(ref v)) = self.content { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.media_type)?; - }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.verification_material)?; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(is.read_message()?)); - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.media_type.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.media_type); - } - if let Some(ref v) = self.verification_material.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self.content { - match v { - &Bundle_oneof_content::message_signature(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - &Bundle_oneof_content::dsse_envelope(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.media_type.is_empty() { - os.write_string(1, &self.media_type)?; - } - if let Some(ref v) = self.verification_material.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self.content { - match v { - &Bundle_oneof_content::message_signature(ref v) => { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - &Bundle_oneof_content::dsse_envelope(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Bundle { - Bundle::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "media_type", - |m: &Bundle| { &m.media_type }, - |m: &mut Bundle| { &mut m.media_type }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "verification_material", - |m: &Bundle| { &m.verification_material }, - |m: &mut Bundle| { &mut m.verification_material }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::MessageSignature>( - "message_signature", - Bundle::has_message_signature, - Bundle::get_message_signature, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::envelope::Envelope>( - "dsse_envelope", - Bundle::has_dsse_envelope, - Bundle::get_dsse_envelope, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Bundle", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Bundle { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Bundle::new) - } -} - -impl ::protobuf::Clear for Bundle { - fn clear(&mut self) { - self.media_type.clear(); - self.verification_material.clear(); - self.content = ::std::option::Option::None; - self.content = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Bundle { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Bundle { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x15sigstore_bundle.proto\x12\x16dev.sigstore.bundle.v1\x1a\x1fgoogle/\ - api/field_behavior.proto\x1a\x0eenvelope.proto\x1a\x15sigstore_common.pr\ - oto\x1a\x14sigstore_rekor.proto\"z\n\x19TimestampVerificationData\x12]\n\ - \x12rfc3161_timestamps\x18\x01\x20\x03(\x0b2..dev.sigstore.common.v1.RFC\ - 3161SignedTimestampR\x11rfc3161Timestamps\"\xa2\x03\n\x14VerificationMat\ - erial\x12Q\n\npublic_key\x18\x01\x20\x01(\x0b2+.dev.sigstore.common.v1.P\ - ublicKeyIdentifierH\0R\tpublicKeyB\x03\xe0A\x02\x12i\n\x16x509_certifica\ - te_chain\x18\x02\x20\x01(\x0b2,.dev.sigstore.common.v1.X509CertificateCh\ - ainH\0R\x14x509CertificateChainB\x03\xe0A\x02\x12N\n\x0ctlog_entries\x18\ - \x03\x20\x03(\x0b2+.dev.sigstore.rekor.v1.TransparencyLogEntryR\x0btlogE\ - ntries\x12q\n\x1btimestamp_verification_data\x18\x04\x20\x01(\x0b21.dev.\ - sigstore.bundle.v1.TimestampVerificationDataR\x19timestampVerificationDa\ - taB\t\n\x07content\"\xbf\x02\n\x06Bundle\x12\x1d\n\nmedia_type\x18\x01\ - \x20\x01(\tR\tmediaType\x12f\n\x15verification_material\x18\x02\x20\x01(\ - \x0b2,.dev.sigstore.bundle.v1.VerificationMaterialR\x14verificationMater\ - ialB\x03\xe0A\x02\x12\\\n\x11message_signature\x18\x03\x20\x01(\x0b2(.de\ - v.sigstore.common.v1.MessageSignatureH\0R\x10messageSignatureB\x03\xe0A\ - \x02\x12?\n\rdsse_envelope\x18\x04\x20\x01(\x0b2\x13.io.intoto.EnvelopeH\ - \0R\x0cdsseEnvelopeB\x03\xe0A\x02B\t\n\x07contentJ\x04\x08\x05\x103B|\n\ - \x1cdev.sigstore.proto.bundle.v1B\x0bBundleProtoP\x01Z6github.com/sigsto\ - re/protobuf-specs/gen/pb-go/bundle/v1\xea\x02\x14Sigstore::Bundle::V1b\ - \x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/sigstore_common.rs b/gen/pb-rust/src/sigstore_common.rs deleted file mode 100644 index c9070e01..00000000 --- a/gen/pb-rust/src/sigstore_common.rs +++ /dev/null @@ -1,2919 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `sigstore_common.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct HashOutput { - // message fields - pub algorithm: HashAlgorithm, - pub digest: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a HashOutput { - fn default() -> &'a HashOutput { - ::default_instance() - } -} - -impl HashOutput { - pub fn new() -> HashOutput { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.HashAlgorithm algorithm = 1; - - - pub fn get_algorithm(&self) -> HashAlgorithm { - self.algorithm - } - pub fn clear_algorithm(&mut self) { - self.algorithm = HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; - } - - // Param is passed by value, moved - pub fn set_algorithm(&mut self, v: HashAlgorithm) { - self.algorithm = v; - } - - // bytes digest = 2; - - - pub fn get_digest(&self) -> &[u8] { - &self.digest - } - pub fn clear_digest(&mut self) { - self.digest.clear(); - } - - // Param is passed by value, moved - pub fn set_digest(&mut self, v: ::std::vec::Vec) { - self.digest = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_digest(&mut self) -> &mut ::std::vec::Vec { - &mut self.digest - } - - // Take field - pub fn take_digest(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.digest, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for HashOutput { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.algorithm, 1, &mut self.unknown_fields)? - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.digest)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.algorithm != HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { - my_size += ::protobuf::rt::enum_size(1, self.algorithm); - } - if !self.digest.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.digest); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.algorithm != HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.algorithm))?; - } - if !self.digest.is_empty() { - os.write_bytes(2, &self.digest)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> HashOutput { - HashOutput::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "algorithm", - |m: &HashOutput| { &m.algorithm }, - |m: &mut HashOutput| { &mut m.algorithm }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "digest", - |m: &HashOutput| { &m.digest }, - |m: &mut HashOutput| { &mut m.digest }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "HashOutput", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static HashOutput { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(HashOutput::new) - } -} - -impl ::protobuf::Clear for HashOutput { - fn clear(&mut self) { - self.algorithm = HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; - self.digest.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for HashOutput { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for HashOutput { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct MessageSignature { - // message fields - pub message_digest: ::protobuf::SingularPtrField, - pub signature: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a MessageSignature { - fn default() -> &'a MessageSignature { - ::default_instance() - } -} - -impl MessageSignature { - pub fn new() -> MessageSignature { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.HashOutput message_digest = 1; - - - pub fn get_message_digest(&self) -> &HashOutput { - self.message_digest.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_message_digest(&mut self) { - self.message_digest.clear(); - } - - pub fn has_message_digest(&self) -> bool { - self.message_digest.is_some() - } - - // Param is passed by value, moved - pub fn set_message_digest(&mut self, v: HashOutput) { - self.message_digest = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_message_digest(&mut self) -> &mut HashOutput { - if self.message_digest.is_none() { - self.message_digest.set_default(); - } - self.message_digest.as_mut().unwrap() - } - - // Take field - pub fn take_message_digest(&mut self) -> HashOutput { - self.message_digest.take().unwrap_or_else(|| HashOutput::new()) - } - - // bytes signature = 2; - - - pub fn get_signature(&self) -> &[u8] { - &self.signature - } - pub fn clear_signature(&mut self) { - self.signature.clear(); - } - - // Param is passed by value, moved - pub fn set_signature(&mut self, v: ::std::vec::Vec) { - self.signature = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { - &mut self.signature - } - - // Take field - pub fn take_signature(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.signature, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for MessageSignature { - fn is_initialized(&self) -> bool { - for v in &self.message_digest { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.message_digest)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signature)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.message_digest.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.signature.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.signature); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.message_digest.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.signature.is_empty() { - os.write_bytes(2, &self.signature)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> MessageSignature { - MessageSignature::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "message_digest", - |m: &MessageSignature| { &m.message_digest }, - |m: &mut MessageSignature| { &mut m.message_digest }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "signature", - |m: &MessageSignature| { &m.signature }, - |m: &mut MessageSignature| { &mut m.signature }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "MessageSignature", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static MessageSignature { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(MessageSignature::new) - } -} - -impl ::protobuf::Clear for MessageSignature { - fn clear(&mut self) { - self.message_digest.clear(); - self.signature.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for MessageSignature { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for MessageSignature { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct LogId { - // message fields - pub key_id: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a LogId { - fn default() -> &'a LogId { - ::default_instance() - } -} - -impl LogId { - pub fn new() -> LogId { - ::std::default::Default::default() - } - - // bytes key_id = 1; - - - pub fn get_key_id(&self) -> &[u8] { - &self.key_id - } - pub fn clear_key_id(&mut self) { - self.key_id.clear(); - } - - // Param is passed by value, moved - pub fn set_key_id(&mut self, v: ::std::vec::Vec) { - self.key_id = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_key_id(&mut self) -> &mut ::std::vec::Vec { - &mut self.key_id - } - - // Take field - pub fn take_key_id(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.key_id, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for LogId { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.key_id)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.key_id.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.key_id); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.key_id.is_empty() { - os.write_bytes(1, &self.key_id)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> LogId { - LogId::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "key_id", - |m: &LogId| { &m.key_id }, - |m: &mut LogId| { &mut m.key_id }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "LogId", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static LogId { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(LogId::new) - } -} - -impl ::protobuf::Clear for LogId { - fn clear(&mut self) { - self.key_id.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for LogId { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for LogId { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct RFC3161SignedTimestamp { - // message fields - pub signed_timestamp: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a RFC3161SignedTimestamp { - fn default() -> &'a RFC3161SignedTimestamp { - ::default_instance() - } -} - -impl RFC3161SignedTimestamp { - pub fn new() -> RFC3161SignedTimestamp { - ::std::default::Default::default() - } - - // bytes signed_timestamp = 1; - - - pub fn get_signed_timestamp(&self) -> &[u8] { - &self.signed_timestamp - } - pub fn clear_signed_timestamp(&mut self) { - self.signed_timestamp.clear(); - } - - // Param is passed by value, moved - pub fn set_signed_timestamp(&mut self, v: ::std::vec::Vec) { - self.signed_timestamp = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_signed_timestamp(&mut self) -> &mut ::std::vec::Vec { - &mut self.signed_timestamp - } - - // Take field - pub fn take_signed_timestamp(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.signed_timestamp, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for RFC3161SignedTimestamp { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signed_timestamp)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.signed_timestamp.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.signed_timestamp); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.signed_timestamp.is_empty() { - os.write_bytes(1, &self.signed_timestamp)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> RFC3161SignedTimestamp { - RFC3161SignedTimestamp::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "signed_timestamp", - |m: &RFC3161SignedTimestamp| { &m.signed_timestamp }, - |m: &mut RFC3161SignedTimestamp| { &mut m.signed_timestamp }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "RFC3161SignedTimestamp", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static RFC3161SignedTimestamp { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(RFC3161SignedTimestamp::new) - } -} - -impl ::protobuf::Clear for RFC3161SignedTimestamp { - fn clear(&mut self) { - self.signed_timestamp.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for RFC3161SignedTimestamp { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for RFC3161SignedTimestamp { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PublicKey { - // message fields - pub key_details: PublicKeyDetails, - // message oneof groups - pub _raw_bytes: ::std::option::Option, - pub _valid_for: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a PublicKey { - fn default() -> &'a PublicKey { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum PublicKey_oneof__raw_bytes { - raw_bytes(::std::vec::Vec), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum PublicKey_oneof__valid_for { - valid_for(TimeRange), -} - -impl PublicKey { - pub fn new() -> PublicKey { - ::std::default::Default::default() - } - - // bytes raw_bytes = 1; - - - pub fn get_raw_bytes(&self) -> &[u8] { - match self._raw_bytes { - ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(ref v)) => v, - _ => &[], - } - } - pub fn clear_raw_bytes(&mut self) { - self._raw_bytes = ::std::option::Option::None; - } - - pub fn has_raw_bytes(&self) -> bool { - match self._raw_bytes { - ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_raw_bytes(&mut self, v: ::std::vec::Vec) { - self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(v)) - } - - // Mutable pointer to the field. - pub fn mut_raw_bytes(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(_)) = self._raw_bytes { - } else { - self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(::std::vec::Vec::new())); - } - match self._raw_bytes { - ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_raw_bytes(&mut self) -> ::std::vec::Vec { - if self.has_raw_bytes() { - match self._raw_bytes.take() { - ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } - - // .dev.sigstore.common.v1.PublicKeyDetails key_details = 2; - - - pub fn get_key_details(&self) -> PublicKeyDetails { - self.key_details - } - pub fn clear_key_details(&mut self) { - self.key_details = PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED; - } - - // Param is passed by value, moved - pub fn set_key_details(&mut self, v: PublicKeyDetails) { - self.key_details = v; - } - - // .dev.sigstore.common.v1.TimeRange valid_for = 3; - - - pub fn get_valid_for(&self) -> &TimeRange { - match self._valid_for { - ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_valid_for(&mut self) { - self._valid_for = ::std::option::Option::None; - } - - pub fn has_valid_for(&self) -> bool { - match self._valid_for { - ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_valid_for(&mut self, v: TimeRange) { - self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(v)) - } - - // Mutable pointer to the field. - pub fn mut_valid_for(&mut self) -> &mut TimeRange { - if let ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(_)) = self._valid_for { - } else { - self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(TimeRange::new())); - } - match self._valid_for { - ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_valid_for(&mut self) -> TimeRange { - if self.has_valid_for() { - match self._valid_for.take() { - ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(v)) => v, - _ => panic!(), - } - } else { - TimeRange::new() - } - } -} - -impl ::protobuf::Message for PublicKey { - fn is_initialized(&self) -> bool { - if let Some(PublicKey_oneof__valid_for::valid_for(ref v)) = self._valid_for { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(is.read_bytes()?)); - }, - 2 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.key_details, 2, &mut self.unknown_fields)? - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.key_details != PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED { - my_size += ::protobuf::rt::enum_size(2, self.key_details); - } - if let ::std::option::Option::Some(ref v) = self._raw_bytes { - match v { - &PublicKey_oneof__raw_bytes::raw_bytes(ref v) => { - my_size += ::protobuf::rt::bytes_size(1, &v); - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._valid_for { - match v { - &PublicKey_oneof__valid_for::valid_for(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.key_details != PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED { - os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.key_details))?; - } - if let ::std::option::Option::Some(ref v) = self._raw_bytes { - match v { - &PublicKey_oneof__raw_bytes::raw_bytes(ref v) => { - os.write_bytes(1, v)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._valid_for { - match v { - &PublicKey_oneof__valid_for::valid_for(ref v) => { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublicKey { - PublicKey::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "raw_bytes", - PublicKey::has_raw_bytes, - PublicKey::get_raw_bytes, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "key_details", - |m: &PublicKey| { &m.key_details }, - |m: &mut PublicKey| { &mut m.key_details }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, TimeRange>( - "valid_for", - PublicKey::has_valid_for, - PublicKey::get_valid_for, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "PublicKey", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static PublicKey { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(PublicKey::new) - } -} - -impl ::protobuf::Clear for PublicKey { - fn clear(&mut self) { - self._raw_bytes = ::std::option::Option::None; - self.key_details = PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED; - self._valid_for = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublicKey { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublicKey { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PublicKeyIdentifier { - // message fields - pub hint: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a PublicKeyIdentifier { - fn default() -> &'a PublicKeyIdentifier { - ::default_instance() - } -} - -impl PublicKeyIdentifier { - pub fn new() -> PublicKeyIdentifier { - ::std::default::Default::default() - } - - // string hint = 1; - - - pub fn get_hint(&self) -> &str { - &self.hint - } - pub fn clear_hint(&mut self) { - self.hint.clear(); - } - - // Param is passed by value, moved - pub fn set_hint(&mut self, v: ::std::string::String) { - self.hint = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_hint(&mut self) -> &mut ::std::string::String { - &mut self.hint - } - - // Take field - pub fn take_hint(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.hint, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for PublicKeyIdentifier { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hint)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.hint.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.hint); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.hint.is_empty() { - os.write_string(1, &self.hint)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublicKeyIdentifier { - PublicKeyIdentifier::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "hint", - |m: &PublicKeyIdentifier| { &m.hint }, - |m: &mut PublicKeyIdentifier| { &mut m.hint }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "PublicKeyIdentifier", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static PublicKeyIdentifier { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(PublicKeyIdentifier::new) - } -} - -impl ::protobuf::Clear for PublicKeyIdentifier { - fn clear(&mut self) { - self.hint.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublicKeyIdentifier { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublicKeyIdentifier { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ObjectIdentifier { - // message fields - pub id: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ObjectIdentifier { - fn default() -> &'a ObjectIdentifier { - ::default_instance() - } -} - -impl ObjectIdentifier { - pub fn new() -> ObjectIdentifier { - ::std::default::Default::default() - } - - // repeated int32 id = 1; - - - pub fn get_id(&self) -> &[i32] { - &self.id - } - pub fn clear_id(&mut self) { - self.id.clear(); - } - - // Param is passed by value, moved - pub fn set_id(&mut self, v: ::std::vec::Vec) { - self.id = v; - } - - // Mutable pointer to the field. - pub fn mut_id(&mut self) -> &mut ::std::vec::Vec { - &mut self.id - } - - // Take field - pub fn take_id(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.id, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for ObjectIdentifier { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.id)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.id { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.id { - os.write_int32(1, *v)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ObjectIdentifier { - ObjectIdentifier::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "id", - |m: &ObjectIdentifier| { &m.id }, - |m: &mut ObjectIdentifier| { &mut m.id }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ObjectIdentifier", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ObjectIdentifier { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ObjectIdentifier::new) - } -} - -impl ::protobuf::Clear for ObjectIdentifier { - fn clear(&mut self) { - self.id.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ObjectIdentifier { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ObjectIdentifier { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ObjectIdentifierValuePair { - // message fields - pub oid: ::protobuf::SingularPtrField, - pub value: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ObjectIdentifierValuePair { - fn default() -> &'a ObjectIdentifierValuePair { - ::default_instance() - } -} - -impl ObjectIdentifierValuePair { - pub fn new() -> ObjectIdentifierValuePair { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.ObjectIdentifier oid = 1; - - - pub fn get_oid(&self) -> &ObjectIdentifier { - self.oid.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_oid(&mut self) { - self.oid.clear(); - } - - pub fn has_oid(&self) -> bool { - self.oid.is_some() - } - - // Param is passed by value, moved - pub fn set_oid(&mut self, v: ObjectIdentifier) { - self.oid = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_oid(&mut self) -> &mut ObjectIdentifier { - if self.oid.is_none() { - self.oid.set_default(); - } - self.oid.as_mut().unwrap() - } - - // Take field - pub fn take_oid(&mut self) -> ObjectIdentifier { - self.oid.take().unwrap_or_else(|| ObjectIdentifier::new()) - } - - // bytes value = 2; - - - pub fn get_value(&self) -> &[u8] { - &self.value - } - pub fn clear_value(&mut self) { - self.value.clear(); - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::std::vec::Vec) { - self.value = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { - &mut self.value - } - - // Take field - pub fn take_value(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.value, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for ObjectIdentifierValuePair { - fn is_initialized(&self) -> bool { - for v in &self.oid { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.oid)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.value)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.oid.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.value.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.value); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.oid.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.value.is_empty() { - os.write_bytes(2, &self.value)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ObjectIdentifierValuePair { - ObjectIdentifierValuePair::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "oid", - |m: &ObjectIdentifierValuePair| { &m.oid }, - |m: &mut ObjectIdentifierValuePair| { &mut m.oid }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "value", - |m: &ObjectIdentifierValuePair| { &m.value }, - |m: &mut ObjectIdentifierValuePair| { &mut m.value }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ObjectIdentifierValuePair", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ObjectIdentifierValuePair { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ObjectIdentifierValuePair::new) - } -} - -impl ::protobuf::Clear for ObjectIdentifierValuePair { - fn clear(&mut self) { - self.oid.clear(); - self.value.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ObjectIdentifierValuePair { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ObjectIdentifierValuePair { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct DistinguishedName { - // message fields - pub organization: ::std::string::String, - pub common_name: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a DistinguishedName { - fn default() -> &'a DistinguishedName { - ::default_instance() - } -} - -impl DistinguishedName { - pub fn new() -> DistinguishedName { - ::std::default::Default::default() - } - - // string organization = 1; - - - pub fn get_organization(&self) -> &str { - &self.organization - } - pub fn clear_organization(&mut self) { - self.organization.clear(); - } - - // Param is passed by value, moved - pub fn set_organization(&mut self, v: ::std::string::String) { - self.organization = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_organization(&mut self) -> &mut ::std::string::String { - &mut self.organization - } - - // Take field - pub fn take_organization(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.organization, ::std::string::String::new()) - } - - // string common_name = 2; - - - pub fn get_common_name(&self) -> &str { - &self.common_name - } - pub fn clear_common_name(&mut self) { - self.common_name.clear(); - } - - // Param is passed by value, moved - pub fn set_common_name(&mut self, v: ::std::string::String) { - self.common_name = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_common_name(&mut self) -> &mut ::std::string::String { - &mut self.common_name - } - - // Take field - pub fn take_common_name(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.common_name, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for DistinguishedName { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.organization)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.common_name)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.organization.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.organization); - } - if !self.common_name.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.common_name); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.organization.is_empty() { - os.write_string(1, &self.organization)?; - } - if !self.common_name.is_empty() { - os.write_string(2, &self.common_name)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> DistinguishedName { - DistinguishedName::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "organization", - |m: &DistinguishedName| { &m.organization }, - |m: &mut DistinguishedName| { &mut m.organization }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "common_name", - |m: &DistinguishedName| { &m.common_name }, - |m: &mut DistinguishedName| { &mut m.common_name }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "DistinguishedName", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static DistinguishedName { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(DistinguishedName::new) - } -} - -impl ::protobuf::Clear for DistinguishedName { - fn clear(&mut self) { - self.organization.clear(); - self.common_name.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for DistinguishedName { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for DistinguishedName { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct X509Certificate { - // message fields - pub raw_bytes: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a X509Certificate { - fn default() -> &'a X509Certificate { - ::default_instance() - } -} - -impl X509Certificate { - pub fn new() -> X509Certificate { - ::std::default::Default::default() - } - - // bytes raw_bytes = 1; - - - pub fn get_raw_bytes(&self) -> &[u8] { - &self.raw_bytes - } - pub fn clear_raw_bytes(&mut self) { - self.raw_bytes.clear(); - } - - // Param is passed by value, moved - pub fn set_raw_bytes(&mut self, v: ::std::vec::Vec) { - self.raw_bytes = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_raw_bytes(&mut self) -> &mut ::std::vec::Vec { - &mut self.raw_bytes - } - - // Take field - pub fn take_raw_bytes(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.raw_bytes, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for X509Certificate { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.raw_bytes)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.raw_bytes.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.raw_bytes); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.raw_bytes.is_empty() { - os.write_bytes(1, &self.raw_bytes)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> X509Certificate { - X509Certificate::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "raw_bytes", - |m: &X509Certificate| { &m.raw_bytes }, - |m: &mut X509Certificate| { &mut m.raw_bytes }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "X509Certificate", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static X509Certificate { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(X509Certificate::new) - } -} - -impl ::protobuf::Clear for X509Certificate { - fn clear(&mut self) { - self.raw_bytes.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for X509Certificate { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for X509Certificate { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct SubjectAlternativeName { - // message fields - pub field_type: SubjectAlternativeNameType, - // message oneof groups - pub identity: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a SubjectAlternativeName { - fn default() -> &'a SubjectAlternativeName { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum SubjectAlternativeName_oneof_identity { - regexp(::std::string::String), - value(::std::string::String), -} - -impl SubjectAlternativeName { - pub fn new() -> SubjectAlternativeName { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.SubjectAlternativeNameType type = 1; - - - pub fn get_field_type(&self) -> SubjectAlternativeNameType { - self.field_type - } - pub fn clear_field_type(&mut self) { - self.field_type = SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED; - } - - // Param is passed by value, moved - pub fn set_field_type(&mut self, v: SubjectAlternativeNameType) { - self.field_type = v; - } - - // string regexp = 2; - - - pub fn get_regexp(&self) -> &str { - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(ref v)) => v, - _ => "", - } - } - pub fn clear_regexp(&mut self) { - self.identity = ::std::option::Option::None; - } - - pub fn has_regexp(&self) -> bool { - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_regexp(&mut self, v: ::std::string::String) { - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(v)) - } - - // Mutable pointer to the field. - pub fn mut_regexp(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(_)) = self.identity { - } else { - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(::std::string::String::new())); - } - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_regexp(&mut self) -> ::std::string::String { - if self.has_regexp() { - match self.identity.take() { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // string value = 3; - - - pub fn get_value(&self) -> &str { - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(ref v)) => v, - _ => "", - } - } - pub fn clear_value(&mut self) { - self.identity = ::std::option::Option::None; - } - - pub fn has_value(&self) -> bool { - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_value(&mut self, v: ::std::string::String) { - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(v)) - } - - // Mutable pointer to the field. - pub fn mut_value(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(_)) = self.identity { - } else { - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(::std::string::String::new())); - } - match self.identity { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_value(&mut self) -> ::std::string::String { - if self.has_value() { - match self.identity.take() { - ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } -} - -impl ::protobuf::Message for SubjectAlternativeName { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)? - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(is.read_string()?)); - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(is.read_string()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.field_type != SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED { - my_size += ::protobuf::rt::enum_size(1, self.field_type); - } - if let ::std::option::Option::Some(ref v) = self.identity { - match v { - &SubjectAlternativeName_oneof_identity::regexp(ref v) => { - my_size += ::protobuf::rt::string_size(2, &v); - }, - &SubjectAlternativeName_oneof_identity::value(ref v) => { - my_size += ::protobuf::rt::string_size(3, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.field_type != SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED { - os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.field_type))?; - } - if let ::std::option::Option::Some(ref v) = self.identity { - match v { - &SubjectAlternativeName_oneof_identity::regexp(ref v) => { - os.write_string(2, v)?; - }, - &SubjectAlternativeName_oneof_identity::value(ref v) => { - os.write_string(3, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> SubjectAlternativeName { - SubjectAlternativeName::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "type", - |m: &SubjectAlternativeName| { &m.field_type }, - |m: &mut SubjectAlternativeName| { &mut m.field_type }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "regexp", - SubjectAlternativeName::has_regexp, - SubjectAlternativeName::get_regexp, - )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "value", - SubjectAlternativeName::has_value, - SubjectAlternativeName::get_value, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "SubjectAlternativeName", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static SubjectAlternativeName { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(SubjectAlternativeName::new) - } -} - -impl ::protobuf::Clear for SubjectAlternativeName { - fn clear(&mut self) { - self.field_type = SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED; - self.identity = ::std::option::Option::None; - self.identity = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for SubjectAlternativeName { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for SubjectAlternativeName { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct X509CertificateChain { - // message fields - pub certificates: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a X509CertificateChain { - fn default() -> &'a X509CertificateChain { - ::default_instance() - } -} - -impl X509CertificateChain { - pub fn new() -> X509CertificateChain { - ::std::default::Default::default() - } - - // repeated .dev.sigstore.common.v1.X509Certificate certificates = 1; - - - pub fn get_certificates(&self) -> &[X509Certificate] { - &self.certificates - } - pub fn clear_certificates(&mut self) { - self.certificates.clear(); - } - - // Param is passed by value, moved - pub fn set_certificates(&mut self, v: ::protobuf::RepeatedField) { - self.certificates = v; - } - - // Mutable pointer to the field. - pub fn mut_certificates(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.certificates - } - - // Take field - pub fn take_certificates(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.certificates, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for X509CertificateChain { - fn is_initialized(&self) -> bool { - for v in &self.certificates { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.certificates)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.certificates { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.certificates { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> X509CertificateChain { - X509CertificateChain::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "certificates", - |m: &X509CertificateChain| { &m.certificates }, - |m: &mut X509CertificateChain| { &mut m.certificates }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "X509CertificateChain", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static X509CertificateChain { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(X509CertificateChain::new) - } -} - -impl ::protobuf::Clear for X509CertificateChain { - fn clear(&mut self) { - self.certificates.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for X509CertificateChain { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for X509CertificateChain { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct TimeRange { - // message fields - pub start: ::protobuf::SingularPtrField<::protobuf::well_known_types::Timestamp>, - // message oneof groups - pub _end: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TimeRange { - fn default() -> &'a TimeRange { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum TimeRange_oneof__end { - end(::protobuf::well_known_types::Timestamp), -} - -impl TimeRange { - pub fn new() -> TimeRange { - ::std::default::Default::default() - } - - // .google.protobuf.Timestamp start = 1; - - - pub fn get_start(&self) -> &::protobuf::well_known_types::Timestamp { - self.start.as_ref().unwrap_or_else(|| <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance()) - } - pub fn clear_start(&mut self) { - self.start.clear(); - } - - pub fn has_start(&self) -> bool { - self.start.is_some() - } - - // Param is passed by value, moved - pub fn set_start(&mut self, v: ::protobuf::well_known_types::Timestamp) { - self.start = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_start(&mut self) -> &mut ::protobuf::well_known_types::Timestamp { - if self.start.is_none() { - self.start.set_default(); - } - self.start.as_mut().unwrap() - } - - // Take field - pub fn take_start(&mut self) -> ::protobuf::well_known_types::Timestamp { - self.start.take().unwrap_or_else(|| ::protobuf::well_known_types::Timestamp::new()) - } - - // .google.protobuf.Timestamp end = 2; - - - pub fn get_end(&self) -> &::protobuf::well_known_types::Timestamp { - match self._end { - ::std::option::Option::Some(TimeRange_oneof__end::end(ref v)) => v, - _ => <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance(), - } - } - pub fn clear_end(&mut self) { - self._end = ::std::option::Option::None; - } - - pub fn has_end(&self) -> bool { - match self._end { - ::std::option::Option::Some(TimeRange_oneof__end::end(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_end(&mut self, v: ::protobuf::well_known_types::Timestamp) { - self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(v)) - } - - // Mutable pointer to the field. - pub fn mut_end(&mut self) -> &mut ::protobuf::well_known_types::Timestamp { - if let ::std::option::Option::Some(TimeRange_oneof__end::end(_)) = self._end { - } else { - self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(::protobuf::well_known_types::Timestamp::new())); - } - match self._end { - ::std::option::Option::Some(TimeRange_oneof__end::end(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_end(&mut self) -> ::protobuf::well_known_types::Timestamp { - if self.has_end() { - match self._end.take() { - ::std::option::Option::Some(TimeRange_oneof__end::end(v)) => v, - _ => panic!(), - } - } else { - ::protobuf::well_known_types::Timestamp::new() - } - } -} - -impl ::protobuf::Message for TimeRange { - fn is_initialized(&self) -> bool { - for v in &self.start { - if !v.is_initialized() { - return false; - } - }; - if let Some(TimeRange_oneof__end::end(ref v)) = self._end { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.start)?; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.start.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self._end { - match v { - &TimeRange_oneof__end::end(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.start.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self._end { - match v { - &TimeRange_oneof__end::end(ref v) => { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TimeRange { - TimeRange::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Timestamp>>( - "start", - |m: &TimeRange| { &m.start }, - |m: &mut TimeRange| { &mut m.start }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ::protobuf::well_known_types::Timestamp>( - "end", - TimeRange::has_end, - TimeRange::get_end, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TimeRange", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static TimeRange { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TimeRange::new) - } -} - -impl ::protobuf::Clear for TimeRange { - fn clear(&mut self) { - self.start.clear(); - self._end = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TimeRange { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TimeRange { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(Clone,PartialEq,Eq,Debug,Hash)] -pub enum HashAlgorithm { - HASH_ALGORITHM_UNSPECIFIED = 0, - SHA2_256 = 1, -} - -impl ::protobuf::ProtobufEnum for HashAlgorithm { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED), - 1 => ::std::option::Option::Some(HashAlgorithm::SHA2_256), - _ => ::std::option::Option::None - } - } - - fn values() -> &'static [Self] { - static values: &'static [HashAlgorithm] = &[ - HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED, - HashAlgorithm::SHA2_256, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::("HashAlgorithm", file_descriptor_proto()) - }) - } -} - -impl ::std::marker::Copy for HashAlgorithm { -} - -impl ::std::default::Default for HashAlgorithm { - fn default() -> Self { - HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED - } -} - -impl ::protobuf::reflect::ProtobufValue for HashAlgorithm { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -#[derive(Clone,PartialEq,Eq,Debug,Hash)] -pub enum PublicKeyDetails { - PUBLIC_KEY_DETAILS_UNSPECIFIED = 0, - PKCS1_RSA_PKCS1V5 = 1, - PKCS1_RSA_PSS = 2, - PKIX_RSA_PKCS1V5 = 3, - PKIX_RSA_PSS = 4, - PKIX_ECDSA_P256_SHA_256 = 5, - PKIX_ECDSA_P256_HMAC_SHA_256 = 6, - PKIX_ED25519 = 7, -} - -impl ::protobuf::ProtobufEnum for PublicKeyDetails { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED), - 1 => ::std::option::Option::Some(PublicKeyDetails::PKCS1_RSA_PKCS1V5), - 2 => ::std::option::Option::Some(PublicKeyDetails::PKCS1_RSA_PSS), - 3 => ::std::option::Option::Some(PublicKeyDetails::PKIX_RSA_PKCS1V5), - 4 => ::std::option::Option::Some(PublicKeyDetails::PKIX_RSA_PSS), - 5 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ECDSA_P256_SHA_256), - 6 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ECDSA_P256_HMAC_SHA_256), - 7 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ED25519), - _ => ::std::option::Option::None - } - } - - fn values() -> &'static [Self] { - static values: &'static [PublicKeyDetails] = &[ - PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED, - PublicKeyDetails::PKCS1_RSA_PKCS1V5, - PublicKeyDetails::PKCS1_RSA_PSS, - PublicKeyDetails::PKIX_RSA_PKCS1V5, - PublicKeyDetails::PKIX_RSA_PSS, - PublicKeyDetails::PKIX_ECDSA_P256_SHA_256, - PublicKeyDetails::PKIX_ECDSA_P256_HMAC_SHA_256, - PublicKeyDetails::PKIX_ED25519, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::("PublicKeyDetails", file_descriptor_proto()) - }) - } -} - -impl ::std::marker::Copy for PublicKeyDetails { -} - -impl ::std::default::Default for PublicKeyDetails { - fn default() -> Self { - PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED - } -} - -impl ::protobuf::reflect::ProtobufValue for PublicKeyDetails { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -#[derive(Clone,PartialEq,Eq,Debug,Hash)] -pub enum SubjectAlternativeNameType { - SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED = 0, - EMAIL = 1, - URI = 2, - OTHER_NAME = 3, -} - -impl ::protobuf::ProtobufEnum for SubjectAlternativeNameType { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED), - 1 => ::std::option::Option::Some(SubjectAlternativeNameType::EMAIL), - 2 => ::std::option::Option::Some(SubjectAlternativeNameType::URI), - 3 => ::std::option::Option::Some(SubjectAlternativeNameType::OTHER_NAME), - _ => ::std::option::Option::None - } - } - - fn values() -> &'static [Self] { - static values: &'static [SubjectAlternativeNameType] = &[ - SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED, - SubjectAlternativeNameType::EMAIL, - SubjectAlternativeNameType::URI, - SubjectAlternativeNameType::OTHER_NAME, - ]; - values - } - - fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - ::protobuf::reflect::EnumDescriptor::new_pb_name::("SubjectAlternativeNameType", file_descriptor_proto()) - }) - } -} - -impl ::std::marker::Copy for SubjectAlternativeNameType { -} - -impl ::std::default::Default for SubjectAlternativeNameType { - fn default() -> Self { - SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED - } -} - -impl ::protobuf::reflect::ProtobufValue for SubjectAlternativeNameType { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x15sigstore_common.proto\x12\x16dev.sigstore.common.v1\x1a\x1fgoogle/\ - api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\nHa\ - shOutput\x12C\n\talgorithm\x18\x01\x20\x01(\x0e2%.dev.sigstore.common.v1\ - .HashAlgorithmR\talgorithm\x12\x16\n\x06digest\x18\x02\x20\x01(\x0cR\x06\ - digest\"\x80\x01\n\x10MessageSignature\x12I\n\x0emessage_digest\x18\x01\ - \x20\x01(\x0b2\".dev.sigstore.common.v1.HashOutputR\rmessageDigest\x12!\ - \n\tsignature\x18\x02\x20\x01(\x0cR\tsignatureB\x03\xe0A\x02\"#\n\x05Log\ - Id\x12\x1a\n\x06key_id\x18\x01\x20\x01(\x0cR\x05keyIdB\x03\xe0A\x02\"H\n\ - \x16RFC3161SignedTimestamp\x12.\n\x10signed_timestamp\x18\x01\x20\x01(\ - \x0cR\x0fsignedTimestampB\x03\xe0A\x02\"\xd9\x01\n\tPublicKey\x12\x20\n\ - \traw_bytes\x18\x01\x20\x01(\x0cH\0R\x08rawBytes\x88\x01\x01\x12I\n\x0bk\ - ey_details\x18\x02\x20\x01(\x0e2(.dev.sigstore.common.v1.PublicKeyDetail\ - sR\nkeyDetails\x12C\n\tvalid_for\x18\x03\x20\x01(\x0b2!.dev.sigstore.com\ - mon.v1.TimeRangeH\x01R\x08validFor\x88\x01\x01B\x0c\n\n_raw_bytesB\x0c\n\ - \n_valid_for\")\n\x13PublicKeyIdentifier\x12\x12\n\x04hint\x18\x01\x20\ - \x01(\tR\x04hint\"'\n\x10ObjectIdentifier\x12\x13\n\x02id\x18\x01\x20\ - \x03(\x05R\x02idB\x03\xe0A\x02\"m\n\x19ObjectIdentifierValuePair\x12:\n\ - \x03oid\x18\x01\x20\x01(\x0b2(.dev.sigstore.common.v1.ObjectIdentifierR\ - \x03oid\x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05value\"X\n\x11Distin\ - guishedName\x12\"\n\x0corganization\x18\x01\x20\x01(\tR\x0corganization\ - \x12\x1f\n\x0bcommon_name\x18\x02\x20\x01(\tR\ncommonName\"3\n\x0fX509Ce\ - rtificate\x12\x20\n\traw_bytes\x18\x01\x20\x01(\x0cR\x08rawBytesB\x03\ - \xe0A\x02\"\x9e\x01\n\x16SubjectAlternativeName\x12F\n\x04type\x18\x01\ - \x20\x01(\x0e22.dev.sigstore.common.v1.SubjectAlternativeNameTypeR\x04ty\ - pe\x12\x18\n\x06regexp\x18\x02\x20\x01(\tH\0R\x06regexp\x12\x16\n\x05val\ - ue\x18\x03\x20\x01(\tH\0R\x05valueB\n\n\x08identity\"c\n\x14X509Certific\ - ateChain\x12K\n\x0ccertificates\x18\x01\x20\x03(\x0b2'.dev.sigstore.comm\ - on.v1.X509CertificateR\x0ccertificates\"x\n\tTimeRange\x120\n\x05start\ - \x18\x01\x20\x01(\x0b2\x1a.google.protobuf.TimestampR\x05start\x121\n\ - \x03end\x18\x02\x20\x01(\x0b2\x1a.google.protobuf.TimestampH\0R\x03end\ - \x88\x01\x01B\x06\n\x04_end*=\n\rHashAlgorithm\x12\x1e\n\x1aHASH_ALGORIT\ - HM_UNSPECIFIED\x10\0\x12\x0c\n\x08SHA2_256\x10\x01*\xd9\x01\n\x10PublicK\ - eyDetails\x12\"\n\x1ePUBLIC_KEY_DETAILS_UNSPECIFIED\x10\0\x12\x15\n\x11P\ - KCS1_RSA_PKCS1V5\x10\x01\x12\x11\n\rPKCS1_RSA_PSS\x10\x02\x12\x14\n\x10P\ - KIX_RSA_PKCS1V5\x10\x03\x12\x10\n\x0cPKIX_RSA_PSS\x10\x04\x12\x1b\n\x17P\ - KIX_ECDSA_P256_SHA_256\x10\x05\x12\x20\n\x1cPKIX_ECDSA_P256_HMAC_SHA_256\ - \x10\x06\x12\x10\n\x0cPKIX_ED25519\x10\x07*o\n\x1aSubjectAlternativeName\ - Type\x12-\n)SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\x10\0\x12\t\n\x05E\ - MAIL\x10\x01\x12\x07\n\x03URI\x10\x02\x12\x0e\n\nOTHER_NAME\x10\x03B|\n\ - \x1cdev.sigstore.proto.common.v1B\x0bCommonProtoP\x01Z6github.com/sigsto\ - re/protobuf-specs/gen/pb-go/common/v1\xea\x02\x14Sigstore::Common::V1b\ - \x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/sigstore_rekor.rs b/gen/pb-rust/src/sigstore_rekor.rs deleted file mode 100644 index 9c7a7436..00000000 --- a/gen/pb-rust/src/sigstore_rekor.rs +++ /dev/null @@ -1,1367 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `sigstore_rekor.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct KindVersion { - // message fields - pub kind: ::std::string::String, - pub version: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a KindVersion { - fn default() -> &'a KindVersion { - ::default_instance() - } -} - -impl KindVersion { - pub fn new() -> KindVersion { - ::std::default::Default::default() - } - - // string kind = 1; - - - pub fn get_kind(&self) -> &str { - &self.kind - } - pub fn clear_kind(&mut self) { - self.kind.clear(); - } - - // Param is passed by value, moved - pub fn set_kind(&mut self, v: ::std::string::String) { - self.kind = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_kind(&mut self) -> &mut ::std::string::String { - &mut self.kind - } - - // Take field - pub fn take_kind(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.kind, ::std::string::String::new()) - } - - // string version = 2; - - - pub fn get_version(&self) -> &str { - &self.version - } - pub fn clear_version(&mut self) { - self.version.clear(); - } - - // Param is passed by value, moved - pub fn set_version(&mut self, v: ::std::string::String) { - self.version = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_version(&mut self) -> &mut ::std::string::String { - &mut self.version - } - - // Take field - pub fn take_version(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.version, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for KindVersion { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.kind)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.version)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.kind.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.kind); - } - if !self.version.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.version); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.kind.is_empty() { - os.write_string(1, &self.kind)?; - } - if !self.version.is_empty() { - os.write_string(2, &self.version)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> KindVersion { - KindVersion::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "kind", - |m: &KindVersion| { &m.kind }, - |m: &mut KindVersion| { &mut m.kind }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "version", - |m: &KindVersion| { &m.version }, - |m: &mut KindVersion| { &mut m.version }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "KindVersion", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static KindVersion { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(KindVersion::new) - } -} - -impl ::protobuf::Clear for KindVersion { - fn clear(&mut self) { - self.kind.clear(); - self.version.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for KindVersion { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for KindVersion { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Checkpoint { - // message fields - pub envelope: ::std::string::String, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Checkpoint { - fn default() -> &'a Checkpoint { - ::default_instance() - } -} - -impl Checkpoint { - pub fn new() -> Checkpoint { - ::std::default::Default::default() - } - - // string envelope = 1; - - - pub fn get_envelope(&self) -> &str { - &self.envelope - } - pub fn clear_envelope(&mut self) { - self.envelope.clear(); - } - - // Param is passed by value, moved - pub fn set_envelope(&mut self, v: ::std::string::String) { - self.envelope = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_envelope(&mut self) -> &mut ::std::string::String { - &mut self.envelope - } - - // Take field - pub fn take_envelope(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.envelope, ::std::string::String::new()) - } -} - -impl ::protobuf::Message for Checkpoint { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.envelope)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.envelope.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.envelope); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.envelope.is_empty() { - os.write_string(1, &self.envelope)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Checkpoint { - Checkpoint::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "envelope", - |m: &Checkpoint| { &m.envelope }, - |m: &mut Checkpoint| { &mut m.envelope }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Checkpoint", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Checkpoint { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Checkpoint::new) - } -} - -impl ::protobuf::Clear for Checkpoint { - fn clear(&mut self) { - self.envelope.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Checkpoint { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Checkpoint { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct InclusionProof { - // message fields - pub log_index: i64, - pub root_hash: ::std::vec::Vec, - pub tree_size: i64, - pub hashes: ::protobuf::RepeatedField<::std::vec::Vec>, - pub checkpoint: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a InclusionProof { - fn default() -> &'a InclusionProof { - ::default_instance() - } -} - -impl InclusionProof { - pub fn new() -> InclusionProof { - ::std::default::Default::default() - } - - // int64 log_index = 1; - - - pub fn get_log_index(&self) -> i64 { - self.log_index - } - pub fn clear_log_index(&mut self) { - self.log_index = 0; - } - - // Param is passed by value, moved - pub fn set_log_index(&mut self, v: i64) { - self.log_index = v; - } - - // bytes root_hash = 2; - - - pub fn get_root_hash(&self) -> &[u8] { - &self.root_hash - } - pub fn clear_root_hash(&mut self) { - self.root_hash.clear(); - } - - // Param is passed by value, moved - pub fn set_root_hash(&mut self, v: ::std::vec::Vec) { - self.root_hash = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_root_hash(&mut self) -> &mut ::std::vec::Vec { - &mut self.root_hash - } - - // Take field - pub fn take_root_hash(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.root_hash, ::std::vec::Vec::new()) - } - - // int64 tree_size = 3; - - - pub fn get_tree_size(&self) -> i64 { - self.tree_size - } - pub fn clear_tree_size(&mut self) { - self.tree_size = 0; - } - - // Param is passed by value, moved - pub fn set_tree_size(&mut self, v: i64) { - self.tree_size = v; - } - - // repeated bytes hashes = 4; - - - pub fn get_hashes(&self) -> &[::std::vec::Vec] { - &self.hashes - } - pub fn clear_hashes(&mut self) { - self.hashes.clear(); - } - - // Param is passed by value, moved - pub fn set_hashes(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { - self.hashes = v; - } - - // Mutable pointer to the field. - pub fn mut_hashes(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { - &mut self.hashes - } - - // Take field - pub fn take_hashes(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { - ::std::mem::replace(&mut self.hashes, ::protobuf::RepeatedField::new()) - } - - // .dev.sigstore.rekor.v1.Checkpoint checkpoint = 5; - - - pub fn get_checkpoint(&self) -> &Checkpoint { - self.checkpoint.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_checkpoint(&mut self) { - self.checkpoint.clear(); - } - - pub fn has_checkpoint(&self) -> bool { - self.checkpoint.is_some() - } - - // Param is passed by value, moved - pub fn set_checkpoint(&mut self, v: Checkpoint) { - self.checkpoint = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_checkpoint(&mut self) -> &mut Checkpoint { - if self.checkpoint.is_none() { - self.checkpoint.set_default(); - } - self.checkpoint.as_mut().unwrap() - } - - // Take field - pub fn take_checkpoint(&mut self) -> Checkpoint { - self.checkpoint.take().unwrap_or_else(|| Checkpoint::new()) - } -} - -impl ::protobuf::Message for InclusionProof { - fn is_initialized(&self) -> bool { - for v in &self.checkpoint { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.log_index = tmp; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.root_hash)?; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.tree_size = tmp; - }, - 4 => { - ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.hashes)?; - }, - 5 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.checkpoint)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.log_index != 0 { - my_size += ::protobuf::rt::value_size(1, self.log_index, ::protobuf::wire_format::WireTypeVarint); - } - if !self.root_hash.is_empty() { - my_size += ::protobuf::rt::bytes_size(2, &self.root_hash); - } - if self.tree_size != 0 { - my_size += ::protobuf::rt::value_size(3, self.tree_size, ::protobuf::wire_format::WireTypeVarint); - } - for value in &self.hashes { - my_size += ::protobuf::rt::bytes_size(4, &value); - }; - if let Some(ref v) = self.checkpoint.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.log_index != 0 { - os.write_int64(1, self.log_index)?; - } - if !self.root_hash.is_empty() { - os.write_bytes(2, &self.root_hash)?; - } - if self.tree_size != 0 { - os.write_int64(3, self.tree_size)?; - } - for v in &self.hashes { - os.write_bytes(4, &v)?; - }; - if let Some(ref v) = self.checkpoint.as_ref() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> InclusionProof { - InclusionProof::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "log_index", - |m: &InclusionProof| { &m.log_index }, - |m: &mut InclusionProof| { &mut m.log_index }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "root_hash", - |m: &InclusionProof| { &m.root_hash }, - |m: &mut InclusionProof| { &mut m.root_hash }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "tree_size", - |m: &InclusionProof| { &m.tree_size }, - |m: &mut InclusionProof| { &mut m.tree_size }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "hashes", - |m: &InclusionProof| { &m.hashes }, - |m: &mut InclusionProof| { &mut m.hashes }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "checkpoint", - |m: &InclusionProof| { &m.checkpoint }, - |m: &mut InclusionProof| { &mut m.checkpoint }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "InclusionProof", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static InclusionProof { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(InclusionProof::new) - } -} - -impl ::protobuf::Clear for InclusionProof { - fn clear(&mut self) { - self.log_index = 0; - self.root_hash.clear(); - self.tree_size = 0; - self.hashes.clear(); - self.checkpoint.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for InclusionProof { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for InclusionProof { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct InclusionPromise { - // message fields - pub signed_entry_timestamp: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a InclusionPromise { - fn default() -> &'a InclusionPromise { - ::default_instance() - } -} - -impl InclusionPromise { - pub fn new() -> InclusionPromise { - ::std::default::Default::default() - } - - // bytes signed_entry_timestamp = 1; - - - pub fn get_signed_entry_timestamp(&self) -> &[u8] { - &self.signed_entry_timestamp - } - pub fn clear_signed_entry_timestamp(&mut self) { - self.signed_entry_timestamp.clear(); - } - - // Param is passed by value, moved - pub fn set_signed_entry_timestamp(&mut self, v: ::std::vec::Vec) { - self.signed_entry_timestamp = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_signed_entry_timestamp(&mut self) -> &mut ::std::vec::Vec { - &mut self.signed_entry_timestamp - } - - // Take field - pub fn take_signed_entry_timestamp(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.signed_entry_timestamp, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for InclusionPromise { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signed_entry_timestamp)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.signed_entry_timestamp.is_empty() { - my_size += ::protobuf::rt::bytes_size(1, &self.signed_entry_timestamp); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.signed_entry_timestamp.is_empty() { - os.write_bytes(1, &self.signed_entry_timestamp)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> InclusionPromise { - InclusionPromise::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "signed_entry_timestamp", - |m: &InclusionPromise| { &m.signed_entry_timestamp }, - |m: &mut InclusionPromise| { &mut m.signed_entry_timestamp }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "InclusionPromise", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static InclusionPromise { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(InclusionPromise::new) - } -} - -impl ::protobuf::Clear for InclusionPromise { - fn clear(&mut self) { - self.signed_entry_timestamp.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for InclusionPromise { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for InclusionPromise { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct TransparencyLogEntry { - // message fields - pub log_index: i64, - pub log_id: ::protobuf::SingularPtrField, - pub kind_version: ::protobuf::SingularPtrField, - pub integrated_time: i64, - pub inclusion_promise: ::protobuf::SingularPtrField, - pub inclusion_proof: ::protobuf::SingularPtrField, - pub canonicalized_body: ::std::vec::Vec, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TransparencyLogEntry { - fn default() -> &'a TransparencyLogEntry { - ::default_instance() - } -} - -impl TransparencyLogEntry { - pub fn new() -> TransparencyLogEntry { - ::std::default::Default::default() - } - - // int64 log_index = 1; - - - pub fn get_log_index(&self) -> i64 { - self.log_index - } - pub fn clear_log_index(&mut self) { - self.log_index = 0; - } - - // Param is passed by value, moved - pub fn set_log_index(&mut self, v: i64) { - self.log_index = v; - } - - // .dev.sigstore.common.v1.LogId log_id = 2; - - - pub fn get_log_id(&self) -> &super::sigstore_common::LogId { - self.log_id.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_log_id(&mut self) { - self.log_id.clear(); - } - - pub fn has_log_id(&self) -> bool { - self.log_id.is_some() - } - - // Param is passed by value, moved - pub fn set_log_id(&mut self, v: super::sigstore_common::LogId) { - self.log_id = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_log_id(&mut self) -> &mut super::sigstore_common::LogId { - if self.log_id.is_none() { - self.log_id.set_default(); - } - self.log_id.as_mut().unwrap() - } - - // Take field - pub fn take_log_id(&mut self) -> super::sigstore_common::LogId { - self.log_id.take().unwrap_or_else(|| super::sigstore_common::LogId::new()) - } - - // .dev.sigstore.rekor.v1.KindVersion kind_version = 3; - - - pub fn get_kind_version(&self) -> &KindVersion { - self.kind_version.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_kind_version(&mut self) { - self.kind_version.clear(); - } - - pub fn has_kind_version(&self) -> bool { - self.kind_version.is_some() - } - - // Param is passed by value, moved - pub fn set_kind_version(&mut self, v: KindVersion) { - self.kind_version = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_kind_version(&mut self) -> &mut KindVersion { - if self.kind_version.is_none() { - self.kind_version.set_default(); - } - self.kind_version.as_mut().unwrap() - } - - // Take field - pub fn take_kind_version(&mut self) -> KindVersion { - self.kind_version.take().unwrap_or_else(|| KindVersion::new()) - } - - // int64 integrated_time = 4; - - - pub fn get_integrated_time(&self) -> i64 { - self.integrated_time - } - pub fn clear_integrated_time(&mut self) { - self.integrated_time = 0; - } - - // Param is passed by value, moved - pub fn set_integrated_time(&mut self, v: i64) { - self.integrated_time = v; - } - - // .dev.sigstore.rekor.v1.InclusionPromise inclusion_promise = 5; - - - pub fn get_inclusion_promise(&self) -> &InclusionPromise { - self.inclusion_promise.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_inclusion_promise(&mut self) { - self.inclusion_promise.clear(); - } - - pub fn has_inclusion_promise(&self) -> bool { - self.inclusion_promise.is_some() - } - - // Param is passed by value, moved - pub fn set_inclusion_promise(&mut self, v: InclusionPromise) { - self.inclusion_promise = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_inclusion_promise(&mut self) -> &mut InclusionPromise { - if self.inclusion_promise.is_none() { - self.inclusion_promise.set_default(); - } - self.inclusion_promise.as_mut().unwrap() - } - - // Take field - pub fn take_inclusion_promise(&mut self) -> InclusionPromise { - self.inclusion_promise.take().unwrap_or_else(|| InclusionPromise::new()) - } - - // .dev.sigstore.rekor.v1.InclusionProof inclusion_proof = 6; - - - pub fn get_inclusion_proof(&self) -> &InclusionProof { - self.inclusion_proof.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_inclusion_proof(&mut self) { - self.inclusion_proof.clear(); - } - - pub fn has_inclusion_proof(&self) -> bool { - self.inclusion_proof.is_some() - } - - // Param is passed by value, moved - pub fn set_inclusion_proof(&mut self, v: InclusionProof) { - self.inclusion_proof = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_inclusion_proof(&mut self) -> &mut InclusionProof { - if self.inclusion_proof.is_none() { - self.inclusion_proof.set_default(); - } - self.inclusion_proof.as_mut().unwrap() - } - - // Take field - pub fn take_inclusion_proof(&mut self) -> InclusionProof { - self.inclusion_proof.take().unwrap_or_else(|| InclusionProof::new()) - } - - // bytes canonicalized_body = 7; - - - pub fn get_canonicalized_body(&self) -> &[u8] { - &self.canonicalized_body - } - pub fn clear_canonicalized_body(&mut self) { - self.canonicalized_body.clear(); - } - - // Param is passed by value, moved - pub fn set_canonicalized_body(&mut self, v: ::std::vec::Vec) { - self.canonicalized_body = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_canonicalized_body(&mut self) -> &mut ::std::vec::Vec { - &mut self.canonicalized_body - } - - // Take field - pub fn take_canonicalized_body(&mut self) -> ::std::vec::Vec { - ::std::mem::replace(&mut self.canonicalized_body, ::std::vec::Vec::new()) - } -} - -impl ::protobuf::Message for TransparencyLogEntry { - fn is_initialized(&self) -> bool { - for v in &self.log_id { - if !v.is_initialized() { - return false; - } - }; - for v in &self.kind_version { - if !v.is_initialized() { - return false; - } - }; - for v in &self.inclusion_promise { - if !v.is_initialized() { - return false; - } - }; - for v in &self.inclusion_proof { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.log_index = tmp; - }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.log_id)?; - }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.kind_version)?; - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int64()?; - self.integrated_time = tmp; - }, - 5 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.inclusion_promise)?; - }, - 6 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.inclusion_proof)?; - }, - 7 => { - ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.canonicalized_body)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.log_index != 0 { - my_size += ::protobuf::rt::value_size(1, self.log_index, ::protobuf::wire_format::WireTypeVarint); - } - if let Some(ref v) = self.log_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.kind_version.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if self.integrated_time != 0 { - my_size += ::protobuf::rt::value_size(4, self.integrated_time, ::protobuf::wire_format::WireTypeVarint); - } - if let Some(ref v) = self.inclusion_promise.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.inclusion_proof.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.canonicalized_body.is_empty() { - my_size += ::protobuf::rt::bytes_size(7, &self.canonicalized_body); - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.log_index != 0 { - os.write_int64(1, self.log_index)?; - } - if let Some(ref v) = self.log_id.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.kind_version.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if self.integrated_time != 0 { - os.write_int64(4, self.integrated_time)?; - } - if let Some(ref v) = self.inclusion_promise.as_ref() { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.inclusion_proof.as_ref() { - os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.canonicalized_body.is_empty() { - os.write_bytes(7, &self.canonicalized_body)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TransparencyLogEntry { - TransparencyLogEntry::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "log_index", - |m: &TransparencyLogEntry| { &m.log_index }, - |m: &mut TransparencyLogEntry| { &mut m.log_index }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "log_id", - |m: &TransparencyLogEntry| { &m.log_id }, - |m: &mut TransparencyLogEntry| { &mut m.log_id }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "kind_version", - |m: &TransparencyLogEntry| { &m.kind_version }, - |m: &mut TransparencyLogEntry| { &mut m.kind_version }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( - "integrated_time", - |m: &TransparencyLogEntry| { &m.integrated_time }, - |m: &mut TransparencyLogEntry| { &mut m.integrated_time }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "inclusion_promise", - |m: &TransparencyLogEntry| { &m.inclusion_promise }, - |m: &mut TransparencyLogEntry| { &mut m.inclusion_promise }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "inclusion_proof", - |m: &TransparencyLogEntry| { &m.inclusion_proof }, - |m: &mut TransparencyLogEntry| { &mut m.inclusion_proof }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "canonicalized_body", - |m: &TransparencyLogEntry| { &m.canonicalized_body }, - |m: &mut TransparencyLogEntry| { &mut m.canonicalized_body }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TransparencyLogEntry", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static TransparencyLogEntry { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TransparencyLogEntry::new) - } -} - -impl ::protobuf::Clear for TransparencyLogEntry { - fn clear(&mut self) { - self.log_index = 0; - self.log_id.clear(); - self.kind_version.clear(); - self.integrated_time = 0; - self.inclusion_promise.clear(); - self.inclusion_proof.clear(); - self.canonicalized_body.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TransparencyLogEntry { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TransparencyLogEntry { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x14sigstore_rekor.proto\x12\x15dev.sigstore.rekor.v1\x1a\x1fgoogle/ap\ - i/field_behavior.proto\x1a\x15sigstore_common.proto\"E\n\x0bKindVersion\ - \x12\x17\n\x04kind\x18\x01\x20\x01(\tR\x04kindB\x03\xe0A\x02\x12\x1d\n\ - \x07version\x18\x02\x20\x01(\tR\x07versionB\x03\xe0A\x02\"-\n\nCheckpoin\ - t\x12\x1f\n\x08envelope\x18\x01\x20\x01(\tR\x08envelopeB\x03\xe0A\x02\"\ - \xdb\x01\n\x0eInclusionProof\x12\x20\n\tlog_index\x18\x01\x20\x01(\x03R\ - \x08logIndexB\x03\xe0A\x02\x12\x20\n\troot_hash\x18\x02\x20\x01(\x0cR\ - \x08rootHashB\x03\xe0A\x02\x12\x20\n\ttree_size\x18\x03\x20\x01(\x03R\ - \x08treeSizeB\x03\xe0A\x02\x12\x1b\n\x06hashes\x18\x04\x20\x03(\x0cR\x06\ - hashesB\x03\xe0A\x02\x12F\n\ncheckpoint\x18\x05\x20\x01(\x0b2!.dev.sigst\ - ore.rekor.v1.CheckpointR\ncheckpointB\x03\xe0A\x02\"M\n\x10InclusionProm\ - ise\x129\n\x16signed_entry_timestamp\x18\x01\x20\x01(\x0cR\x14signedEntr\ - yTimestampB\x03\xe0A\x02\"\xc7\x03\n\x14TransparencyLogEntry\x12\x20\n\t\ - log_index\x18\x01\x20\x01(\x03R\x08logIndexB\x03\xe0A\x02\x129\n\x06log_\ - id\x18\x02\x20\x01(\x0b2\x1d.dev.sigstore.common.v1.LogIdR\x05logIdB\x03\ - \xe0A\x02\x12J\n\x0ckind_version\x18\x03\x20\x01(\x0b2\".dev.sigstore.re\ - kor.v1.KindVersionR\x0bkindVersionB\x03\xe0A\x02\x12,\n\x0fintegrated_ti\ - me\x18\x04\x20\x01(\x03R\x0eintegratedTimeB\x03\xe0A\x02\x12T\n\x11inclu\ - sion_promise\x18\x05\x20\x01(\x0b2'.dev.sigstore.rekor.v1.InclusionPromi\ - seR\x10inclusionPromise\x12S\n\x0finclusion_proof\x18\x06\x20\x01(\x0b2%\ - .dev.sigstore.rekor.v1.InclusionProofR\x0einclusionProofB\x03\xe0A\x02\ - \x12-\n\x12canonicalized_body\x18\x07\x20\x01(\x0cR\x11canonicalizedBody\ - Bx\n\x1bdev.sigstore.proto.rekor.v1B\nRekorProtoP\x01Z5github.com/sigsto\ - re/protobuf-specs/gen/pb-go/rekor/v1\xea\x02\x13Sigstore::Rekor::V1b\x06\ - proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/sigstore_trustroot.rs b/gen/pb-rust/src/sigstore_trustroot.rs deleted file mode 100644 index d97fd1e7..00000000 --- a/gen/pb-rust/src/sigstore_trustroot.rs +++ /dev/null @@ -1,1050 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `sigstore_trustroot.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct TransparencyLogInstance { - // message fields - pub base_url: ::std::string::String, - pub hash_algorithm: super::sigstore_common::HashAlgorithm, - pub public_key: ::protobuf::SingularPtrField, - pub log_id: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TransparencyLogInstance { - fn default() -> &'a TransparencyLogInstance { - ::default_instance() - } -} - -impl TransparencyLogInstance { - pub fn new() -> TransparencyLogInstance { - ::std::default::Default::default() - } - - // string base_url = 1; - - - pub fn get_base_url(&self) -> &str { - &self.base_url - } - pub fn clear_base_url(&mut self) { - self.base_url.clear(); - } - - // Param is passed by value, moved - pub fn set_base_url(&mut self, v: ::std::string::String) { - self.base_url = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_base_url(&mut self) -> &mut ::std::string::String { - &mut self.base_url - } - - // Take field - pub fn take_base_url(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.base_url, ::std::string::String::new()) - } - - // .dev.sigstore.common.v1.HashAlgorithm hash_algorithm = 2; - - - pub fn get_hash_algorithm(&self) -> super::sigstore_common::HashAlgorithm { - self.hash_algorithm - } - pub fn clear_hash_algorithm(&mut self) { - self.hash_algorithm = super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; - } - - // Param is passed by value, moved - pub fn set_hash_algorithm(&mut self, v: super::sigstore_common::HashAlgorithm) { - self.hash_algorithm = v; - } - - // .dev.sigstore.common.v1.PublicKey public_key = 3; - - - pub fn get_public_key(&self) -> &super::sigstore_common::PublicKey { - self.public_key.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_public_key(&mut self) { - self.public_key.clear(); - } - - pub fn has_public_key(&self) -> bool { - self.public_key.is_some() - } - - // Param is passed by value, moved - pub fn set_public_key(&mut self, v: super::sigstore_common::PublicKey) { - self.public_key = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_public_key(&mut self) -> &mut super::sigstore_common::PublicKey { - if self.public_key.is_none() { - self.public_key.set_default(); - } - self.public_key.as_mut().unwrap() - } - - // Take field - pub fn take_public_key(&mut self) -> super::sigstore_common::PublicKey { - self.public_key.take().unwrap_or_else(|| super::sigstore_common::PublicKey::new()) - } - - // .dev.sigstore.common.v1.LogId log_id = 4; - - - pub fn get_log_id(&self) -> &super::sigstore_common::LogId { - self.log_id.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_log_id(&mut self) { - self.log_id.clear(); - } - - pub fn has_log_id(&self) -> bool { - self.log_id.is_some() - } - - // Param is passed by value, moved - pub fn set_log_id(&mut self, v: super::sigstore_common::LogId) { - self.log_id = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_log_id(&mut self) -> &mut super::sigstore_common::LogId { - if self.log_id.is_none() { - self.log_id.set_default(); - } - self.log_id.as_mut().unwrap() - } - - // Take field - pub fn take_log_id(&mut self) -> super::sigstore_common::LogId { - self.log_id.take().unwrap_or_else(|| super::sigstore_common::LogId::new()) - } -} - -impl ::protobuf::Message for TransparencyLogInstance { - fn is_initialized(&self) -> bool { - for v in &self.public_key { - if !v.is_initialized() { - return false; - } - }; - for v in &self.log_id { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.base_url)?; - }, - 2 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.hash_algorithm, 2, &mut self.unknown_fields)? - }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_key)?; - }, - 4 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.log_id)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.base_url.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.base_url); - } - if self.hash_algorithm != super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { - my_size += ::protobuf::rt::enum_size(2, self.hash_algorithm); - } - if let Some(ref v) = self.public_key.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.log_id.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.base_url.is_empty() { - os.write_string(1, &self.base_url)?; - } - if self.hash_algorithm != super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { - os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.hash_algorithm))?; - } - if let Some(ref v) = self.public_key.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.log_id.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TransparencyLogInstance { - TransparencyLogInstance::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "base_url", - |m: &TransparencyLogInstance| { &m.base_url }, - |m: &mut TransparencyLogInstance| { &mut m.base_url }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "hash_algorithm", - |m: &TransparencyLogInstance| { &m.hash_algorithm }, - |m: &mut TransparencyLogInstance| { &mut m.hash_algorithm }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "public_key", - |m: &TransparencyLogInstance| { &m.public_key }, - |m: &mut TransparencyLogInstance| { &mut m.public_key }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "log_id", - |m: &TransparencyLogInstance| { &m.log_id }, - |m: &mut TransparencyLogInstance| { &mut m.log_id }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TransparencyLogInstance", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static TransparencyLogInstance { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TransparencyLogInstance::new) - } -} - -impl ::protobuf::Clear for TransparencyLogInstance { - fn clear(&mut self) { - self.base_url.clear(); - self.hash_algorithm = super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; - self.public_key.clear(); - self.log_id.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TransparencyLogInstance { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TransparencyLogInstance { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CertificateAuthority { - // message fields - pub subject: ::protobuf::SingularPtrField, - pub uri: ::std::string::String, - pub cert_chain: ::protobuf::SingularPtrField, - pub valid_for: ::protobuf::SingularPtrField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CertificateAuthority { - fn default() -> &'a CertificateAuthority { - ::default_instance() - } -} - -impl CertificateAuthority { - pub fn new() -> CertificateAuthority { - ::std::default::Default::default() - } - - // .dev.sigstore.common.v1.DistinguishedName subject = 1; - - - pub fn get_subject(&self) -> &super::sigstore_common::DistinguishedName { - self.subject.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_subject(&mut self) { - self.subject.clear(); - } - - pub fn has_subject(&self) -> bool { - self.subject.is_some() - } - - // Param is passed by value, moved - pub fn set_subject(&mut self, v: super::sigstore_common::DistinguishedName) { - self.subject = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_subject(&mut self) -> &mut super::sigstore_common::DistinguishedName { - if self.subject.is_none() { - self.subject.set_default(); - } - self.subject.as_mut().unwrap() - } - - // Take field - pub fn take_subject(&mut self) -> super::sigstore_common::DistinguishedName { - self.subject.take().unwrap_or_else(|| super::sigstore_common::DistinguishedName::new()) - } - - // string uri = 2; - - - pub fn get_uri(&self) -> &str { - &self.uri - } - pub fn clear_uri(&mut self) { - self.uri.clear(); - } - - // Param is passed by value, moved - pub fn set_uri(&mut self, v: ::std::string::String) { - self.uri = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_uri(&mut self) -> &mut ::std::string::String { - &mut self.uri - } - - // Take field - pub fn take_uri(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.uri, ::std::string::String::new()) - } - - // .dev.sigstore.common.v1.X509CertificateChain cert_chain = 3; - - - pub fn get_cert_chain(&self) -> &super::sigstore_common::X509CertificateChain { - self.cert_chain.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_cert_chain(&mut self) { - self.cert_chain.clear(); - } - - pub fn has_cert_chain(&self) -> bool { - self.cert_chain.is_some() - } - - // Param is passed by value, moved - pub fn set_cert_chain(&mut self, v: super::sigstore_common::X509CertificateChain) { - self.cert_chain = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_cert_chain(&mut self) -> &mut super::sigstore_common::X509CertificateChain { - if self.cert_chain.is_none() { - self.cert_chain.set_default(); - } - self.cert_chain.as_mut().unwrap() - } - - // Take field - pub fn take_cert_chain(&mut self) -> super::sigstore_common::X509CertificateChain { - self.cert_chain.take().unwrap_or_else(|| super::sigstore_common::X509CertificateChain::new()) - } - - // .dev.sigstore.common.v1.TimeRange valid_for = 4; - - - pub fn get_valid_for(&self) -> &super::sigstore_common::TimeRange { - self.valid_for.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_valid_for(&mut self) { - self.valid_for.clear(); - } - - pub fn has_valid_for(&self) -> bool { - self.valid_for.is_some() - } - - // Param is passed by value, moved - pub fn set_valid_for(&mut self, v: super::sigstore_common::TimeRange) { - self.valid_for = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_valid_for(&mut self) -> &mut super::sigstore_common::TimeRange { - if self.valid_for.is_none() { - self.valid_for.set_default(); - } - self.valid_for.as_mut().unwrap() - } - - // Take field - pub fn take_valid_for(&mut self) -> super::sigstore_common::TimeRange { - self.valid_for.take().unwrap_or_else(|| super::sigstore_common::TimeRange::new()) - } -} - -impl ::protobuf::Message for CertificateAuthority { - fn is_initialized(&self) -> bool { - for v in &self.subject { - if !v.is_initialized() { - return false; - } - }; - for v in &self.cert_chain { - if !v.is_initialized() { - return false; - } - }; - for v in &self.valid_for { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.subject)?; - }, - 2 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.uri)?; - }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cert_chain)?; - }, - 4 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.valid_for)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.subject.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if !self.uri.is_empty() { - my_size += ::protobuf::rt::string_size(2, &self.uri); - } - if let Some(ref v) = self.cert_chain.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.valid_for.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.subject.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if !self.uri.is_empty() { - os.write_string(2, &self.uri)?; - } - if let Some(ref v) = self.cert_chain.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.valid_for.as_ref() { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CertificateAuthority { - CertificateAuthority::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "subject", - |m: &CertificateAuthority| { &m.subject }, - |m: &mut CertificateAuthority| { &mut m.subject }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "uri", - |m: &CertificateAuthority| { &m.uri }, - |m: &mut CertificateAuthority| { &mut m.uri }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "cert_chain", - |m: &CertificateAuthority| { &m.cert_chain }, - |m: &mut CertificateAuthority| { &mut m.cert_chain }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "valid_for", - |m: &CertificateAuthority| { &m.valid_for }, - |m: &mut CertificateAuthority| { &mut m.valid_for }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CertificateAuthority", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CertificateAuthority { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CertificateAuthority::new) - } -} - -impl ::protobuf::Clear for CertificateAuthority { - fn clear(&mut self) { - self.subject.clear(); - self.uri.clear(); - self.cert_chain.clear(); - self.valid_for.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CertificateAuthority { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CertificateAuthority { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct TrustedRoot { - // message fields - pub media_type: ::std::string::String, - pub tlogs: ::protobuf::RepeatedField, - pub certificate_authorities: ::protobuf::RepeatedField, - pub ctlogs: ::protobuf::RepeatedField, - pub timestamp_authorities: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a TrustedRoot { - fn default() -> &'a TrustedRoot { - ::default_instance() - } -} - -impl TrustedRoot { - pub fn new() -> TrustedRoot { - ::std::default::Default::default() - } - - // string media_type = 1; - - - pub fn get_media_type(&self) -> &str { - &self.media_type - } - pub fn clear_media_type(&mut self) { - self.media_type.clear(); - } - - // Param is passed by value, moved - pub fn set_media_type(&mut self, v: ::std::string::String) { - self.media_type = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_media_type(&mut self) -> &mut ::std::string::String { - &mut self.media_type - } - - // Take field - pub fn take_media_type(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.media_type, ::std::string::String::new()) - } - - // repeated .dev.sigstore.trustroot.v1.TransparencyLogInstance tlogs = 2; - - - pub fn get_tlogs(&self) -> &[TransparencyLogInstance] { - &self.tlogs - } - pub fn clear_tlogs(&mut self) { - self.tlogs.clear(); - } - - // Param is passed by value, moved - pub fn set_tlogs(&mut self, v: ::protobuf::RepeatedField) { - self.tlogs = v; - } - - // Mutable pointer to the field. - pub fn mut_tlogs(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.tlogs - } - - // Take field - pub fn take_tlogs(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.tlogs, ::protobuf::RepeatedField::new()) - } - - // repeated .dev.sigstore.trustroot.v1.CertificateAuthority certificate_authorities = 3; - - - pub fn get_certificate_authorities(&self) -> &[CertificateAuthority] { - &self.certificate_authorities - } - pub fn clear_certificate_authorities(&mut self) { - self.certificate_authorities.clear(); - } - - // Param is passed by value, moved - pub fn set_certificate_authorities(&mut self, v: ::protobuf::RepeatedField) { - self.certificate_authorities = v; - } - - // Mutable pointer to the field. - pub fn mut_certificate_authorities(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.certificate_authorities - } - - // Take field - pub fn take_certificate_authorities(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.certificate_authorities, ::protobuf::RepeatedField::new()) - } - - // repeated .dev.sigstore.trustroot.v1.TransparencyLogInstance ctlogs = 4; - - - pub fn get_ctlogs(&self) -> &[TransparencyLogInstance] { - &self.ctlogs - } - pub fn clear_ctlogs(&mut self) { - self.ctlogs.clear(); - } - - // Param is passed by value, moved - pub fn set_ctlogs(&mut self, v: ::protobuf::RepeatedField) { - self.ctlogs = v; - } - - // Mutable pointer to the field. - pub fn mut_ctlogs(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.ctlogs - } - - // Take field - pub fn take_ctlogs(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.ctlogs, ::protobuf::RepeatedField::new()) - } - - // repeated .dev.sigstore.trustroot.v1.CertificateAuthority timestamp_authorities = 5; - - - pub fn get_timestamp_authorities(&self) -> &[CertificateAuthority] { - &self.timestamp_authorities - } - pub fn clear_timestamp_authorities(&mut self) { - self.timestamp_authorities.clear(); - } - - // Param is passed by value, moved - pub fn set_timestamp_authorities(&mut self, v: ::protobuf::RepeatedField) { - self.timestamp_authorities = v; - } - - // Mutable pointer to the field. - pub fn mut_timestamp_authorities(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.timestamp_authorities - } - - // Take field - pub fn take_timestamp_authorities(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.timestamp_authorities, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for TrustedRoot { - fn is_initialized(&self) -> bool { - for v in &self.tlogs { - if !v.is_initialized() { - return false; - } - }; - for v in &self.certificate_authorities { - if !v.is_initialized() { - return false; - } - }; - for v in &self.ctlogs { - if !v.is_initialized() { - return false; - } - }; - for v in &self.timestamp_authorities { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.media_type)?; - }, - 2 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tlogs)?; - }, - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.certificate_authorities)?; - }, - 4 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.ctlogs)?; - }, - 5 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.timestamp_authorities)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.media_type.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.media_type); - } - for value in &self.tlogs { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - for value in &self.certificate_authorities { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - for value in &self.ctlogs { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - for value in &self.timestamp_authorities { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.media_type.is_empty() { - os.write_string(1, &self.media_type)?; - } - for v in &self.tlogs { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - for v in &self.certificate_authorities { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - for v in &self.ctlogs { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - for v in &self.timestamp_authorities { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> TrustedRoot { - TrustedRoot::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "media_type", - |m: &TrustedRoot| { &m.media_type }, - |m: &mut TrustedRoot| { &mut m.media_type }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "tlogs", - |m: &TrustedRoot| { &m.tlogs }, - |m: &mut TrustedRoot| { &mut m.tlogs }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "certificate_authorities", - |m: &TrustedRoot| { &m.certificate_authorities }, - |m: &mut TrustedRoot| { &mut m.certificate_authorities }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "ctlogs", - |m: &TrustedRoot| { &m.ctlogs }, - |m: &mut TrustedRoot| { &mut m.ctlogs }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "timestamp_authorities", - |m: &TrustedRoot| { &m.timestamp_authorities }, - |m: &mut TrustedRoot| { &mut m.timestamp_authorities }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "TrustedRoot", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static TrustedRoot { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(TrustedRoot::new) - } -} - -impl ::protobuf::Clear for TrustedRoot { - fn clear(&mut self) { - self.media_type.clear(); - self.tlogs.clear(); - self.certificate_authorities.clear(); - self.ctlogs.clear(); - self.timestamp_authorities.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for TrustedRoot { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for TrustedRoot { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x18sigstore_trustroot.proto\x12\x19dev.sigstore.trustroot.v1\x1a\x15s\ - igstore_common.proto\"\xfa\x01\n\x17TransparencyLogInstance\x12\x19\n\ - \x08base_url\x18\x01\x20\x01(\tR\x07baseUrl\x12L\n\x0ehash_algorithm\x18\ - \x02\x20\x01(\x0e2%.dev.sigstore.common.v1.HashAlgorithmR\rhashAlgorithm\ - \x12@\n\npublic_key\x18\x03\x20\x01(\x0b2!.dev.sigstore.common.v1.Public\ - KeyR\tpublicKey\x124\n\x06log_id\x18\x04\x20\x01(\x0b2\x1d.dev.sigstore.\ - common.v1.LogIdR\x05logId\"\xfa\x01\n\x14CertificateAuthority\x12C\n\x07\ - subject\x18\x01\x20\x01(\x0b2).dev.sigstore.common.v1.DistinguishedNameR\ - \x07subject\x12\x10\n\x03uri\x18\x02\x20\x01(\tR\x03uri\x12K\n\ncert_cha\ - in\x18\x03\x20\x01(\x0b2,.dev.sigstore.common.v1.X509CertificateChainR\t\ - certChain\x12>\n\tvalid_for\x18\x04\x20\x01(\x0b2!.dev.sigstore.common.v\ - 1.TimeRangeR\x08validFor\"\x92\x03\n\x0bTrustedRoot\x12\x1d\n\nmedia_typ\ - e\x18\x01\x20\x01(\tR\tmediaType\x12H\n\x05tlogs\x18\x02\x20\x03(\x0b22.\ - dev.sigstore.trustroot.v1.TransparencyLogInstanceR\x05tlogs\x12h\n\x17ce\ - rtificate_authorities\x18\x03\x20\x03(\x0b2/.dev.sigstore.trustroot.v1.C\ - ertificateAuthorityR\x16certificateAuthorities\x12J\n\x06ctlogs\x18\x04\ - \x20\x03(\x0b22.dev.sigstore.trustroot.v1.TransparencyLogInstanceR\x06ct\ - logs\x12d\n\x15timestamp_authorities\x18\x05\x20\x03(\x0b2/.dev.sigstore\ - .trustroot.v1.CertificateAuthorityR\x14timestampAuthoritiesB\x88\x01\n\ - \x1fdev.sigstore.proto.trustroot.v1B\x0eTrustRootProtoP\x01Z9github.com/\ - sigstore/protobuf-specs/gen/pb-go/trustroot/v1\xea\x02\x17Sigstore::Trus\ - tRoot::V1b\x06proto3\ -"; - -static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} diff --git a/gen/pb-rust/src/sigstore_verification.rs b/gen/pb-rust/src/sigstore_verification.rs deleted file mode 100644 index 5be462fb..00000000 --- a/gen/pb-rust/src/sigstore_verification.rs +++ /dev/null @@ -1,2501 +0,0 @@ -// This file is generated by rust-protobuf 2.28.0. Do not edit -// @generated - -// https://github.com/rust-lang/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy::all)] - -#![allow(unused_attributes)] -#![cfg_attr(rustfmt, rustfmt::skip)] - -#![allow(box_pointers)] -#![allow(dead_code)] -#![allow(missing_docs)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(non_upper_case_globals)] -#![allow(trivial_casts)] -#![allow(unused_imports)] -#![allow(unused_results)] -//! Generated file from `sigstore_verification.proto` - -/// Generated files are compatible only with the same version -/// of protobuf runtime. -// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; - -#[derive(PartialEq,Clone,Default)] -pub struct CertificateIdentity { - // message fields - pub issuer: ::std::string::String, - pub san: ::protobuf::SingularPtrField, - pub oids: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CertificateIdentity { - fn default() -> &'a CertificateIdentity { - ::default_instance() - } -} - -impl CertificateIdentity { - pub fn new() -> CertificateIdentity { - ::std::default::Default::default() - } - - // string issuer = 1; - - - pub fn get_issuer(&self) -> &str { - &self.issuer - } - pub fn clear_issuer(&mut self) { - self.issuer.clear(); - } - - // Param is passed by value, moved - pub fn set_issuer(&mut self, v: ::std::string::String) { - self.issuer = v; - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_issuer(&mut self) -> &mut ::std::string::String { - &mut self.issuer - } - - // Take field - pub fn take_issuer(&mut self) -> ::std::string::String { - ::std::mem::replace(&mut self.issuer, ::std::string::String::new()) - } - - // .dev.sigstore.common.v1.SubjectAlternativeName san = 2; - - - pub fn get_san(&self) -> &super::sigstore_common::SubjectAlternativeName { - self.san.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_san(&mut self) { - self.san.clear(); - } - - pub fn has_san(&self) -> bool { - self.san.is_some() - } - - // Param is passed by value, moved - pub fn set_san(&mut self, v: super::sigstore_common::SubjectAlternativeName) { - self.san = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_san(&mut self) -> &mut super::sigstore_common::SubjectAlternativeName { - if self.san.is_none() { - self.san.set_default(); - } - self.san.as_mut().unwrap() - } - - // Take field - pub fn take_san(&mut self) -> super::sigstore_common::SubjectAlternativeName { - self.san.take().unwrap_or_else(|| super::sigstore_common::SubjectAlternativeName::new()) - } - - // repeated .dev.sigstore.common.v1.ObjectIdentifierValuePair oids = 3; - - - pub fn get_oids(&self) -> &[super::sigstore_common::ObjectIdentifierValuePair] { - &self.oids - } - pub fn clear_oids(&mut self) { - self.oids.clear(); - } - - // Param is passed by value, moved - pub fn set_oids(&mut self, v: ::protobuf::RepeatedField) { - self.oids = v; - } - - // Mutable pointer to the field. - pub fn mut_oids(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.oids - } - - // Take field - pub fn take_oids(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.oids, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CertificateIdentity { - fn is_initialized(&self) -> bool { - for v in &self.san { - if !v.is_initialized() { - return false; - } - }; - for v in &self.oids { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.issuer)?; - }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.san)?; - }, - 3 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.oids)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if !self.issuer.is_empty() { - my_size += ::protobuf::rt::string_size(1, &self.issuer); - } - if let Some(ref v) = self.san.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - for value in &self.oids { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if !self.issuer.is_empty() { - os.write_string(1, &self.issuer)?; - } - if let Some(ref v) = self.san.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - for v in &self.oids { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CertificateIdentity { - CertificateIdentity::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "issuer", - |m: &CertificateIdentity| { &m.issuer }, - |m: &mut CertificateIdentity| { &mut m.issuer }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "san", - |m: &CertificateIdentity| { &m.san }, - |m: &mut CertificateIdentity| { &mut m.san }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "oids", - |m: &CertificateIdentity| { &m.oids }, - |m: &mut CertificateIdentity| { &mut m.oids }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CertificateIdentity", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CertificateIdentity { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CertificateIdentity::new) - } -} - -impl ::protobuf::Clear for CertificateIdentity { - fn clear(&mut self) { - self.issuer.clear(); - self.san.clear(); - self.oids.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CertificateIdentity { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CertificateIdentity { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct CertificateIdentities { - // message fields - pub identities: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a CertificateIdentities { - fn default() -> &'a CertificateIdentities { - ::default_instance() - } -} - -impl CertificateIdentities { - pub fn new() -> CertificateIdentities { - ::std::default::Default::default() - } - - // repeated .dev.sigstore.verification.v1.CertificateIdentity identities = 1; - - - pub fn get_identities(&self) -> &[CertificateIdentity] { - &self.identities - } - pub fn clear_identities(&mut self) { - self.identities.clear(); - } - - // Param is passed by value, moved - pub fn set_identities(&mut self, v: ::protobuf::RepeatedField) { - self.identities = v; - } - - // Mutable pointer to the field. - pub fn mut_identities(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.identities - } - - // Take field - pub fn take_identities(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.identities, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for CertificateIdentities { - fn is_initialized(&self) -> bool { - for v in &self.identities { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.identities)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.identities { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.identities { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> CertificateIdentities { - CertificateIdentities::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "identities", - |m: &CertificateIdentities| { &m.identities }, - |m: &mut CertificateIdentities| { &mut m.identities }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "CertificateIdentities", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static CertificateIdentities { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(CertificateIdentities::new) - } -} - -impl ::protobuf::Clear for CertificateIdentities { - fn clear(&mut self) { - self.identities.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for CertificateIdentities { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for CertificateIdentities { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PublicKeyIdentities { - // message fields - pub public_keys: ::protobuf::RepeatedField, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a PublicKeyIdentities { - fn default() -> &'a PublicKeyIdentities { - ::default_instance() - } -} - -impl PublicKeyIdentities { - pub fn new() -> PublicKeyIdentities { - ::std::default::Default::default() - } - - // repeated .dev.sigstore.common.v1.PublicKey public_keys = 1; - - - pub fn get_public_keys(&self) -> &[super::sigstore_common::PublicKey] { - &self.public_keys - } - pub fn clear_public_keys(&mut self) { - self.public_keys.clear(); - } - - // Param is passed by value, moved - pub fn set_public_keys(&mut self, v: ::protobuf::RepeatedField) { - self.public_keys = v; - } - - // Mutable pointer to the field. - pub fn mut_public_keys(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.public_keys - } - - // Take field - pub fn take_public_keys(&mut self) -> ::protobuf::RepeatedField { - ::std::mem::replace(&mut self.public_keys, ::protobuf::RepeatedField::new()) - } -} - -impl ::protobuf::Message for PublicKeyIdentities { - fn is_initialized(&self) -> bool { - for v in &self.public_keys { - if !v.is_initialized() { - return false; - } - }; - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.public_keys)?; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - for value in &self.public_keys { - let len = value.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }; - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - for v in &self.public_keys { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }; - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublicKeyIdentities { - PublicKeyIdentities::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "public_keys", - |m: &PublicKeyIdentities| { &m.public_keys }, - |m: &mut PublicKeyIdentities| { &mut m.public_keys }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "PublicKeyIdentities", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static PublicKeyIdentities { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(PublicKeyIdentities::new) - } -} - -impl ::protobuf::Clear for PublicKeyIdentities { - fn clear(&mut self) { - self.public_keys.clear(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublicKeyIdentities { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublicKeyIdentities { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ArtifactVerificationOptions { - // message oneof groups - pub signers: ::std::option::Option, - pub _tlog_options: ::std::option::Option, - pub _ctlog_options: ::std::option::Option, - pub _tsa_options: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions { - fn default() -> &'a ArtifactVerificationOptions { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum ArtifactVerificationOptions_oneof_signers { - certificate_identities(CertificateIdentities), - public_keys(PublicKeyIdentities), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum ArtifactVerificationOptions_oneof__tlog_options { - tlog_options(ArtifactVerificationOptions_TlogOptions), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum ArtifactVerificationOptions_oneof__ctlog_options { - ctlog_options(ArtifactVerificationOptions_CtlogOptions), -} - -#[derive(Clone,PartialEq,Debug)] -pub enum ArtifactVerificationOptions_oneof__tsa_options { - tsa_options(ArtifactVerificationOptions_TimestampAuthorityOptions), -} - -impl ArtifactVerificationOptions { - pub fn new() -> ArtifactVerificationOptions { - ::std::default::Default::default() - } - - // .dev.sigstore.verification.v1.CertificateIdentities certificate_identities = 1; - - - pub fn get_certificate_identities(&self) -> &CertificateIdentities { - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_certificate_identities(&mut self) { - self.signers = ::std::option::Option::None; - } - - pub fn has_certificate_identities(&self) -> bool { - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_certificate_identities(&mut self, v: CertificateIdentities) { - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(v)) - } - - // Mutable pointer to the field. - pub fn mut_certificate_identities(&mut self) -> &mut CertificateIdentities { - if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(_)) = self.signers { - } else { - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(CertificateIdentities::new())); - } - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_certificate_identities(&mut self) -> CertificateIdentities { - if self.has_certificate_identities() { - match self.signers.take() { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(v)) => v, - _ => panic!(), - } - } else { - CertificateIdentities::new() - } - } - - // .dev.sigstore.verification.v1.PublicKeyIdentities public_keys = 2; - - - pub fn get_public_keys(&self) -> &PublicKeyIdentities { - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_public_keys(&mut self) { - self.signers = ::std::option::Option::None; - } - - pub fn has_public_keys(&self) -> bool { - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_public_keys(&mut self, v: PublicKeyIdentities) { - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(v)) - } - - // Mutable pointer to the field. - pub fn mut_public_keys(&mut self) -> &mut PublicKeyIdentities { - if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(_)) = self.signers { - } else { - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(PublicKeyIdentities::new())); - } - match self.signers { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_public_keys(&mut self) -> PublicKeyIdentities { - if self.has_public_keys() { - match self.signers.take() { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(v)) => v, - _ => panic!(), - } - } else { - PublicKeyIdentities::new() - } - } - - // .dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions tlog_options = 3; - - - pub fn get_tlog_options(&self) -> &ArtifactVerificationOptions_TlogOptions { - match self._tlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tlog_options(&mut self) { - self._tlog_options = ::std::option::Option::None; - } - - pub fn has_tlog_options(&self) -> bool { - match self._tlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tlog_options(&mut self, v: ArtifactVerificationOptions_TlogOptions) { - self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(v)) - } - - // Mutable pointer to the field. - pub fn mut_tlog_options(&mut self) -> &mut ArtifactVerificationOptions_TlogOptions { - if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(_)) = self._tlog_options { - } else { - self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ArtifactVerificationOptions_TlogOptions::new())); - } - match self._tlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tlog_options(&mut self) -> ArtifactVerificationOptions_TlogOptions { - if self.has_tlog_options() { - match self._tlog_options.take() { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(v)) => v, - _ => panic!(), - } - } else { - ArtifactVerificationOptions_TlogOptions::new() - } - } - - // .dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions ctlog_options = 4; - - - pub fn get_ctlog_options(&self) -> &ArtifactVerificationOptions_CtlogOptions { - match self._ctlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_ctlog_options(&mut self) { - self._ctlog_options = ::std::option::Option::None; - } - - pub fn has_ctlog_options(&self) -> bool { - match self._ctlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_ctlog_options(&mut self, v: ArtifactVerificationOptions_CtlogOptions) { - self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(v)) - } - - // Mutable pointer to the field. - pub fn mut_ctlog_options(&mut self) -> &mut ArtifactVerificationOptions_CtlogOptions { - if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(_)) = self._ctlog_options { - } else { - self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ArtifactVerificationOptions_CtlogOptions::new())); - } - match self._ctlog_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_ctlog_options(&mut self) -> ArtifactVerificationOptions_CtlogOptions { - if self.has_ctlog_options() { - match self._ctlog_options.take() { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(v)) => v, - _ => panic!(), - } - } else { - ArtifactVerificationOptions_CtlogOptions::new() - } - } - - // .dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions tsa_options = 5; - - - pub fn get_tsa_options(&self) -> &ArtifactVerificationOptions_TimestampAuthorityOptions { - match self._tsa_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_tsa_options(&mut self) { - self._tsa_options = ::std::option::Option::None; - } - - pub fn has_tsa_options(&self) -> bool { - match self._tsa_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_tsa_options(&mut self, v: ArtifactVerificationOptions_TimestampAuthorityOptions) { - self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(v)) - } - - // Mutable pointer to the field. - pub fn mut_tsa_options(&mut self) -> &mut ArtifactVerificationOptions_TimestampAuthorityOptions { - if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(_)) = self._tsa_options { - } else { - self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ArtifactVerificationOptions_TimestampAuthorityOptions::new())); - } - match self._tsa_options { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_tsa_options(&mut self) -> ArtifactVerificationOptions_TimestampAuthorityOptions { - if self.has_tsa_options() { - match self._tsa_options.take() { - ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(v)) => v, - _ => panic!(), - } - } else { - ArtifactVerificationOptions_TimestampAuthorityOptions::new() - } - } -} - -impl ::protobuf::Message for ArtifactVerificationOptions { - fn is_initialized(&self) -> bool { - if let Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v)) = self.signers { - if !v.is_initialized() { - return false; - } - } - if let Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref v)) = self.signers { - if !v.is_initialized() { - return false; - } - } - if let Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v)) = self._tlog_options { - if !v.is_initialized() { - return false; - } - } - if let Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v)) = self._ctlog_options { - if !v.is_initialized() { - return false; - } - } - if let Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v)) = self._tsa_options { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(is.read_message()?)); - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(is.read_message()?)); - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(is.read_message()?)); - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(is.read_message()?)); - }, - 5 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.signers { - match v { - &ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - &ArtifactVerificationOptions_oneof_signers::public_keys(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._tlog_options { - match v { - &ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._ctlog_options { - match v { - &ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._tsa_options { - match v { - &ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.signers { - match v { - &ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v) => { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - &ArtifactVerificationOptions_oneof_signers::public_keys(ref v) => { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._tlog_options { - match v { - &ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v) => { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._ctlog_options { - match v { - &ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - if let ::std::option::Option::Some(ref v) = self._tsa_options { - match v { - &ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v) => { - os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ArtifactVerificationOptions { - ArtifactVerificationOptions::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, CertificateIdentities>( - "certificate_identities", - ArtifactVerificationOptions::has_certificate_identities, - ArtifactVerificationOptions::get_certificate_identities, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, PublicKeyIdentities>( - "public_keys", - ArtifactVerificationOptions::has_public_keys, - ArtifactVerificationOptions::get_public_keys, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_TlogOptions>( - "tlog_options", - ArtifactVerificationOptions::has_tlog_options, - ArtifactVerificationOptions::get_tlog_options, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_CtlogOptions>( - "ctlog_options", - ArtifactVerificationOptions::has_ctlog_options, - ArtifactVerificationOptions::get_ctlog_options, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_TimestampAuthorityOptions>( - "tsa_options", - ArtifactVerificationOptions::has_tsa_options, - ArtifactVerificationOptions::get_tsa_options, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ArtifactVerificationOptions", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ArtifactVerificationOptions { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ArtifactVerificationOptions::new) - } -} - -impl ::protobuf::Clear for ArtifactVerificationOptions { - fn clear(&mut self) { - self.signers = ::std::option::Option::None; - self.signers = ::std::option::Option::None; - self._tlog_options = ::std::option::Option::None; - self._ctlog_options = ::std::option::Option::None; - self._tsa_options = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ArtifactVerificationOptions { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ArtifactVerificationOptions_TlogOptions { - // message fields - pub threshold: i32, - pub perform_online_verification: bool, - pub disable: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_TlogOptions { - fn default() -> &'a ArtifactVerificationOptions_TlogOptions { - ::default_instance() - } -} - -impl ArtifactVerificationOptions_TlogOptions { - pub fn new() -> ArtifactVerificationOptions_TlogOptions { - ::std::default::Default::default() - } - - // int32 threshold = 1; - - - pub fn get_threshold(&self) -> i32 { - self.threshold - } - pub fn clear_threshold(&mut self) { - self.threshold = 0; - } - - // Param is passed by value, moved - pub fn set_threshold(&mut self, v: i32) { - self.threshold = v; - } - - // bool perform_online_verification = 2; - - - pub fn get_perform_online_verification(&self) -> bool { - self.perform_online_verification - } - pub fn clear_perform_online_verification(&mut self) { - self.perform_online_verification = false; - } - - // Param is passed by value, moved - pub fn set_perform_online_verification(&mut self, v: bool) { - self.perform_online_verification = v; - } - - // bool disable = 3; - - - pub fn get_disable(&self) -> bool { - self.disable - } - pub fn clear_disable(&mut self) { - self.disable = false; - } - - // Param is passed by value, moved - pub fn set_disable(&mut self, v: bool) { - self.disable = v; - } -} - -impl ::protobuf::Message for ArtifactVerificationOptions_TlogOptions { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.threshold = tmp; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.perform_online_verification = tmp; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.disable = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.threshold != 0 { - my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); - } - if self.perform_online_verification != false { - my_size += 2; - } - if self.disable != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.threshold != 0 { - os.write_int32(1, self.threshold)?; - } - if self.perform_online_verification != false { - os.write_bool(2, self.perform_online_verification)?; - } - if self.disable != false { - os.write_bool(3, self.disable)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ArtifactVerificationOptions_TlogOptions { - ArtifactVerificationOptions_TlogOptions::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "threshold", - |m: &ArtifactVerificationOptions_TlogOptions| { &m.threshold }, - |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.threshold }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "perform_online_verification", - |m: &ArtifactVerificationOptions_TlogOptions| { &m.perform_online_verification }, - |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.perform_online_verification }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "disable", - |m: &ArtifactVerificationOptions_TlogOptions| { &m.disable }, - |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.disable }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ArtifactVerificationOptions.TlogOptions", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ArtifactVerificationOptions_TlogOptions { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ArtifactVerificationOptions_TlogOptions::new) - } -} - -impl ::protobuf::Clear for ArtifactVerificationOptions_TlogOptions { - fn clear(&mut self) { - self.threshold = 0; - self.perform_online_verification = false; - self.disable = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ArtifactVerificationOptions_TlogOptions { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_TlogOptions { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ArtifactVerificationOptions_CtlogOptions { - // message fields - pub threshold: i32, - pub detached_sct: bool, - pub disable: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_CtlogOptions { - fn default() -> &'a ArtifactVerificationOptions_CtlogOptions { - ::default_instance() - } -} - -impl ArtifactVerificationOptions_CtlogOptions { - pub fn new() -> ArtifactVerificationOptions_CtlogOptions { - ::std::default::Default::default() - } - - // int32 threshold = 1; - - - pub fn get_threshold(&self) -> i32 { - self.threshold - } - pub fn clear_threshold(&mut self) { - self.threshold = 0; - } - - // Param is passed by value, moved - pub fn set_threshold(&mut self, v: i32) { - self.threshold = v; - } - - // bool detached_sct = 2; - - - pub fn get_detached_sct(&self) -> bool { - self.detached_sct - } - pub fn clear_detached_sct(&mut self) { - self.detached_sct = false; - } - - // Param is passed by value, moved - pub fn set_detached_sct(&mut self, v: bool) { - self.detached_sct = v; - } - - // bool disable = 3; - - - pub fn get_disable(&self) -> bool { - self.disable - } - pub fn clear_disable(&mut self) { - self.disable = false; - } - - // Param is passed by value, moved - pub fn set_disable(&mut self, v: bool) { - self.disable = v; - } -} - -impl ::protobuf::Message for ArtifactVerificationOptions_CtlogOptions { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.threshold = tmp; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.detached_sct = tmp; - }, - 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.disable = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.threshold != 0 { - my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); - } - if self.detached_sct != false { - my_size += 2; - } - if self.disable != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.threshold != 0 { - os.write_int32(1, self.threshold)?; - } - if self.detached_sct != false { - os.write_bool(2, self.detached_sct)?; - } - if self.disable != false { - os.write_bool(3, self.disable)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ArtifactVerificationOptions_CtlogOptions { - ArtifactVerificationOptions_CtlogOptions::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "threshold", - |m: &ArtifactVerificationOptions_CtlogOptions| { &m.threshold }, - |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.threshold }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "detached_sct", - |m: &ArtifactVerificationOptions_CtlogOptions| { &m.detached_sct }, - |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.detached_sct }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "disable", - |m: &ArtifactVerificationOptions_CtlogOptions| { &m.disable }, - |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.disable }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ArtifactVerificationOptions.CtlogOptions", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ArtifactVerificationOptions_CtlogOptions { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ArtifactVerificationOptions_CtlogOptions::new) - } -} - -impl ::protobuf::Clear for ArtifactVerificationOptions_CtlogOptions { - fn clear(&mut self) { - self.threshold = 0; - self.detached_sct = false; - self.disable = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ArtifactVerificationOptions_CtlogOptions { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_CtlogOptions { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct ArtifactVerificationOptions_TimestampAuthorityOptions { - // message fields - pub threshold: i32, - pub disable: bool, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_TimestampAuthorityOptions { - fn default() -> &'a ArtifactVerificationOptions_TimestampAuthorityOptions { - ::default_instance() - } -} - -impl ArtifactVerificationOptions_TimestampAuthorityOptions { - pub fn new() -> ArtifactVerificationOptions_TimestampAuthorityOptions { - ::std::default::Default::default() - } - - // int32 threshold = 1; - - - pub fn get_threshold(&self) -> i32 { - self.threshold - } - pub fn clear_threshold(&mut self) { - self.threshold = 0; - } - - // Param is passed by value, moved - pub fn set_threshold(&mut self, v: i32) { - self.threshold = v; - } - - // bool disable = 2; - - - pub fn get_disable(&self) -> bool { - self.disable - } - pub fn clear_disable(&mut self) { - self.disable = false; - } - - // Param is passed by value, moved - pub fn set_disable(&mut self, v: bool) { - self.disable = v; - } -} - -impl ::protobuf::Message for ArtifactVerificationOptions_TimestampAuthorityOptions { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_int32()?; - self.threshold = tmp; - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_bool()?; - self.disable = tmp; - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if self.threshold != 0 { - my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); - } - if self.disable != false { - my_size += 2; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if self.threshold != 0 { - os.write_int32(1, self.threshold)?; - } - if self.disable != false { - os.write_bool(2, self.disable)?; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> ArtifactVerificationOptions_TimestampAuthorityOptions { - ArtifactVerificationOptions_TimestampAuthorityOptions::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( - "threshold", - |m: &ArtifactVerificationOptions_TimestampAuthorityOptions| { &m.threshold }, - |m: &mut ArtifactVerificationOptions_TimestampAuthorityOptions| { &mut m.threshold }, - )); - fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "disable", - |m: &ArtifactVerificationOptions_TimestampAuthorityOptions| { &m.disable }, - |m: &mut ArtifactVerificationOptions_TimestampAuthorityOptions| { &mut m.disable }, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "ArtifactVerificationOptions.TimestampAuthorityOptions", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static ArtifactVerificationOptions_TimestampAuthorityOptions { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(ArtifactVerificationOptions_TimestampAuthorityOptions::new) - } -} - -impl ::protobuf::Clear for ArtifactVerificationOptions_TimestampAuthorityOptions { - fn clear(&mut self) { - self.threshold = 0; - self.disable = false; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for ArtifactVerificationOptions_TimestampAuthorityOptions { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_TimestampAuthorityOptions { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Artifact { - // message oneof groups - pub data: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Artifact { - fn default() -> &'a Artifact { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum Artifact_oneof_data { - artifact_uri(::std::string::String), - artifact(::std::vec::Vec), -} - -impl Artifact { - pub fn new() -> Artifact { - ::std::default::Default::default() - } - - // string artifact_uri = 1; - - - pub fn get_artifact_uri(&self) -> &str { - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(ref v)) => v, - _ => "", - } - } - pub fn clear_artifact_uri(&mut self) { - self.data = ::std::option::Option::None; - } - - pub fn has_artifact_uri(&self) -> bool { - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_artifact_uri(&mut self, v: ::std::string::String) { - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(v)) - } - - // Mutable pointer to the field. - pub fn mut_artifact_uri(&mut self) -> &mut ::std::string::String { - if let ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(_)) = self.data { - } else { - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(::std::string::String::new())); - } - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_artifact_uri(&mut self) -> ::std::string::String { - if self.has_artifact_uri() { - match self.data.take() { - ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(v)) => v, - _ => panic!(), - } - } else { - ::std::string::String::new() - } - } - - // bytes artifact = 2; - - - pub fn get_artifact(&self) -> &[u8] { - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact(ref v)) => v, - _ => &[], - } - } - pub fn clear_artifact(&mut self) { - self.data = ::std::option::Option::None; - } - - pub fn has_artifact(&self) -> bool { - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_artifact(&mut self, v: ::std::vec::Vec) { - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(v)) - } - - // Mutable pointer to the field. - pub fn mut_artifact(&mut self) -> &mut ::std::vec::Vec { - if let ::std::option::Option::Some(Artifact_oneof_data::artifact(_)) = self.data { - } else { - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(::std::vec::Vec::new())); - } - match self.data { - ::std::option::Option::Some(Artifact_oneof_data::artifact(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_artifact(&mut self) -> ::std::vec::Vec { - if self.has_artifact() { - match self.data.take() { - ::std::option::Option::Some(Artifact_oneof_data::artifact(v)) => v, - _ => panic!(), - } - } else { - ::std::vec::Vec::new() - } - } -} - -impl ::protobuf::Message for Artifact { - fn is_initialized(&self) -> bool { - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(is.read_string()?)); - }, - 2 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(is.read_bytes()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let ::std::option::Option::Some(ref v) = self.data { - match v { - &Artifact_oneof_data::artifact_uri(ref v) => { - my_size += ::protobuf::rt::string_size(1, &v); - }, - &Artifact_oneof_data::artifact(ref v) => { - my_size += ::protobuf::rt::bytes_size(2, &v); - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let ::std::option::Option::Some(ref v) = self.data { - match v { - &Artifact_oneof_data::artifact_uri(ref v) => { - os.write_string(1, v)?; - }, - &Artifact_oneof_data::artifact(ref v) => { - os.write_bytes(2, v)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Artifact { - Artifact::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( - "artifact_uri", - Artifact::has_artifact_uri, - Artifact::get_artifact_uri, - )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( - "artifact", - Artifact::has_artifact, - Artifact::get_artifact, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Artifact", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Artifact { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Artifact::new) - } -} - -impl ::protobuf::Clear for Artifact { - fn clear(&mut self) { - self.data = ::std::option::Option::None; - self.data = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Artifact { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Artifact { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Input { - // message fields - pub artifact_trust_root: ::protobuf::SingularPtrField, - pub artifact_verification_options: ::protobuf::SingularPtrField, - pub bundle: ::protobuf::SingularPtrField, - // message oneof groups - pub _artifact: ::std::option::Option, - // special fields - pub unknown_fields: ::protobuf::UnknownFields, - pub cached_size: ::protobuf::CachedSize, -} - -impl<'a> ::std::default::Default for &'a Input { - fn default() -> &'a Input { - ::default_instance() - } -} - -#[derive(Clone,PartialEq,Debug)] -pub enum Input_oneof__artifact { - artifact(Artifact), -} - -impl Input { - pub fn new() -> Input { - ::std::default::Default::default() - } - - // .dev.sigstore.trustroot.v1.TrustedRoot artifact_trust_root = 1; - - - pub fn get_artifact_trust_root(&self) -> &super::sigstore_trustroot::TrustedRoot { - self.artifact_trust_root.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_artifact_trust_root(&mut self) { - self.artifact_trust_root.clear(); - } - - pub fn has_artifact_trust_root(&self) -> bool { - self.artifact_trust_root.is_some() - } - - // Param is passed by value, moved - pub fn set_artifact_trust_root(&mut self, v: super::sigstore_trustroot::TrustedRoot) { - self.artifact_trust_root = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_artifact_trust_root(&mut self) -> &mut super::sigstore_trustroot::TrustedRoot { - if self.artifact_trust_root.is_none() { - self.artifact_trust_root.set_default(); - } - self.artifact_trust_root.as_mut().unwrap() - } - - // Take field - pub fn take_artifact_trust_root(&mut self) -> super::sigstore_trustroot::TrustedRoot { - self.artifact_trust_root.take().unwrap_or_else(|| super::sigstore_trustroot::TrustedRoot::new()) - } - - // .dev.sigstore.verification.v1.ArtifactVerificationOptions artifact_verification_options = 2; - - - pub fn get_artifact_verification_options(&self) -> &ArtifactVerificationOptions { - self.artifact_verification_options.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_artifact_verification_options(&mut self) { - self.artifact_verification_options.clear(); - } - - pub fn has_artifact_verification_options(&self) -> bool { - self.artifact_verification_options.is_some() - } - - // Param is passed by value, moved - pub fn set_artifact_verification_options(&mut self, v: ArtifactVerificationOptions) { - self.artifact_verification_options = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_artifact_verification_options(&mut self) -> &mut ArtifactVerificationOptions { - if self.artifact_verification_options.is_none() { - self.artifact_verification_options.set_default(); - } - self.artifact_verification_options.as_mut().unwrap() - } - - // Take field - pub fn take_artifact_verification_options(&mut self) -> ArtifactVerificationOptions { - self.artifact_verification_options.take().unwrap_or_else(|| ArtifactVerificationOptions::new()) - } - - // .dev.sigstore.bundle.v1.Bundle bundle = 3; - - - pub fn get_bundle(&self) -> &super::sigstore_bundle::Bundle { - self.bundle.as_ref().unwrap_or_else(|| ::default_instance()) - } - pub fn clear_bundle(&mut self) { - self.bundle.clear(); - } - - pub fn has_bundle(&self) -> bool { - self.bundle.is_some() - } - - // Param is passed by value, moved - pub fn set_bundle(&mut self, v: super::sigstore_bundle::Bundle) { - self.bundle = ::protobuf::SingularPtrField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_bundle(&mut self) -> &mut super::sigstore_bundle::Bundle { - if self.bundle.is_none() { - self.bundle.set_default(); - } - self.bundle.as_mut().unwrap() - } - - // Take field - pub fn take_bundle(&mut self) -> super::sigstore_bundle::Bundle { - self.bundle.take().unwrap_or_else(|| super::sigstore_bundle::Bundle::new()) - } - - // .dev.sigstore.verification.v1.Artifact artifact = 4; - - - pub fn get_artifact(&self) -> &Artifact { - match self._artifact { - ::std::option::Option::Some(Input_oneof__artifact::artifact(ref v)) => v, - _ => ::default_instance(), - } - } - pub fn clear_artifact(&mut self) { - self._artifact = ::std::option::Option::None; - } - - pub fn has_artifact(&self) -> bool { - match self._artifact { - ::std::option::Option::Some(Input_oneof__artifact::artifact(..)) => true, - _ => false, - } - } - - // Param is passed by value, moved - pub fn set_artifact(&mut self, v: Artifact) { - self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(v)) - } - - // Mutable pointer to the field. - pub fn mut_artifact(&mut self) -> &mut Artifact { - if let ::std::option::Option::Some(Input_oneof__artifact::artifact(_)) = self._artifact { - } else { - self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(Artifact::new())); - } - match self._artifact { - ::std::option::Option::Some(Input_oneof__artifact::artifact(ref mut v)) => v, - _ => panic!(), - } - } - - // Take field - pub fn take_artifact(&mut self) -> Artifact { - if self.has_artifact() { - match self._artifact.take() { - ::std::option::Option::Some(Input_oneof__artifact::artifact(v)) => v, - _ => panic!(), - } - } else { - Artifact::new() - } - } -} - -impl ::protobuf::Message for Input { - fn is_initialized(&self) -> bool { - for v in &self.artifact_trust_root { - if !v.is_initialized() { - return false; - } - }; - for v in &self.artifact_verification_options { - if !v.is_initialized() { - return false; - } - }; - for v in &self.bundle { - if !v.is_initialized() { - return false; - } - }; - if let Some(Input_oneof__artifact::artifact(ref v)) = self._artifact { - if !v.is_initialized() { - return false; - } - } - true - } - - fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { - while !is.eof()? { - let (field_number, wire_type) = is.read_tag_unpack()?; - match field_number { - 1 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.artifact_trust_root)?; - }, - 2 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.artifact_verification_options)?; - }, - 3 => { - ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.bundle)?; - }, - 4 => { - if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(is.read_message()?)); - }, - _ => { - ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; - }, - }; - } - ::std::result::Result::Ok(()) - } - - // Compute sizes of nested messages - #[allow(unused_variables)] - fn compute_size(&self) -> u32 { - let mut my_size = 0; - if let Some(ref v) = self.artifact_trust_root.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.artifact_verification_options.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let Some(ref v) = self.bundle.as_ref() { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - } - if let ::std::option::Option::Some(ref v) = self._artifact { - match v { - &Input_oneof__artifact::artifact(ref v) => { - let len = v.compute_size(); - my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; - }, - }; - } - my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); - self.cached_size.set(my_size); - my_size - } - - fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { - if let Some(ref v) = self.artifact_trust_root.as_ref() { - os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.artifact_verification_options.as_ref() { - os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let Some(ref v) = self.bundle.as_ref() { - os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - } - if let ::std::option::Option::Some(ref v) = self._artifact { - match v { - &Input_oneof__artifact::artifact(ref v) => { - os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; - os.write_raw_varint32(v.get_cached_size())?; - v.write_to_with_cached_sizes(os)?; - }, - }; - } - os.write_unknown_fields(self.get_unknown_fields())?; - ::std::result::Result::Ok(()) - } - - fn get_cached_size(&self) -> u32 { - self.cached_size.get() - } - - fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { - &self.unknown_fields - } - - fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { - &mut self.unknown_fields - } - - fn as_any(&self) -> &dyn (::std::any::Any) { - self as &dyn (::std::any::Any) - } - fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { - self as &mut dyn (::std::any::Any) - } - fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Input { - Input::new() - } - - fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { - static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; - descriptor.get(|| { - let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "artifact_trust_root", - |m: &Input| { &m.artifact_trust_root }, - |m: &mut Input| { &mut m.artifact_trust_root }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "artifact_verification_options", - |m: &Input| { &m.artifact_verification_options }, - |m: &mut Input| { &mut m.artifact_verification_options }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( - "bundle", - |m: &Input| { &m.bundle }, - |m: &mut Input| { &mut m.bundle }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Artifact>( - "artifact", - Input::has_artifact, - Input::get_artifact, - )); - ::protobuf::reflect::MessageDescriptor::new_pb_name::( - "Input", - fields, - file_descriptor_proto() - ) - }) - } - - fn default_instance() -> &'static Input { - static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; - instance.get(Input::new) - } -} - -impl ::protobuf::Clear for Input { - fn clear(&mut self) { - self.artifact_trust_root.clear(); - self.artifact_verification_options.clear(); - self.bundle.clear(); - self._artifact = ::std::option::Option::None; - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Input { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Input { - fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { - ::protobuf::reflect::ReflectValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x1bsigstore_verification.proto\x12\x1cdev.sigstore.verification.v1\ - \x1a\x15sigstore_common.proto\x1a\x18sigstore_trustroot.proto\x1a\x15sig\ - store_bundle.proto\"\xb6\x01\n\x13CertificateIdentity\x12\x16\n\x06issue\ - r\x18\x01\x20\x01(\tR\x06issuer\x12@\n\x03san\x18\x02\x20\x01(\x0b2..dev\ - .sigstore.common.v1.SubjectAlternativeNameR\x03san\x12E\n\x04oids\x18\ - \x03\x20\x03(\x0b21.dev.sigstore.common.v1.ObjectIdentifierValuePairR\ - \x04oids\"j\n\x15CertificateIdentities\x12Q\n\nidentities\x18\x01\x20\ - \x03(\x0b21.dev.sigstore.verification.v1.CertificateIdentityR\nidentitie\ - s\"Y\n\x13PublicKeyIdentities\x12B\n\x0bpublic_keys\x18\x01\x20\x03(\x0b\ - 2!.dev.sigstore.common.v1.PublicKeyR\npublicKeys\"\xc3\x07\n\x1bArtifact\ - VerificationOptions\x12l\n\x16certificate_identities\x18\x01\x20\x01(\ - \x0b23.dev.sigstore.verification.v1.CertificateIdentitiesH\0R\x15certifi\ - cateIdentities\x12T\n\x0bpublic_keys\x18\x02\x20\x01(\x0b21.dev.sigstore\ - .verification.v1.PublicKeyIdentitiesH\0R\npublicKeys\x12m\n\x0ctlog_opti\ - ons\x18\x03\x20\x01(\x0b2E.dev.sigstore.verification.v1.ArtifactVerifica\ - tionOptions.TlogOptionsH\x01R\x0btlogOptions\x88\x01\x01\x12p\n\rctlog_o\ - ptions\x18\x04\x20\x01(\x0b2F.dev.sigstore.verification.v1.ArtifactVerif\ - icationOptions.CtlogOptionsH\x02R\x0cctlogOptions\x88\x01\x01\x12y\n\x0b\ - tsa_options\x18\x05\x20\x01(\x0b2S.dev.sigstore.verification.v1.Artifact\ - VerificationOptions.TimestampAuthorityOptionsH\x03R\ntsaOptions\x88\x01\ - \x01\x1a\x85\x01\n\x0bTlogOptions\x12\x1c\n\tthreshold\x18\x01\x20\x01(\ - \x05R\tthreshold\x12>\n\x1bperform_online_verification\x18\x02\x20\x01(\ - \x08R\x19performOnlineVerification\x12\x18\n\x07disable\x18\x03\x20\x01(\ - \x08R\x07disable\x1ai\n\x0cCtlogOptions\x12\x1c\n\tthreshold\x18\x01\x20\ - \x01(\x05R\tthreshold\x12!\n\x0cdetached_sct\x18\x02\x20\x01(\x08R\x0bde\ - tachedSct\x12\x18\n\x07disable\x18\x03\x20\x01(\x08R\x07disable\x1aS\n\ - \x19TimestampAuthorityOptions\x12\x1c\n\tthreshold\x18\x01\x20\x01(\x05R\ - \tthreshold\x12\x18\n\x07disable\x18\x02\x20\x01(\x08R\x07disableB\t\n\ - \x07signersB\x0f\n\r_tlog_optionsB\x10\n\x0e_ctlog_optionsB\x0e\n\x0c_ts\ - a_options\"U\n\x08Artifact\x12#\n\x0cartifact_uri\x18\x01\x20\x01(\tH\0R\ - \x0bartifactUri\x12\x1c\n\x08artifact\x18\x02\x20\x01(\x0cH\0R\x08artifa\ - ctB\x06\n\x04data\"\xec\x02\n\x05Input\x12V\n\x13artifact_trust_root\x18\ - \x01\x20\x01(\x0b2&.dev.sigstore.trustroot.v1.TrustedRootR\x11artifactTr\ - ustRoot\x12}\n\x1dartifact_verification_options\x18\x02\x20\x01(\x0b29.d\ - ev.sigstore.verification.v1.ArtifactVerificationOptionsR\x1bartifactVeri\ - ficationOptions\x126\n\x06bundle\x18\x03\x20\x01(\x0b2\x1e.dev.sigstore.\ - bundle.v1.BundleR\x06bundle\x12G\n\x08artifact\x18\x04\x20\x01(\x0b2&.de\ - v.sigstore.verification.v1.ArtifactH\0R\x08artifact\x88\x01\x01B\x0b\n\t\ - _artifactB\x94\x01\n\"dev.sigstore.proto.verification.v1B\x11Verificatio\ - nProtoP\x01Z = ::protobuf::rt::LazyV2::INIT; - -fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { - ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() -} - -pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { - file_descriptor_proto_lazy.get(|| { - parse_descriptor_proto() - }) -} From dcdd646b84c3759275b48f1313b6412ca699b7e4 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Wed, 2 Aug 2023 12:43:38 -0400 Subject: [PATCH 2/7] pb-rust: schemafy only Bundles Signed-off-by: Jack Leightcap pb-rust: schemafy construction Signed-off-by: Jack Leightcap --- Makefile | 23 +++++++----- .../{schema => schemas}/Artifact.schema.json | 0 .../ArtifactVerificationOptions.schema.json | 0 .../{schema => schemas}/Bundle.schema.json | 0 .../CertificateAuthority.schema.json | 0 .../CertificateIdentities.schema.json | 0 .../CertificateIdentity.schema.json | 0 .../Checkpoint.schema.json | 0 .../CloudEvent.schema.json | 0 .../CloudEventBatch.schema.json | 0 .../DistinguishedName.schema.json | 0 .../{schema => schemas}/Envelope.schema.json | 0 .../HashOutput.schema.json | 0 .../InclusionPromise.schema.json | 0 .../InclusionProof.schema.json | 0 .../{schema => schemas}/Input.schema.json | 0 .../KindVersion.schema.json | 0 .../{schema => schemas}/LogId.schema.json | 0 .../MessageSignature.schema.json | 0 .../ObjectIdentifier.schema.json | 0 .../ObjectIdentifierValuePair.schema.json | 0 .../{schema => schemas}/PublicKey.schema.json | 0 .../PublicKeyIdentifier.schema.json | 0 .../PublicKeyIdentities.schema.json | 0 .../RFC3161SignedTimestamp.schema.json | 0 .../{schema => schemas}/Signature.schema.json | 0 .../SubjectAlternativeName.schema.json | 0 .../{schema => schemas}/TimeRange.schema.json | 0 .../TimestampVerificationData.schema.json | 0 .../TransparencyLogEntry.schema.json | 0 .../TransparencyLogInstance.schema.json | 0 .../TrustedRoot.schema.json | 0 .../VerificationMaterial.schema.json | 0 .../X509Certificate.schema.json | 0 .../X509CertificateChain.schema.json | 0 gen/pb-rust/src/lib.rs | 37 ++++++++++++------- 36 files changed, 37 insertions(+), 23 deletions(-) rename gen/pb-rust/{schema => schemas}/Artifact.schema.json (100%) rename gen/pb-rust/{schema => schemas}/ArtifactVerificationOptions.schema.json (100%) rename gen/pb-rust/{schema => schemas}/Bundle.schema.json (100%) rename gen/pb-rust/{schema => schemas}/CertificateAuthority.schema.json (100%) rename gen/pb-rust/{schema => schemas}/CertificateIdentities.schema.json (100%) rename gen/pb-rust/{schema => schemas}/CertificateIdentity.schema.json (100%) rename gen/pb-rust/{schema => schemas}/Checkpoint.schema.json (100%) rename gen/pb-rust/{schema => schemas}/CloudEvent.schema.json (100%) rename gen/pb-rust/{schema => schemas}/CloudEventBatch.schema.json (100%) rename gen/pb-rust/{schema => schemas}/DistinguishedName.schema.json (100%) rename gen/pb-rust/{schema => schemas}/Envelope.schema.json (100%) rename gen/pb-rust/{schema => schemas}/HashOutput.schema.json (100%) rename gen/pb-rust/{schema => schemas}/InclusionPromise.schema.json (100%) rename gen/pb-rust/{schema => schemas}/InclusionProof.schema.json (100%) rename gen/pb-rust/{schema => schemas}/Input.schema.json (100%) rename gen/pb-rust/{schema => schemas}/KindVersion.schema.json (100%) rename gen/pb-rust/{schema => schemas}/LogId.schema.json (100%) rename gen/pb-rust/{schema => schemas}/MessageSignature.schema.json (100%) rename gen/pb-rust/{schema => schemas}/ObjectIdentifier.schema.json (100%) rename gen/pb-rust/{schema => schemas}/ObjectIdentifierValuePair.schema.json (100%) rename gen/pb-rust/{schema => schemas}/PublicKey.schema.json (100%) rename gen/pb-rust/{schema => schemas}/PublicKeyIdentifier.schema.json (100%) rename gen/pb-rust/{schema => schemas}/PublicKeyIdentities.schema.json (100%) rename gen/pb-rust/{schema => schemas}/RFC3161SignedTimestamp.schema.json (100%) rename gen/pb-rust/{schema => schemas}/Signature.schema.json (100%) rename gen/pb-rust/{schema => schemas}/SubjectAlternativeName.schema.json (100%) rename gen/pb-rust/{schema => schemas}/TimeRange.schema.json (100%) rename gen/pb-rust/{schema => schemas}/TimestampVerificationData.schema.json (100%) rename gen/pb-rust/{schema => schemas}/TransparencyLogEntry.schema.json (100%) rename gen/pb-rust/{schema => schemas}/TransparencyLogInstance.schema.json (100%) rename gen/pb-rust/{schema => schemas}/TrustedRoot.schema.json (100%) rename gen/pb-rust/{schema => schemas}/VerificationMaterial.schema.json (100%) rename gen/pb-rust/{schema => schemas}/X509Certificate.schema.json (100%) rename gen/pb-rust/{schema => schemas}/X509CertificateChain.schema.json (100%) diff --git a/Makefile b/Makefile index a5d78a0b..a0e665ba 100644 --- a/Makefile +++ b/Makefile @@ -50,15 +50,6 @@ ruby: docker-image --entrypoint bash ${PROTOC_IMAGE} \ -c "cd ./gen/pb-ruby && protoc -I/opt/include -I../../protos/ --ruby_out=lib ../../protos/*.proto" -rust: docker-image - @echo "Generating rust protobuf files" - docker run \ - --platform linux/amd64 \ - -v ${PWD}:/defs \ - -e "RUST_BACKTRACE=1" \ - --entrypoint bash ${PROTOC_IMAGE} \ - -c "cd gen/pb-rust/codegen && cargo run && rm -rf target/" - jsonschema: docker-image-jsonschema @echo "Generating JSON schema files" docker run \ @@ -67,6 +58,18 @@ jsonschema: docker-image-jsonschema ${JSONSCHEMA_IMAGE} \ -c "cd defs/gen/jsonschema && ./jsonschema.sh -I ../../protos -I /googleapis/ --jsonschema_out=schemas ../../protos/*.proto" +gen/pb-rust/schemas: jsonschema + cp -r gen/jsonschema/schemas $@ + +rust: docker-image gen/pb-rust/schemas + @echo "Generating rust protobuf files" + docker run \ + --platform linux/amd64 \ + -v ${PWD}:/defs \ + -e "RUST_BACKTRACE=1" \ + --entrypoint bash ${PROTOC_IMAGE} \ + -c "cd gen/pb-rust && cargo build" + # docker already does its own caching so we can attempt a build every time .PHONY: docker-image docker-image: @@ -92,7 +95,7 @@ clean: gen/pb-typescript/src/__generated__ \ gen/pb-python/sigstore_protobuf_specs/dev \ gen/pb-python/sigstore_protobuf_specs/io \ - gen/pb-rust/codegen/target \ + gen/pb-rust/schemas \ gen/pb-rust/target docker rmi -f ${PROTOC_IMAGE} diff --git a/gen/pb-rust/schema/Artifact.schema.json b/gen/pb-rust/schemas/Artifact.schema.json similarity index 100% rename from gen/pb-rust/schema/Artifact.schema.json rename to gen/pb-rust/schemas/Artifact.schema.json diff --git a/gen/pb-rust/schema/ArtifactVerificationOptions.schema.json b/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json similarity index 100% rename from gen/pb-rust/schema/ArtifactVerificationOptions.schema.json rename to gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json diff --git a/gen/pb-rust/schema/Bundle.schema.json b/gen/pb-rust/schemas/Bundle.schema.json similarity index 100% rename from gen/pb-rust/schema/Bundle.schema.json rename to gen/pb-rust/schemas/Bundle.schema.json diff --git a/gen/pb-rust/schema/CertificateAuthority.schema.json b/gen/pb-rust/schemas/CertificateAuthority.schema.json similarity index 100% rename from gen/pb-rust/schema/CertificateAuthority.schema.json rename to gen/pb-rust/schemas/CertificateAuthority.schema.json diff --git a/gen/pb-rust/schema/CertificateIdentities.schema.json b/gen/pb-rust/schemas/CertificateIdentities.schema.json similarity index 100% rename from gen/pb-rust/schema/CertificateIdentities.schema.json rename to gen/pb-rust/schemas/CertificateIdentities.schema.json diff --git a/gen/pb-rust/schema/CertificateIdentity.schema.json b/gen/pb-rust/schemas/CertificateIdentity.schema.json similarity index 100% rename from gen/pb-rust/schema/CertificateIdentity.schema.json rename to gen/pb-rust/schemas/CertificateIdentity.schema.json diff --git a/gen/pb-rust/schema/Checkpoint.schema.json b/gen/pb-rust/schemas/Checkpoint.schema.json similarity index 100% rename from gen/pb-rust/schema/Checkpoint.schema.json rename to gen/pb-rust/schemas/Checkpoint.schema.json diff --git a/gen/pb-rust/schema/CloudEvent.schema.json b/gen/pb-rust/schemas/CloudEvent.schema.json similarity index 100% rename from gen/pb-rust/schema/CloudEvent.schema.json rename to gen/pb-rust/schemas/CloudEvent.schema.json diff --git a/gen/pb-rust/schema/CloudEventBatch.schema.json b/gen/pb-rust/schemas/CloudEventBatch.schema.json similarity index 100% rename from gen/pb-rust/schema/CloudEventBatch.schema.json rename to gen/pb-rust/schemas/CloudEventBatch.schema.json diff --git a/gen/pb-rust/schema/DistinguishedName.schema.json b/gen/pb-rust/schemas/DistinguishedName.schema.json similarity index 100% rename from gen/pb-rust/schema/DistinguishedName.schema.json rename to gen/pb-rust/schemas/DistinguishedName.schema.json diff --git a/gen/pb-rust/schema/Envelope.schema.json b/gen/pb-rust/schemas/Envelope.schema.json similarity index 100% rename from gen/pb-rust/schema/Envelope.schema.json rename to gen/pb-rust/schemas/Envelope.schema.json diff --git a/gen/pb-rust/schema/HashOutput.schema.json b/gen/pb-rust/schemas/HashOutput.schema.json similarity index 100% rename from gen/pb-rust/schema/HashOutput.schema.json rename to gen/pb-rust/schemas/HashOutput.schema.json diff --git a/gen/pb-rust/schema/InclusionPromise.schema.json b/gen/pb-rust/schemas/InclusionPromise.schema.json similarity index 100% rename from gen/pb-rust/schema/InclusionPromise.schema.json rename to gen/pb-rust/schemas/InclusionPromise.schema.json diff --git a/gen/pb-rust/schema/InclusionProof.schema.json b/gen/pb-rust/schemas/InclusionProof.schema.json similarity index 100% rename from gen/pb-rust/schema/InclusionProof.schema.json rename to gen/pb-rust/schemas/InclusionProof.schema.json diff --git a/gen/pb-rust/schema/Input.schema.json b/gen/pb-rust/schemas/Input.schema.json similarity index 100% rename from gen/pb-rust/schema/Input.schema.json rename to gen/pb-rust/schemas/Input.schema.json diff --git a/gen/pb-rust/schema/KindVersion.schema.json b/gen/pb-rust/schemas/KindVersion.schema.json similarity index 100% rename from gen/pb-rust/schema/KindVersion.schema.json rename to gen/pb-rust/schemas/KindVersion.schema.json diff --git a/gen/pb-rust/schema/LogId.schema.json b/gen/pb-rust/schemas/LogId.schema.json similarity index 100% rename from gen/pb-rust/schema/LogId.schema.json rename to gen/pb-rust/schemas/LogId.schema.json diff --git a/gen/pb-rust/schema/MessageSignature.schema.json b/gen/pb-rust/schemas/MessageSignature.schema.json similarity index 100% rename from gen/pb-rust/schema/MessageSignature.schema.json rename to gen/pb-rust/schemas/MessageSignature.schema.json diff --git a/gen/pb-rust/schema/ObjectIdentifier.schema.json b/gen/pb-rust/schemas/ObjectIdentifier.schema.json similarity index 100% rename from gen/pb-rust/schema/ObjectIdentifier.schema.json rename to gen/pb-rust/schemas/ObjectIdentifier.schema.json diff --git a/gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json b/gen/pb-rust/schemas/ObjectIdentifierValuePair.schema.json similarity index 100% rename from gen/pb-rust/schema/ObjectIdentifierValuePair.schema.json rename to gen/pb-rust/schemas/ObjectIdentifierValuePair.schema.json diff --git a/gen/pb-rust/schema/PublicKey.schema.json b/gen/pb-rust/schemas/PublicKey.schema.json similarity index 100% rename from gen/pb-rust/schema/PublicKey.schema.json rename to gen/pb-rust/schemas/PublicKey.schema.json diff --git a/gen/pb-rust/schema/PublicKeyIdentifier.schema.json b/gen/pb-rust/schemas/PublicKeyIdentifier.schema.json similarity index 100% rename from gen/pb-rust/schema/PublicKeyIdentifier.schema.json rename to gen/pb-rust/schemas/PublicKeyIdentifier.schema.json diff --git a/gen/pb-rust/schema/PublicKeyIdentities.schema.json b/gen/pb-rust/schemas/PublicKeyIdentities.schema.json similarity index 100% rename from gen/pb-rust/schema/PublicKeyIdentities.schema.json rename to gen/pb-rust/schemas/PublicKeyIdentities.schema.json diff --git a/gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json b/gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json similarity index 100% rename from gen/pb-rust/schema/RFC3161SignedTimestamp.schema.json rename to gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json diff --git a/gen/pb-rust/schema/Signature.schema.json b/gen/pb-rust/schemas/Signature.schema.json similarity index 100% rename from gen/pb-rust/schema/Signature.schema.json rename to gen/pb-rust/schemas/Signature.schema.json diff --git a/gen/pb-rust/schema/SubjectAlternativeName.schema.json b/gen/pb-rust/schemas/SubjectAlternativeName.schema.json similarity index 100% rename from gen/pb-rust/schema/SubjectAlternativeName.schema.json rename to gen/pb-rust/schemas/SubjectAlternativeName.schema.json diff --git a/gen/pb-rust/schema/TimeRange.schema.json b/gen/pb-rust/schemas/TimeRange.schema.json similarity index 100% rename from gen/pb-rust/schema/TimeRange.schema.json rename to gen/pb-rust/schemas/TimeRange.schema.json diff --git a/gen/pb-rust/schema/TimestampVerificationData.schema.json b/gen/pb-rust/schemas/TimestampVerificationData.schema.json similarity index 100% rename from gen/pb-rust/schema/TimestampVerificationData.schema.json rename to gen/pb-rust/schemas/TimestampVerificationData.schema.json diff --git a/gen/pb-rust/schema/TransparencyLogEntry.schema.json b/gen/pb-rust/schemas/TransparencyLogEntry.schema.json similarity index 100% rename from gen/pb-rust/schema/TransparencyLogEntry.schema.json rename to gen/pb-rust/schemas/TransparencyLogEntry.schema.json diff --git a/gen/pb-rust/schema/TransparencyLogInstance.schema.json b/gen/pb-rust/schemas/TransparencyLogInstance.schema.json similarity index 100% rename from gen/pb-rust/schema/TransparencyLogInstance.schema.json rename to gen/pb-rust/schemas/TransparencyLogInstance.schema.json diff --git a/gen/pb-rust/schema/TrustedRoot.schema.json b/gen/pb-rust/schemas/TrustedRoot.schema.json similarity index 100% rename from gen/pb-rust/schema/TrustedRoot.schema.json rename to gen/pb-rust/schemas/TrustedRoot.schema.json diff --git a/gen/pb-rust/schema/VerificationMaterial.schema.json b/gen/pb-rust/schemas/VerificationMaterial.schema.json similarity index 100% rename from gen/pb-rust/schema/VerificationMaterial.schema.json rename to gen/pb-rust/schemas/VerificationMaterial.schema.json diff --git a/gen/pb-rust/schema/X509Certificate.schema.json b/gen/pb-rust/schemas/X509Certificate.schema.json similarity index 100% rename from gen/pb-rust/schema/X509Certificate.schema.json rename to gen/pb-rust/schemas/X509Certificate.schema.json diff --git a/gen/pb-rust/schema/X509CertificateChain.schema.json b/gen/pb-rust/schemas/X509CertificateChain.schema.json similarity index 100% rename from gen/pb-rust/schema/X509CertificateChain.schema.json rename to gen/pb-rust/schemas/X509CertificateChain.schema.json diff --git a/gen/pb-rust/src/lib.rs b/gen/pb-rust/src/lib.rs index 5f903d21..932d32cb 100644 --- a/gen/pb-rust/src/lib.rs +++ b/gen/pb-rust/src/lib.rs @@ -1,14 +1,25 @@ -use schemafy_core; -use serde; -use serde_json; - +/// NOTE(jleightcap): a method to include all JSON schemas is not immediately obvious to me: +/// +/// - `schemafy!` is a direct 1:1 compilation to Rust structures of each definition in "defintions", +/// - each schema is 'standalone': including definitions of all it's dependencies, +/// as a result, the Rust generated structures have name collisions if included in the same module scope. +/// +/// prefixing works, +/// +/// ```rust +/// mod CertificateIdentity { +/// schemafy::schemafy!("schemas/CertificateIdentity.shema.json") +/// } +/// mod CertificateIdentities { +/// schemafy::schemafy!("schemas/CertificateIdentities.schema.json") +/// } +/// ``` +/// but is clunky to use and manual to generate. +/// +/// a more general approach is to 'flatten' each JSON Schema, +/// unioning all of the "defintions" fields. +/// +/// Since standardized bundles is the singular motiviation for these Rust bindings, +/// for now we're punting this issue. use serde::{Deserialize, Serialize}; - -pub mod sigstore { - pub mod verification { - pub mod v1 { - use super::super::super::*; - schemafy::schemafy!("schema/Artifact.schema.json"); - } - } -} +schemafy::schemafy!("schemas/Bundle.schema.json"); From 66592424fb97cdea908e9c20ed73975befff3076 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Wed, 2 Aug 2023 10:57:13 -0400 Subject: [PATCH 3/7] pb-rust: port prost unit tests adapted from https://github.com/sigstore/protobuf-specs/pull/95/commits/b7d905d991fee2772e5952b6ceb05a7295325d88 Signed-off-by: Jack Leightcap --- gen/pb-rust/tests/unit.rs | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 gen/pb-rust/tests/unit.rs diff --git a/gen/pb-rust/tests/unit.rs b/gen/pb-rust/tests/unit.rs new file mode 100644 index 00000000..6d523f54 --- /dev/null +++ b/gen/pb-rust/tests/unit.rs @@ -0,0 +1,40 @@ +use sigstore_protobuf_specs::{ + DevSigstoreCommonV1HashOutput as HashOutput, + DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, + DevSigstoreCommonV1MessageSignature as MessageSignature, +}; + +/// HashOutput, a structure using only primitive types +#[test] +fn primitives() { + let hash_output = HashOutput { + algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), + }; + + assert_eq!( + hash_output, + serde_json::to_string(&hash_output) + .and_then(|s| serde_json::from_str(&s)) + .unwrap() + ) +} + +/// MessageSignature, nested structure +#[test] +fn nested() { + let message_signature= MessageSignature { + message_digest: Some(HashOutput { + algorithm: Some(HashAlgorithm::Variant0(String::from("SHA_256"))), + digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), + }), + signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g==")) + }; + + assert_eq!( + message_signature, + serde_json::to_string(&message_signature) + .and_then(|s| serde_json::from_str(&s)) + .unwrap() + ) +} From d309c135965a3f68e8f53cb7d49fea6504030de0 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Wed, 2 Aug 2023 15:29:19 -0400 Subject: [PATCH 4/7] pb-rust: bundle deserialize integration Signed-off-by: Jack Leightcap --- gen/pb-rust/Cargo.lock | 23 ++++++++ gen/pb-rust/Cargo.toml | 5 +- gen/pb-rust/tests/bundle.txt.sigstore | 1 + gen/pb-rust/tests/integration.rs | 85 +++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 gen/pb-rust/tests/bundle.txt.sigstore create mode 100644 gen/pb-rust/tests/integration.rs diff --git a/gen/pb-rust/Cargo.lock b/gen/pb-rust/Cargo.lock index 859ba368..12b3f7f4 100644 --- a/gen/pb-rust/Cargo.lock +++ b/gen/pb-rust/Cargo.lock @@ -21,6 +21,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "fnv" version = "1.0.7" @@ -45,6 +51,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "proc-macro2" version = "1.0.66" @@ -187,6 +203,7 @@ dependencies = [ name = "sigstore_protobuf_specs" version = "0.1.0-rc.1" dependencies = [ + "pretty_assertions", "schemafy", "schemafy_core", "serde", @@ -230,3 +247,9 @@ dependencies = [ "fnv", "lazy_static", ] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/gen/pb-rust/Cargo.toml b/gen/pb-rust/Cargo.toml index 01ab073e..61380c88 100644 --- a/gen/pb-rust/Cargo.toml +++ b/gen/pb-rust/Cargo.toml @@ -16,4 +16,7 @@ categories = ["encoding", "parser-implementations"] schemafy = "0.6" schemafy_core = "0.6" serde = "1.0" -serde_json = "1.0" \ No newline at end of file +serde_json = "1.0" + +[dev-dependencies] +pretty_assertions = "1.4.0" \ No newline at end of file diff --git a/gen/pb-rust/tests/bundle.txt.sigstore b/gen/pb-rust/tests/bundle.txt.sigstore new file mode 100644 index 00000000..8c439445 --- /dev/null +++ b/gen/pb-rust/tests/bundle.txt.sigstore @@ -0,0 +1 @@ +{"media_type": "application/vnd.dev.sigstore.bundle+json;version=0.1", "verification_material": {"x509_certificate_chain": {"certificates": [{"raw_bytes": "MIIC5zCCAmygAwIBAgIUJ3vpewdf6e91rgjqCqagstF4qn8wCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjMwNDI2MDAyMTA4WhcNMjMwNDI2MDAzMTA4WjAAMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2sd6+lOBcn5MXtnbwca7zcwpprl7GUZiKTO9IWpAUfVTtx+BXGHQCRwsFy/d7dLlf4hurIqhzMD5yaC2kcU9/8c9G55JyBXF8Dx5SQm9y2rPWFIdm29Ql9A3I3yyEFyPo4IBbjCCAWowDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMB0GA1UdDgQWBBTlaUfjpiXGhBP3hOCW0JJZDSPxgzAfBgNVHSMEGDAWgBRxhjCmFHxib/n31vQFGn9f/+tvrDAYBgNVHREBAf8EDjAMgQphQHRueS50b3duMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDCBigYKKwYBBAHWeQIEAgR8BHoAeAB2ACswvNxoiMni4dgmKV50H0g5MZYC8pwzy15DQP6yrIZ6AAABh7rveBsAAAQDAEcwRQIhAKOZPMN9Q9qO1HXigHBPt+Ic16yy2Zgv2KQ23i5WLj16AiAzrFpuayGXdoK+hYePl9dEeXjG/vB2jK/E3sEsIrXtETAKBggqhkjOPQQDAwNpADBmAjEAgmhg80mI/Scr0isBnD5FYXZ8WxA8tnBBPmdf4aNGForGazGXaFQVPXgBVPv+YGI/AjEA0QzPC5dHD/WWXW2GbEC4dpwFk8OGRkiExMOy/+CqabbVg+/lx1N9VGBTlUTft45d"}]}, "tlog_entries": [{"log_index": "7390977", "log_id": {"key_id": "0y8wo8MtY5wrdiIFohx7sHeI5oKDpK5vQhGHI6G+pJY="}, "kind_version": {"kind": "hashedrekord", "version": "0.0.1"}, "integrated_time": "1682468469", "inclusion_promise": {"signed_entry_timestamp": "MEUCICSJs5PgN4W3Lku3ybrwfNLAKMWaOvffg2tnqm19VrWEAiEA16MVPsWDoaAljsxGefpQazpvYfs1pv8lzdgZQ0I4rH0="}, "inclusion_proof": {"log_index": "7376158", "root_hash": "LE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=", "tree_size": "7376159", "hashes": ["zgesNHwk09VvW4IDaPrJMtX59glNyyLPzeJO1Gw1hCI=", "lJiFr9ZP5FO8BjqLAUQ16A/0/LoOOQ0gfeNhdxaxO2w=", "sMImd51DBHQnH1tz4sGk8gXB+FjWyusVXbP0GmpFnB4=", "cDU1nEpl0WCRlxLi/gNVzykDzobU4qG/7BQZxn0qDgU=", "4CRqWzG3qpxKvlHuZg5O6QjQiwOzerbjwsAh30EVlA8=", "Ru0p3GE/zB2zub2/xR5rY/aM4J+5VJmiIuIl2enF/ws=", "2W+NG5yGR68lrLGcw4gn9CSCfeQF98d3LMfdo8tPyok=", "bEs1eYxy9R6hR2veGEwYW4PEdrZKrdqZ7uDlmmNtlas=", "sgQMnwcK7VxxAi+fygxq8iJ+zWqShjXm07/AWobWcXU=", "y4BESazXFcefRzxpN1PfJHoqRaKnPJPM5H/jotx0QY8=", "xiNEdLOpmGQERCR+DCEFVRK+Ns6G0BLV9M6sQQkRhik="], "checkpoint": {"envelope": "rekor.sigstage.dev - 8050909264565447525\n7376159\nLE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=\nTimestamp: 1682468469199678948\n\n\u2014 rekor.sigstage.dev 0y8wozBEAiBbAodz3dBqJjGMhnZEkbaTDVxc8+tBEPKbaWUZoqxFvwIgGtYzFgFaM3UXBRHmzgmcrCxA145dpQ2YD0yFqiPHO7U=\n"}}, "canonicalized_body": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI4MDJkZDYwZmY4ODMzMzgwMmYyNTg1ZTczMDQzYmQyMWMzNDEyODVlMTk5MmZlNWIzMTc1NWUxY2FkZWFlMzBlIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1HVUNNUUNPT0pxVFk2WFdnQjY0aXpLMldWUDA3YjBTRzlNNVdQQ3dLaGZUUHdNdnRzZ1VpOEtlUkd3UWt2dkxZYktIZHFVQ01FYk9YRkcwTk1xRVF4V1ZiNnJtR25leGRBRHVHZjZKbDhxQUM4dG42N3AzUWZWb1h6TXZGQTYxUHp4d1Z3dmI4Zz09IiwicHVibGljS2V5Ijp7ImNvbnRlbnQiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VNMWVrTkRRVzE1WjBGM1NVSkJaMGxWU2pOMmNHVjNaR1kyWlRreGNtZHFjVU54WVdkemRFWTBjVzQ0ZDBObldVbExiMXBKZW1vd1JVRjNUWGNLVG5wRlZrMUNUVWRCTVZWRlEyaE5UV015Ykc1ak0xSjJZMjFWZFZwSFZqSk5ValIzU0VGWlJGWlJVVVJGZUZaNllWZGtlbVJIT1hsYVV6RndZbTVTYkFwamJURnNXa2RzYUdSSFZYZElhR05PVFdwTmQwNUVTVEpOUkVGNVRWUkJORmRvWTA1TmFrMTNUa1JKTWsxRVFYcE5WRUUwVjJwQlFVMUlXWGRGUVZsSUNrdHZXa2w2YWpCRFFWRlpSa3MwUlVWQlEwbEVXV2RCUlRKelpEWXJiRTlDWTI0MVRWaDBibUozWTJFM2VtTjNjSEJ5YkRkSFZWcHBTMVJQT1VsWGNFRUtWV1pXVkhSNEswSllSMGhSUTFKM2MwWjVMMlEzWkV4c1pqUm9kWEpKY1doNlRVUTFlV0ZETW10alZUa3ZPR001UnpVMVNubENXRVk0UkhnMVUxRnRPUXA1TW5KUVYwWkpaRzB5T1ZGc09VRXpTVE41ZVVWR2VWQnZORWxDWW1wRFEwRlhiM2RFWjFsRVZsSXdVRUZSU0M5Q1FWRkVRV2RsUVUxQ1RVZEJNVlZrQ2twUlVVMU5RVzlIUTBOelIwRlJWVVpDZDAxRVRVSXdSMEV4VldSRVoxRlhRa0pVYkdGVlptcHdhVmhIYUVKUU0yaFBRMWN3U2twYVJGTlFlR2Q2UVdZS1FtZE9Wa2hUVFVWSFJFRlhaMEpTZUdocVEyMUdTSGhwWWk5dU16RjJVVVpIYmpsbUx5dDBkbkpFUVZsQ1owNVdTRkpGUWtGbU9FVkVha0ZOWjFGd2FBcFJTRkoxWlZNMU1HSXpaSFZOUTNkSFEybHpSMEZSVVVKbk56aDNRVkZGUlVodGFEQmtTRUo2VDJrNGRsb3liREJoU0ZacFRHMU9kbUpUT1hOaU1tUndDbUpwT1haWldGWXdZVVJCZFVKbmIzSkNaMFZGUVZsUEwwMUJSVWxDUTBGTlNHMW9NR1JJUW5wUGFUaDJXakpzTUdGSVZtbE1iVTUyWWxNNWMySXlaSEFLWW1rNWRsbFlWakJoUkVOQ2FXZFpTMHQzV1VKQ1FVaFhaVkZKUlVGblVqaENTRzlCWlVGQ01rRkRjM2QyVG5odmFVMXVhVFJrWjIxTFZqVXdTREJuTlFwTldsbERPSEIzZW5reE5VUlJVRFo1Y2tsYU5rRkJRVUpvTjNKMlpVSnpRVUZCVVVSQlJXTjNVbEZKYUVGTFQxcFFUVTQ1VVRseFR6RklXR2xuU0VKUUNuUXJTV014Tm5sNU1scG5kakpMVVRJemFUVlhUR294TmtGcFFYcHlSbkIxWVhsSFdHUnZTeXRvV1dWUWJEbGtSV1ZZYWtjdmRrSXlha3N2UlROelJYTUtTWEpZZEVWVVFVdENaMmR4YUd0cVQxQlJVVVJCZDA1d1FVUkNiVUZxUlVGbmJXaG5PREJ0U1M5VFkzSXdhWE5DYmtRMVJsbFlXamhYZUVFNGRHNUNRZ3BRYldSbU5HRk9SMFp2Y2tkaGVrZFlZVVpSVmxCWVowSldVSFlyV1VkSkwwRnFSVUV3VVhwUVF6VmtTRVF2VjFkWVZ6SkhZa1ZETkdSd2QwWnJPRTlIQ2xKcmFVVjRUVTk1THl0RGNXRmlZbFpuS3k5c2VERk9PVlpIUWxSc1ZWUm1kRFExWkFvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSJ9fX19"}]}, "message_signature": {"message_digest": {"algorithm": "SHA2_256", "digest": "gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4="}, "signature": "MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="}} diff --git a/gen/pb-rust/tests/integration.rs b/gen/pb-rust/tests/integration.rs new file mode 100644 index 00000000..48271bb7 --- /dev/null +++ b/gen/pb-rust/tests/integration.rs @@ -0,0 +1,85 @@ +use pretty_assertions::{assert_eq, assert_ne}; +use serde_json; +use sigstore_protobuf_specs::{ + Bundle, DevSigstoreBundleV1VerificationMaterial as VerificationMaterial, + DevSigstoreCommonV1HashOutput as HashOutput, + DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1LogId as LogId, + DevSigstoreCommonV1MessageSignature as MessageSignature, + DevSigstoreCommonV1X509Certificate as X509Certificate, + DevSigstoreCommonV1X509CertificateChain as X509CertificateChain, + DevSigstoreRekorV1Checkpoint as Checkpoint, + DevSigstoreRekorV1InclusionPromise as InclusionPromise, + DevSigstoreRekorV1InclusionProof as InclusionProof, + DevSigstoreRekorV1KindVersion as KindVersion, + DevSigstoreRekorV1TransparencyLogEntry as TransparencyLogEntry, +}; + +#[test] +fn bundle() { + let bundle_json = std::fs::read_to_string("tests/bundle.txt.sigstore").unwrap(); + let bundle = serde_json::from_str::(&bundle_json); + + assert!(bundle.is_ok()); + assert_eq!( + bundle.unwrap(), + Bundle { + media_type: Some(String::from("application/vnd.dev.sigstore.bundle+json;version=0.1")), + verification_material: Some(VerificationMaterial{ + public_key: None, + x_509_certificate_chain: Some(X509CertificateChain{ + certificates: Some(vec![ + X509Certificate{ + raw_bytes: Some(String::from("MIIC5zCCAmygAwIBAgIUJ3vpewdf6e91rgjqCqagstF4qn8wCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjMwNDI2MDAyMTA4WhcNMjMwNDI2MDAzMTA4WjAAMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2sd6+lOBcn5MXtnbwca7zcwpprl7GUZiKTO9IWpAUfVTtx+BXGHQCRwsFy/d7dLlf4hurIqhzMD5yaC2kcU9/8c9G55JyBXF8Dx5SQm9y2rPWFIdm29Ql9A3I3yyEFyPo4IBbjCCAWowDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMB0GA1UdDgQWBBTlaUfjpiXGhBP3hOCW0JJZDSPxgzAfBgNVHSMEGDAWgBRxhjCmFHxib/n31vQFGn9f/+tvrDAYBgNVHREBAf8EDjAMgQphQHRueS50b3duMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDCBigYKKwYBBAHWeQIEAgR8BHoAeAB2ACswvNxoiMni4dgmKV50H0g5MZYC8pwzy15DQP6yrIZ6AAABh7rveBsAAAQDAEcwRQIhAKOZPMN9Q9qO1HXigHBPt+Ic16yy2Zgv2KQ23i5WLj16AiAzrFpuayGXdoK+hYePl9dEeXjG/vB2jK/E3sEsIrXtETAKBggqhkjOPQQDAwNpADBmAjEAgmhg80mI/Scr0isBnD5FYXZ8WxA8tnBBPmdf4aNGForGazGXaFQVPXgBVPv+YGI/AjEA0QzPC5dHD/WWXW2GbEC4dpwFk8OGRkiExMOy/+CqabbVg+/lx1N9VGBTlUTft45d")) + } + ]), + }), + tlog_entries: Some(vec![ + TransparencyLogEntry{ + log_index: Some(String::from("7390977")), + log_id: Some(LogId{ + key_id: Some(String::from("0y8wo8MtY5wrdiIFohx7sHeI5oKDpK5vQhGHI6G+pJY=")) + }), + kind_version: Some(KindVersion{ + kind: Some(String::from("hashedrekord")), + version: Some(String::from("0.0.1")) + }), + integrated_time: Some(String::from("1682468469")), + inclusion_promise: Some(InclusionPromise{ + signed_entry_timestamp: Some(String::from("MEUCICSJs5PgN4W3Lku3ybrwfNLAKMWaOvffg2tnqm19VrWEAiEA16MVPsWDoaAljsxGefpQazpvYfs1pv8lzdgZQ0I4rH0=")) + }), + inclusion_proof: Some(InclusionProof{ + log_index: Some(String::from("7376158")), + root_hash: Some(String::from("LE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=")), + tree_size: Some(String::from("7376159")), + hashes: Some(vec![ + String::from("zgesNHwk09VvW4IDaPrJMtX59glNyyLPzeJO1Gw1hCI="), + String::from("lJiFr9ZP5FO8BjqLAUQ16A/0/LoOOQ0gfeNhdxaxO2w="), + String::from("sMImd51DBHQnH1tz4sGk8gXB+FjWyusVXbP0GmpFnB4="), + String::from("cDU1nEpl0WCRlxLi/gNVzykDzobU4qG/7BQZxn0qDgU="), + String::from("4CRqWzG3qpxKvlHuZg5O6QjQiwOzerbjwsAh30EVlA8="), + String::from("Ru0p3GE/zB2zub2/xR5rY/aM4J+5VJmiIuIl2enF/ws="), + String::from("2W+NG5yGR68lrLGcw4gn9CSCfeQF98d3LMfdo8tPyok="), + String::from("bEs1eYxy9R6hR2veGEwYW4PEdrZKrdqZ7uDlmmNtlas="), + String::from("sgQMnwcK7VxxAi+fygxq8iJ+zWqShjXm07/AWobWcXU="), + String::from("y4BESazXFcefRzxpN1PfJHoqRaKnPJPM5H/jotx0QY8="), + String::from("xiNEdLOpmGQERCR+DCEFVRK+Ns6G0BLV9M6sQQkRhik=") + ]), + checkpoint: Some(Checkpoint{ + envelope: Some(String::from("rekor.sigstage.dev - 8050909264565447525\n7376159\nLE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=\nTimestamp: 1682468469199678948\n\n\u{2014} rekor.sigstage.dev 0y8wozBEAiBbAodz3dBqJjGMhnZEkbaTDVxc8+tBEPKbaWUZoqxFvwIgGtYzFgFaM3UXBRHmzgmcrCxA145dpQ2YD0yFqiPHO7U=\n")) + }), + }), + canonicalized_body: Some(String::from("eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI4MDJkZDYwZmY4ODMzMzgwMmYyNTg1ZTczMDQzYmQyMWMzNDEyODVlMTk5MmZlNWIzMTc1NWUxY2FkZWFlMzBlIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1HVUNNUUNPT0pxVFk2WFdnQjY0aXpLMldWUDA3YjBTRzlNNVdQQ3dLaGZUUHdNdnRzZ1VpOEtlUkd3UWt2dkxZYktIZHFVQ01FYk9YRkcwTk1xRVF4V1ZiNnJtR25leGRBRHVHZjZKbDhxQUM4dG42N3AzUWZWb1h6TXZGQTYxUHp4d1Z3dmI4Zz09IiwicHVibGljS2V5Ijp7ImNvbnRlbnQiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VNMWVrTkRRVzE1WjBGM1NVSkJaMGxWU2pOMmNHVjNaR1kyWlRreGNtZHFjVU54WVdkemRFWTBjVzQ0ZDBObldVbExiMXBKZW1vd1JVRjNUWGNLVG5wRlZrMUNUVWRCTVZWRlEyaE5UV015Ykc1ak0xSjJZMjFWZFZwSFZqSk5ValIzU0VGWlJGWlJVVVJGZUZaNllWZGtlbVJIT1hsYVV6RndZbTVTYkFwamJURnNXa2RzYUdSSFZYZElhR05PVFdwTmQwNUVTVEpOUkVGNVRWUkJORmRvWTA1TmFrMTNUa1JKTWsxRVFYcE5WRUUwVjJwQlFVMUlXWGRGUVZsSUNrdHZXa2w2YWpCRFFWRlpSa3MwUlVWQlEwbEVXV2RCUlRKelpEWXJiRTlDWTI0MVRWaDBibUozWTJFM2VtTjNjSEJ5YkRkSFZWcHBTMVJQT1VsWGNFRUtWV1pXVkhSNEswSllSMGhSUTFKM2MwWjVMMlEzWkV4c1pqUm9kWEpKY1doNlRVUTFlV0ZETW10alZUa3ZPR001UnpVMVNubENXRVk0UkhnMVUxRnRPUXA1TW5KUVYwWkpaRzB5T1ZGc09VRXpTVE41ZVVWR2VWQnZORWxDWW1wRFEwRlhiM2RFWjFsRVZsSXdVRUZSU0M5Q1FWRkVRV2RsUVUxQ1RVZEJNVlZrQ2twUlVVMU5RVzlIUTBOelIwRlJWVVpDZDAxRVRVSXdSMEV4VldSRVoxRlhRa0pVYkdGVlptcHdhVmhIYUVKUU0yaFBRMWN3U2twYVJGTlFlR2Q2UVdZS1FtZE9Wa2hUVFVWSFJFRlhaMEpTZUdocVEyMUdTSGhwWWk5dU16RjJVVVpIYmpsbUx5dDBkbkpFUVZsQ1owNVdTRkpGUWtGbU9FVkVha0ZOWjFGd2FBcFJTRkoxWlZNMU1HSXpaSFZOUTNkSFEybHpSMEZSVVVKbk56aDNRVkZGUlVodGFEQmtTRUo2VDJrNGRsb3liREJoU0ZacFRHMU9kbUpUT1hOaU1tUndDbUpwT1haWldGWXdZVVJCZFVKbmIzSkNaMFZGUVZsUEwwMUJSVWxDUTBGTlNHMW9NR1JJUW5wUGFUaDJXakpzTUdGSVZtbE1iVTUyWWxNNWMySXlaSEFLWW1rNWRsbFlWakJoUkVOQ2FXZFpTMHQzV1VKQ1FVaFhaVkZKUlVGblVqaENTRzlCWlVGQ01rRkRjM2QyVG5odmFVMXVhVFJrWjIxTFZqVXdTREJuTlFwTldsbERPSEIzZW5reE5VUlJVRFo1Y2tsYU5rRkJRVUpvTjNKMlpVSnpRVUZCVVVSQlJXTjNVbEZKYUVGTFQxcFFUVTQ1VVRseFR6RklXR2xuU0VKUUNuUXJTV014Tm5sNU1scG5kakpMVVRJemFUVlhUR294TmtGcFFYcHlSbkIxWVhsSFdHUnZTeXRvV1dWUWJEbGtSV1ZZYWtjdmRrSXlha3N2UlROelJYTUtTWEpZZEVWVVFVdENaMmR4YUd0cVQxQlJVVVJCZDA1d1FVUkNiVUZxUlVGbmJXaG5PREJ0U1M5VFkzSXdhWE5DYmtRMVJsbFlXamhYZUVFNGRHNUNRZ3BRYldSbU5HRk9SMFp2Y2tkaGVrZFlZVVpSVmxCWVowSldVSFlyV1VkSkwwRnFSVUV3VVhwUVF6VmtTRVF2VjFkWVZ6SkhZa1ZETkdSd2QwWnJPRTlIQ2xKcmFVVjRUVTk1THl0RGNXRmlZbFpuS3k5c2VERk9PVlpIUWxSc1ZWUm1kRFExWkFvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSJ9fX19")) + } + ]), + timestamp_verification_data: None, + }), + message_signature: Some(MessageSignature { + message_digest: Some(HashOutput{ + algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")) + }), + signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g==")) + }), + dsse_envelope: None + }); +} From 31c3ad9b630eb11c9d509f07a505211440bfaa0a Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Wed, 2 Aug 2023 18:11:09 -0400 Subject: [PATCH 5/7] pb-rust: use camelCase consistently in schema/artifacts Signed-off-by: Jack Leightcap --- gen/pb-rust/schemas/Artifact.schema.json | 2 +- .../ArtifactVerificationOptions.schema.json | 22 ++--- gen/pb-rust/schemas/Bundle.schema.json | 48 +++++----- .../schemas/CertificateAuthority.schema.json | 8 +- gen/pb-rust/schemas/CloudEvent.schema.json | 24 ++--- .../schemas/CloudEventBatch.schema.json | 24 ++--- .../schemas/DistinguishedName.schema.json | 2 +- .../schemas/InclusionPromise.schema.json | 2 +- .../schemas/InclusionProof.schema.json | 6 +- gen/pb-rust/schemas/Input.schema.json | 96 +++++++++---------- gen/pb-rust/schemas/LogId.schema.json | 2 +- .../schemas/MessageSignature.schema.json | 2 +- gen/pb-rust/schemas/PublicKey.schema.json | 6 +- .../schemas/PublicKeyIdentities.schema.json | 8 +- .../RFC3161SignedTimestamp.schema.json | 2 +- .../TimestampVerificationData.schema.json | 4 +- .../schemas/TransparencyLogEntry.schema.json | 24 ++--- .../TransparencyLogInstance.schema.json | 16 ++-- gen/pb-rust/schemas/TrustedRoot.schema.json | 30 +++--- .../schemas/VerificationMaterial.schema.json | 38 ++++---- .../schemas/X509Certificate.schema.json | 2 +- .../schemas/X509CertificateChain.schema.json | 2 +- gen/pb-rust/tests/bundle.txt.sigstore | 2 +- 23 files changed, 186 insertions(+), 186 deletions(-) diff --git a/gen/pb-rust/schemas/Artifact.schema.json b/gen/pb-rust/schemas/Artifact.schema.json index 23f6cbab..1ed0ed69 100644 --- a/gen/pb-rust/schemas/Artifact.schema.json +++ b/gen/pb-rust/schemas/Artifact.schema.json @@ -4,7 +4,7 @@ "definitions": { "Artifact": { "properties": { - "artifact_uri": { + "artifactUri": { "type": "string", "description": "Location of the artifact" }, diff --git a/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json b/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json index 46dc0ba1..5618f366 100644 --- a/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json +++ b/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json @@ -4,26 +4,26 @@ "definitions": { "ArtifactVerificationOptions": { "properties": { - "certificate_identities": { + "certificateIdentities": { "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentities", "additionalProperties": false }, - "public_keys": { + "publicKeys": { "$ref": "#/definitions/dev.sigstore.verification.v1.PublicKeyIdentities", "additionalProperties": false, "description": "To simplify verification implementation, the logic for bundle verification should be implemented as a higher-order function, where one of argument should be an interface over the set of trusted public keys, like this: `Verify(bytes artifact, bytes signature, string key_id)`. This way the caller is in full control of mapping the identified (or hinted) key in the bundle to one of the trusted keys, as this process is inherently application specific." }, - "tlog_options": { + "tlogOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions", "additionalProperties": false, "description": "Optional options for artifact transparency log verification. If none is provided, the default verification options are: Threshold: 1 Online verification: false Disable: false" }, - "ctlog_options": { + "ctlogOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions", "additionalProperties": false, "description": "Optional options for certificate transparency log verification. If none is provided, the default verification options are: Threshold: 1 Detached SCT: false Disable: false" }, - "tsa_options": { + "tsaOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions", "additionalProperties": false, "description": "Optional options for certificate signed timestamp verification. If none is provided, the default verification options are: Threshold: 1 Disable: false" @@ -94,13 +94,13 @@ }, "dev.sigstore.common.v1.PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -130,7 +130,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." @@ -229,7 +229,7 @@ "type": "integer", "description": "The number of ct transparency logs the certificate must appear on." }, - "detached_sct": { + "detachedSct": { "type": "boolean", "description": "Expect detached SCTs. This is not supported right now as we can't capture an detached SCT in the bundle." }, @@ -263,7 +263,7 @@ "type": "integer", "description": "Number of transparency logs the entry must appear on." }, - "perform_online_verification": { + "performOnlineVerification": { "type": "boolean", "description": "Perform an online inclusion proof." }, @@ -316,7 +316,7 @@ }, "dev.sigstore.verification.v1.PublicKeyIdentities": { "properties": { - "public_keys": { + "publicKeys": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" }, diff --git a/gen/pb-rust/schemas/Bundle.schema.json b/gen/pb-rust/schemas/Bundle.schema.json index ce779b80..ac66af1c 100644 --- a/gen/pb-rust/schemas/Bundle.schema.json +++ b/gen/pb-rust/schemas/Bundle.schema.json @@ -4,20 +4,20 @@ "definitions": { "Bundle": { "properties": { - "media_type": { + "mediaType": { "type": "string", "description": "MUST be application/vnd.dev.sigstore.bundle+json;version=0.1 or application/vnd.dev.sigstore.bundle+json;version=0.2 when encoded as JSON." }, - "verification_material": { + "verificationMaterial": { "$ref": "#/definitions/dev.sigstore.bundle.v1.VerificationMaterial", "additionalProperties": false, "description": "When a signer is identified by a X.509 certificate, a verifier MUST verify that the signature was computed at the time the certificate was valid as described in the Sigstore client spec: \"Verification using a Bundle\". \u003chttps://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln\u003e" }, - "message_signature": { + "messageSignature": { "$ref": "#/definitions/dev.sigstore.common.v1.MessageSignature", "additionalProperties": false }, - "dsse_envelope": { + "dsseEnvelope": { "$ref": "#/definitions/io.intoto.Envelope", "additionalProperties": false, "description": "A DSSE envelope can contain arbitrary payloads. Verifiers must verify that the payload type is a supported and expected type. This is part of the DSSE protocol which is defined here: \u003chttps://github.com/secure-systems-lab/dsse/blob/master/protocol.md\u003e" @@ -41,7 +41,7 @@ }, "dev.sigstore.bundle.v1.TimestampVerificationData": { "properties": { - "rfc3161_timestamps": { + "rfc3161Timestamps": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" }, @@ -57,15 +57,15 @@ }, "dev.sigstore.bundle.v1.VerificationMaterial": { "properties": { - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", "additionalProperties": false }, - "x509_certificate_chain": { + "x509CertificateChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false }, - "tlog_entries": { + "tlogEntries": { "items": { "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" }, @@ -73,7 +73,7 @@ "type": "array", "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." }, - "timestamp_verification_data": { + "timestampVerificationData": { "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", "additionalProperties": false, "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." @@ -130,7 +130,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -144,7 +144,7 @@ }, "dev.sigstore.common.v1.MessageSignature": { "properties": { - "message_digest": { + "messageDigest": { "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", "additionalProperties": false, "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." @@ -175,7 +175,7 @@ }, "dev.sigstore.common.v1.RFC3161SignedTimestamp": { "properties": { - "signed_timestamp": { + "signedTimestamp": { "type": "string", "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", "format": "binary", @@ -189,7 +189,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", @@ -229,7 +229,7 @@ }, "dev.sigstore.rekor.v1.InclusionPromise": { "properties": { - "signed_entry_timestamp": { + "signedEntryTimestamp": { "type": "string", "format": "binary", "binaryEncoding": "base64" @@ -242,17 +242,17 @@ }, "dev.sigstore.rekor.v1.InclusionProof": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The index of the entry in the tree it was written to." }, - "root_hash": { + "rootHash": { "type": "string", "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", "format": "binary", "binaryEncoding": "base64" }, - "tree_size": { + "treeSize": { "type": "string", "description": "The size of the merkle tree at the time the proof was generated." }, @@ -294,35 +294,35 @@ }, "dev.sigstore.rekor.v1.TransparencyLogEntry": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The global index of the entry, used when querying the log by index." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier of the log." }, - "kind_version": { + "kindVersion": { "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", "additionalProperties": false, "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." }, - "integrated_time": { + "integratedTime": { "type": "string", "description": "The UNIX timestamp from the log when the entry was persisted." }, - "inclusion_promise": { + "inclusionPromise": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", "additionalProperties": false, "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." }, - "inclusion_proof": { + "inclusionProof": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", "additionalProperties": false, "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." }, - "canonicalized_body": { + "canonicalizedBody": { "type": "string", "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", "format": "binary", diff --git a/gen/pb-rust/schemas/CertificateAuthority.schema.json b/gen/pb-rust/schemas/CertificateAuthority.schema.json index 4c6fece0..b9af9a0e 100644 --- a/gen/pb-rust/schemas/CertificateAuthority.schema.json +++ b/gen/pb-rust/schemas/CertificateAuthority.schema.json @@ -13,12 +13,12 @@ "type": "string", "description": "The URI at which the CA can be accessed." }, - "cert_chain": { + "certChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false, "description": "The certificate chain for this CA." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." @@ -34,7 +34,7 @@ "organization": { "type": "string" }, - "common_name": { + "commonName": { "type": "string" } }, @@ -67,7 +67,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", diff --git a/gen/pb-rust/schemas/CloudEvent.schema.json b/gen/pb-rust/schemas/CloudEvent.schema.json index 85bd429c..4076a9e4 100644 --- a/gen/pb-rust/schemas/CloudEvent.schema.json +++ b/gen/pb-rust/schemas/CloudEvent.schema.json @@ -13,7 +13,7 @@ "type": "string", "description": "URI-reference" }, - "spec_version": { + "specVersion": { "type": "string" }, "type": { @@ -27,17 +27,17 @@ "type": "object", "description": "Optional \u0026 Extension Attributes" }, - "binary_data": { + "binaryData": { "type": "string", "format": "binary", "binaryEncoding": "base64" }, - "text_data": { + "textData": { "type": "string" }, - "proto_data": { + "protoData": { "properties": { - "type_url": { + "typeUrl": { "type": "string", "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." }, @@ -75,27 +75,27 @@ }, "dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue": { "properties": { - "ce_boolean": { + "ceBoolean": { "type": "boolean" }, - "ce_integer": { + "ceInteger": { "type": "integer" }, - "ce_string": { + "ceString": { "type": "string" }, - "ce_bytes": { + "ceBytes": { "type": "string", "format": "binary", "binaryEncoding": "base64" }, - "ce_uri": { + "ceUri": { "type": "string" }, - "ce_uri_ref": { + "ceUriRef": { "type": "string" }, - "ce_timestamp": { + "ceTimestamp": { "type": "string", "format": "date-time" } diff --git a/gen/pb-rust/schemas/CloudEventBatch.schema.json b/gen/pb-rust/schemas/CloudEventBatch.schema.json index d2dfb2ef..b14c8952 100644 --- a/gen/pb-rust/schemas/CloudEventBatch.schema.json +++ b/gen/pb-rust/schemas/CloudEventBatch.schema.json @@ -28,7 +28,7 @@ "type": "string", "description": "URI-reference" }, - "spec_version": { + "specVersion": { "type": "string" }, "type": { @@ -42,17 +42,17 @@ "type": "object", "description": "Optional \u0026 Extension Attributes" }, - "binary_data": { + "binaryData": { "type": "string", "format": "binary", "binaryEncoding": "base64" }, - "text_data": { + "textData": { "type": "string" }, - "proto_data": { + "protoData": { "properties": { - "type_url": { + "typeUrl": { "type": "string", "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics." }, @@ -90,27 +90,27 @@ }, "dev.sigstore.events.v1.CloudEvent.CloudEventAttributeValue": { "properties": { - "ce_boolean": { + "ceBoolean": { "type": "boolean" }, - "ce_integer": { + "ceInteger": { "type": "integer" }, - "ce_string": { + "ceString": { "type": "string" }, - "ce_bytes": { + "ceBytes": { "type": "string", "format": "binary", "binaryEncoding": "base64" }, - "ce_uri": { + "ceUri": { "type": "string" }, - "ce_uri_ref": { + "ceUriRef": { "type": "string" }, - "ce_timestamp": { + "ceTimestamp": { "type": "string", "format": "date-time" } diff --git a/gen/pb-rust/schemas/DistinguishedName.schema.json b/gen/pb-rust/schemas/DistinguishedName.schema.json index 7bf473bc..ee6bf51c 100644 --- a/gen/pb-rust/schemas/DistinguishedName.schema.json +++ b/gen/pb-rust/schemas/DistinguishedName.schema.json @@ -7,7 +7,7 @@ "organization": { "type": "string" }, - "common_name": { + "commonName": { "type": "string" } }, diff --git a/gen/pb-rust/schemas/InclusionPromise.schema.json b/gen/pb-rust/schemas/InclusionPromise.schema.json index ea457e5a..1142d619 100644 --- a/gen/pb-rust/schemas/InclusionPromise.schema.json +++ b/gen/pb-rust/schemas/InclusionPromise.schema.json @@ -4,7 +4,7 @@ "definitions": { "InclusionPromise": { "properties": { - "signed_entry_timestamp": { + "signedEntryTimestamp": { "type": "string", "format": "binary", "binaryEncoding": "base64" diff --git a/gen/pb-rust/schemas/InclusionProof.schema.json b/gen/pb-rust/schemas/InclusionProof.schema.json index ae9617a1..ff26b70b 100644 --- a/gen/pb-rust/schemas/InclusionProof.schema.json +++ b/gen/pb-rust/schemas/InclusionProof.schema.json @@ -4,17 +4,17 @@ "definitions": { "InclusionProof": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The index of the entry in the tree it was written to." }, - "root_hash": { + "rootHash": { "type": "string", "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", "format": "binary", "binaryEncoding": "base64" }, - "tree_size": { + "treeSize": { "type": "string", "description": "The size of the merkle tree at the time the proof was generated." }, diff --git a/gen/pb-rust/schemas/Input.schema.json b/gen/pb-rust/schemas/Input.schema.json index c2667286..e23bb548 100644 --- a/gen/pb-rust/schemas/Input.schema.json +++ b/gen/pb-rust/schemas/Input.schema.json @@ -4,12 +4,12 @@ "definitions": { "Input": { "properties": { - "artifact_trust_root": { + "artifactTrustRoot": { "$ref": "#/definitions/dev.sigstore.trustroot.v1.TrustedRoot", "additionalProperties": false, "description": "The verification materials provided during a bundle verification. The running process is usually preloaded with a \"global\" dev.sisgtore.trustroot.TrustedRoot.v1 instance. Prior to verifying an artifact (i.e a bundle), and/or based on current policy, some selection is expected to happen, to filter out the exact certificate authority to use, which transparency logs are relevant etc. The result should b ecaptured in the `artifact_trust_root`." }, - "artifact_verification_options": { + "artifactVerificationOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions", "additionalProperties": false }, @@ -37,20 +37,20 @@ }, "dev.sigstore.bundle.v1.Bundle": { "properties": { - "media_type": { + "mediaType": { "type": "string", "description": "MUST be application/vnd.dev.sigstore.bundle+json;version=0.1 or application/vnd.dev.sigstore.bundle+json;version=0.2 when encoded as JSON." }, - "verification_material": { + "verificationMaterial": { "$ref": "#/definitions/dev.sigstore.bundle.v1.VerificationMaterial", "additionalProperties": false, "description": "When a signer is identified by a X.509 certificate, a verifier MUST verify that the signature was computed at the time the certificate was valid as described in the Sigstore client spec: \"Verification using a Bundle\". \u003chttps://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln\u003e" }, - "message_signature": { + "messageSignature": { "$ref": "#/definitions/dev.sigstore.common.v1.MessageSignature", "additionalProperties": false }, - "dsse_envelope": { + "dsseEnvelope": { "$ref": "#/definitions/io.intoto.Envelope", "additionalProperties": false, "description": "A DSSE envelope can contain arbitrary payloads. Verifiers must verify that the payload type is a supported and expected type. This is part of the DSSE protocol which is defined here: \u003chttps://github.com/secure-systems-lab/dsse/blob/master/protocol.md\u003e" @@ -74,7 +74,7 @@ }, "dev.sigstore.bundle.v1.TimestampVerificationData": { "properties": { - "rfc3161_timestamps": { + "rfc3161Timestamps": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" }, @@ -90,15 +90,15 @@ }, "dev.sigstore.bundle.v1.VerificationMaterial": { "properties": { - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", "additionalProperties": false }, - "x509_certificate_chain": { + "x509CertificateChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false }, - "tlog_entries": { + "tlogEntries": { "items": { "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" }, @@ -106,7 +106,7 @@ "type": "array", "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." }, - "timestamp_verification_data": { + "timestampVerificationData": { "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", "additionalProperties": false, "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." @@ -134,7 +134,7 @@ "organization": { "type": "string" }, - "common_name": { + "commonName": { "type": "string" } }, @@ -176,7 +176,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -190,7 +190,7 @@ }, "dev.sigstore.common.v1.MessageSignature": { "properties": { - "message_digest": { + "messageDigest": { "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", "additionalProperties": false, "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." @@ -240,13 +240,13 @@ }, "dev.sigstore.common.v1.PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -276,7 +276,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." @@ -312,7 +312,7 @@ }, "dev.sigstore.common.v1.RFC3161SignedTimestamp": { "properties": { - "signed_timestamp": { + "signedTimestamp": { "type": "string", "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", "format": "binary", @@ -397,7 +397,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", @@ -437,7 +437,7 @@ }, "dev.sigstore.rekor.v1.InclusionPromise": { "properties": { - "signed_entry_timestamp": { + "signedEntryTimestamp": { "type": "string", "format": "binary", "binaryEncoding": "base64" @@ -450,17 +450,17 @@ }, "dev.sigstore.rekor.v1.InclusionProof": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The index of the entry in the tree it was written to." }, - "root_hash": { + "rootHash": { "type": "string", "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", "format": "binary", "binaryEncoding": "base64" }, - "tree_size": { + "treeSize": { "type": "string", "description": "The size of the merkle tree at the time the proof was generated." }, @@ -502,35 +502,35 @@ }, "dev.sigstore.rekor.v1.TransparencyLogEntry": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The global index of the entry, used when querying the log by index." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier of the log." }, - "kind_version": { + "kindVersion": { "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", "additionalProperties": false, "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." }, - "integrated_time": { + "integratedTime": { "type": "string", "description": "The UNIX timestamp from the log when the entry was persisted." }, - "inclusion_promise": { + "inclusionPromise": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", "additionalProperties": false, "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." }, - "inclusion_proof": { + "inclusionProof": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", "additionalProperties": false, "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." }, - "canonicalized_body": { + "canonicalizedBody": { "type": "string", "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", "format": "binary", @@ -553,12 +553,12 @@ "type": "string", "description": "The URI at which the CA can be accessed." }, - "cert_chain": { + "certChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false, "description": "The certificate chain for this CA." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." @@ -571,11 +571,11 @@ }, "dev.sigstore.trustroot.v1.TransparencyLogInstance": { "properties": { - "base_url": { + "baseUrl": { "type": "string", "description": "The base URL at which can be used to URLs for the client." }, - "hash_algorithm": { + "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", 0, @@ -593,12 +593,12 @@ "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", "additionalProperties": false, "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier for this transparency log." @@ -611,7 +611,7 @@ }, "dev.sigstore.trustroot.v1.TrustedRoot": { "properties": { - "media_type": { + "mediaType": { "type": "string", "description": "MUST be application/vnd.dev.sigstore.trustedroot+json;version=0.1" }, @@ -623,7 +623,7 @@ "type": "array", "description": "A set of trusted Rekor servers." }, - "certificate_authorities": { + "certificateAuthorities": { "items": { "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" }, @@ -639,7 +639,7 @@ "type": "array", "description": "A set of trusted certificate transparency logs." }, - "timestamp_authorities": { + "timestampAuthorities": { "items": { "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" }, @@ -655,7 +655,7 @@ }, "dev.sigstore.verification.v1.Artifact": { "properties": { - "artifact_uri": { + "artifactUri": { "type": "string", "description": "Location of the artifact" }, @@ -684,26 +684,26 @@ }, "dev.sigstore.verification.v1.ArtifactVerificationOptions": { "properties": { - "certificate_identities": { + "certificateIdentities": { "$ref": "#/definitions/dev.sigstore.verification.v1.CertificateIdentities", "additionalProperties": false }, - "public_keys": { + "publicKeys": { "$ref": "#/definitions/dev.sigstore.verification.v1.PublicKeyIdentities", "additionalProperties": false, "description": "To simplify verification implementation, the logic for bundle verification should be implemented as a higher-order function, where one of argument should be an interface over the set of trusted public keys, like this: `Verify(bytes artifact, bytes signature, string key_id)`. This way the caller is in full control of mapping the identified (or hinted) key in the bundle to one of the trusted keys, as this process is inherently application specific." }, - "tlog_options": { + "tlogOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions", "additionalProperties": false, "description": "Optional options for artifact transparency log verification. If none is provided, the default verification options are: Threshold: 1 Online verification: false Disable: false" }, - "ctlog_options": { + "ctlogOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions", "additionalProperties": false, "description": "Optional options for certificate transparency log verification. If none is provided, the default verification options are: Threshold: 1 Detached SCT: false Disable: false" }, - "tsa_options": { + "tsaOptions": { "$ref": "#/definitions/dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions", "additionalProperties": false, "description": "Optional options for certificate signed timestamp verification. If none is provided, the default verification options are: Threshold: 1 Disable: false" @@ -747,7 +747,7 @@ "type": "integer", "description": "The number of ct transparency logs the certificate must appear on." }, - "detached_sct": { + "detachedSct": { "type": "boolean", "description": "Expect detached SCTs. This is not supported right now as we can't capture an detached SCT in the bundle." }, @@ -781,7 +781,7 @@ "type": "integer", "description": "Number of transparency logs the entry must appear on." }, - "perform_online_verification": { + "performOnlineVerification": { "type": "boolean", "description": "Perform an online inclusion proof." }, @@ -834,7 +834,7 @@ }, "dev.sigstore.verification.v1.PublicKeyIdentities": { "properties": { - "public_keys": { + "publicKeys": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" }, diff --git a/gen/pb-rust/schemas/LogId.schema.json b/gen/pb-rust/schemas/LogId.schema.json index 77b1f8c5..7056b6ad 100644 --- a/gen/pb-rust/schemas/LogId.schema.json +++ b/gen/pb-rust/schemas/LogId.schema.json @@ -4,7 +4,7 @@ "definitions": { "LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", diff --git a/gen/pb-rust/schemas/MessageSignature.schema.json b/gen/pb-rust/schemas/MessageSignature.schema.json index 07e26fdf..603bb83a 100644 --- a/gen/pb-rust/schemas/MessageSignature.schema.json +++ b/gen/pb-rust/schemas/MessageSignature.schema.json @@ -4,7 +4,7 @@ "definitions": { "MessageSignature": { "properties": { - "message_digest": { + "messageDigest": { "$ref": "#/definitions/dev.sigstore.common.v1.HashOutput", "additionalProperties": false, "description": "Message digest can be used to identify the artifact. Clients MUST NOT attempt to use this digest to verify the associated signature; it is intended solely for identification." diff --git a/gen/pb-rust/schemas/PublicKey.schema.json b/gen/pb-rust/schemas/PublicKey.schema.json index d41e5eaf..28105b87 100644 --- a/gen/pb-rust/schemas/PublicKey.schema.json +++ b/gen/pb-rust/schemas/PublicKey.schema.json @@ -4,13 +4,13 @@ "definitions": { "PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -40,7 +40,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." diff --git a/gen/pb-rust/schemas/PublicKeyIdentities.schema.json b/gen/pb-rust/schemas/PublicKeyIdentities.schema.json index 940b468d..05a5864d 100644 --- a/gen/pb-rust/schemas/PublicKeyIdentities.schema.json +++ b/gen/pb-rust/schemas/PublicKeyIdentities.schema.json @@ -4,7 +4,7 @@ "definitions": { "PublicKeyIdentities": { "properties": { - "public_keys": { + "publicKeys": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey" }, @@ -18,13 +18,13 @@ }, "dev.sigstore.common.v1.PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -54,7 +54,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." diff --git a/gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json b/gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json index 7aa04537..8a36b450 100644 --- a/gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json +++ b/gen/pb-rust/schemas/RFC3161SignedTimestamp.schema.json @@ -4,7 +4,7 @@ "definitions": { "RFC3161SignedTimestamp": { "properties": { - "signed_timestamp": { + "signedTimestamp": { "type": "string", "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", "format": "binary", diff --git a/gen/pb-rust/schemas/TimestampVerificationData.schema.json b/gen/pb-rust/schemas/TimestampVerificationData.schema.json index cb9f52d8..9d202449 100644 --- a/gen/pb-rust/schemas/TimestampVerificationData.schema.json +++ b/gen/pb-rust/schemas/TimestampVerificationData.schema.json @@ -4,7 +4,7 @@ "definitions": { "TimestampVerificationData": { "properties": { - "rfc3161_timestamps": { + "rfc3161Timestamps": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" }, @@ -20,7 +20,7 @@ }, "dev.sigstore.common.v1.RFC3161SignedTimestamp": { "properties": { - "signed_timestamp": { + "signedTimestamp": { "type": "string", "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", "format": "binary", diff --git a/gen/pb-rust/schemas/TransparencyLogEntry.schema.json b/gen/pb-rust/schemas/TransparencyLogEntry.schema.json index e130ab5d..19e9b83b 100644 --- a/gen/pb-rust/schemas/TransparencyLogEntry.schema.json +++ b/gen/pb-rust/schemas/TransparencyLogEntry.schema.json @@ -4,35 +4,35 @@ "definitions": { "TransparencyLogEntry": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The global index of the entry, used when querying the log by index." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier of the log." }, - "kind_version": { + "kindVersion": { "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", "additionalProperties": false, "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." }, - "integrated_time": { + "integratedTime": { "type": "string", "description": "The UNIX timestamp from the log when the entry was persisted." }, - "inclusion_promise": { + "inclusionPromise": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", "additionalProperties": false, "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." }, - "inclusion_proof": { + "inclusionProof": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", "additionalProperties": false, "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." }, - "canonicalized_body": { + "canonicalizedBody": { "type": "string", "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", "format": "binary", @@ -46,7 +46,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -71,7 +71,7 @@ }, "dev.sigstore.rekor.v1.InclusionPromise": { "properties": { - "signed_entry_timestamp": { + "signedEntryTimestamp": { "type": "string", "format": "binary", "binaryEncoding": "base64" @@ -84,17 +84,17 @@ }, "dev.sigstore.rekor.v1.InclusionProof": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The index of the entry in the tree it was written to." }, - "root_hash": { + "rootHash": { "type": "string", "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", "format": "binary", "binaryEncoding": "base64" }, - "tree_size": { + "treeSize": { "type": "string", "description": "The size of the merkle tree at the time the proof was generated." }, diff --git a/gen/pb-rust/schemas/TransparencyLogInstance.schema.json b/gen/pb-rust/schemas/TransparencyLogInstance.schema.json index 17fa8a8c..3d189653 100644 --- a/gen/pb-rust/schemas/TransparencyLogInstance.schema.json +++ b/gen/pb-rust/schemas/TransparencyLogInstance.schema.json @@ -4,11 +4,11 @@ "definitions": { "TransparencyLogInstance": { "properties": { - "base_url": { + "baseUrl": { "type": "string", "description": "The base URL at which can be used to URLs for the client." }, - "hash_algorithm": { + "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", 0, @@ -26,12 +26,12 @@ "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", "additionalProperties": false, "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier for this transparency log." @@ -44,7 +44,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -58,13 +58,13 @@ }, "dev.sigstore.common.v1.PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -94,7 +94,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." diff --git a/gen/pb-rust/schemas/TrustedRoot.schema.json b/gen/pb-rust/schemas/TrustedRoot.schema.json index 70df3df4..f3e53e2d 100644 --- a/gen/pb-rust/schemas/TrustedRoot.schema.json +++ b/gen/pb-rust/schemas/TrustedRoot.schema.json @@ -4,7 +4,7 @@ "definitions": { "TrustedRoot": { "properties": { - "media_type": { + "mediaType": { "type": "string", "description": "MUST be application/vnd.dev.sigstore.trustedroot+json;version=0.1" }, @@ -16,7 +16,7 @@ "type": "array", "description": "A set of trusted Rekor servers." }, - "certificate_authorities": { + "certificateAuthorities": { "items": { "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" }, @@ -32,7 +32,7 @@ "type": "array", "description": "A set of trusted certificate transparency logs." }, - "timestamp_authorities": { + "timestampAuthorities": { "items": { "$ref": "#/definitions/dev.sigstore.trustroot.v1.CertificateAuthority" }, @@ -51,7 +51,7 @@ "organization": { "type": "string" }, - "common_name": { + "commonName": { "type": "string" } }, @@ -61,7 +61,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -75,13 +75,13 @@ }, "dev.sigstore.common.v1.PublicKey": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded public key, encoding method is specified by the key_details attribute.", "format": "binary", "binaryEncoding": "base64" }, - "key_details": { + "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", 0, @@ -111,7 +111,7 @@ "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "Optional validity period for this key, *inclusive* of the endpoints." @@ -158,7 +158,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", @@ -196,12 +196,12 @@ "type": "string", "description": "The URI at which the CA can be accessed." }, - "cert_chain": { + "certChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false, "description": "The certificate chain for this CA." }, - "valid_for": { + "validFor": { "$ref": "#/definitions/dev.sigstore.common.v1.TimeRange", "additionalProperties": false, "description": "The time the *entire* chain was valid. This is at max the longest interval when *all* certificates in the chain were valid, but it MAY be shorter. Clients MUST check timestamps against *both* the `valid_for` time range *and* the entire certificate chain. The TimeRange should be considered valid *inclusive* of the endpoints." @@ -214,11 +214,11 @@ }, "dev.sigstore.trustroot.v1.TransparencyLogInstance": { "properties": { - "base_url": { + "baseUrl": { "type": "string", "description": "The base URL at which can be used to URLs for the client." }, - "hash_algorithm": { + "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", 0, @@ -236,12 +236,12 @@ "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKey", "additionalProperties": false, "description": "The public key used to verify signatures generated by the log. This attribute contains the signature algorithm used by the log." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier for this transparency log." diff --git a/gen/pb-rust/schemas/VerificationMaterial.schema.json b/gen/pb-rust/schemas/VerificationMaterial.schema.json index 3c7ba4d5..4657bc35 100644 --- a/gen/pb-rust/schemas/VerificationMaterial.schema.json +++ b/gen/pb-rust/schemas/VerificationMaterial.schema.json @@ -4,15 +4,15 @@ "definitions": { "VerificationMaterial": { "properties": { - "public_key": { + "publicKey": { "$ref": "#/definitions/dev.sigstore.common.v1.PublicKeyIdentifier", "additionalProperties": false }, - "x509_certificate_chain": { + "x509CertificateChain": { "$ref": "#/definitions/dev.sigstore.common.v1.X509CertificateChain", "additionalProperties": false }, - "tlog_entries": { + "tlogEntries": { "items": { "$ref": "#/definitions/dev.sigstore.rekor.v1.TransparencyLogEntry" }, @@ -20,7 +20,7 @@ "type": "array", "description": "An inclusion proof and an optional signed timestamp from the log. Client verification libraries MAY provide an option to support v0.1 bundles for backwards compatibility, which may contain an inclusion promise and not an inclusion proof. In this case, the client MUST validate the promise. Verifiers SHOULD NOT allow v0.1 bundles if they're used in an ecosystem which never produced them." }, - "timestamp_verification_data": { + "timestampVerificationData": { "$ref": "#/definitions/dev.sigstore.bundle.v1.TimestampVerificationData", "additionalProperties": false, "description": "Timestamp may also come from tlog_entries.inclusion_promise.signed_entry_timestamp." @@ -45,7 +45,7 @@ }, "dev.sigstore.bundle.v1.TimestampVerificationData": { "properties": { - "rfc3161_timestamps": { + "rfc3161Timestamps": { "items": { "$ref": "#/definitions/dev.sigstore.common.v1.RFC3161SignedTimestamp" }, @@ -61,7 +61,7 @@ }, "dev.sigstore.common.v1.LogId": { "properties": { - "key_id": { + "keyId": { "type": "string", "description": "The unique id of the log, represented as the SHA-256 hash of the log's public key, calculated over the DER encoding of the key represented as SubjectPublicKeyInfo. See https://www.rfc-editor.org/rfc/rfc6962#section-3.2", "format": "binary", @@ -87,7 +87,7 @@ }, "dev.sigstore.common.v1.RFC3161SignedTimestamp": { "properties": { - "signed_timestamp": { + "signedTimestamp": { "type": "string", "description": "Signed timestamp is the DER encoded TimeStampResponse. See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2", "format": "binary", @@ -101,7 +101,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", @@ -141,7 +141,7 @@ }, "dev.sigstore.rekor.v1.InclusionPromise": { "properties": { - "signed_entry_timestamp": { + "signedEntryTimestamp": { "type": "string", "format": "binary", "binaryEncoding": "base64" @@ -154,17 +154,17 @@ }, "dev.sigstore.rekor.v1.InclusionProof": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The index of the entry in the tree it was written to." }, - "root_hash": { + "rootHash": { "type": "string", "description": "The hash digest stored at the root of the merkle tree at the time the proof was generated.", "format": "binary", "binaryEncoding": "base64" }, - "tree_size": { + "treeSize": { "type": "string", "description": "The size of the merkle tree at the time the proof was generated." }, @@ -206,35 +206,35 @@ }, "dev.sigstore.rekor.v1.TransparencyLogEntry": { "properties": { - "log_index": { + "logIndex": { "type": "string", "description": "The global index of the entry, used when querying the log by index." }, - "log_id": { + "logId": { "$ref": "#/definitions/dev.sigstore.common.v1.LogId", "additionalProperties": false, "description": "The unique identifier of the log." }, - "kind_version": { + "kindVersion": { "$ref": "#/definitions/dev.sigstore.rekor.v1.KindVersion", "additionalProperties": false, "description": "The kind (type) and version of the object associated with this entry. These values are required to construct the entry during verification." }, - "integrated_time": { + "integratedTime": { "type": "string", "description": "The UNIX timestamp from the log when the entry was persisted." }, - "inclusion_promise": { + "inclusionPromise": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionPromise", "additionalProperties": false, "description": "The inclusion promise/signed entry timestamp from the log. Required for v0.1 bundles, and MUST be verified. Optional for \u003e= v0.2 bundles, and SHOULD be verified when present. Also may be used as a signed timestamp." }, - "inclusion_proof": { + "inclusionProof": { "$ref": "#/definitions/dev.sigstore.rekor.v1.InclusionProof", "additionalProperties": false, "description": "The inclusion proof can be used for offline or online verification that the entry was appended to the log, and that the log has not been altered." }, - "canonicalized_body": { + "canonicalizedBody": { "type": "string", "description": "Optional. The canonicalized transparency log entry, used to reconstruct the Signed Entry Timestamp (SET) during verification. The contents of this field are the same as the `body` field in a Rekor response, meaning that it does **not** include the \"full\" canonicalized form (of log index, ID, etc.) which are exposed as separate fields. The verifier is responsible for combining the `canonicalized_body`, `log_index`, `log_id`, and `integrated_time` into the payload that the SET's signature is generated over. This field is intended to be used in cases where the SET cannot be produced determinisitically (e.g. inconsistent JSON field ordering, differing whitespace, etc). If set, clients MUST verify that the signature referenced in the `canonicalized_body` matches the signature provided in the `Bundle.content`. If not set, clients are responsible for constructing an equivalent payload from other sources to verify the signature.", "format": "binary", diff --git a/gen/pb-rust/schemas/X509Certificate.schema.json b/gen/pb-rust/schemas/X509Certificate.schema.json index ed058fca..f98f9984 100644 --- a/gen/pb-rust/schemas/X509Certificate.schema.json +++ b/gen/pb-rust/schemas/X509Certificate.schema.json @@ -4,7 +4,7 @@ "definitions": { "X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", diff --git a/gen/pb-rust/schemas/X509CertificateChain.schema.json b/gen/pb-rust/schemas/X509CertificateChain.schema.json index c6f714e2..a2bfb087 100644 --- a/gen/pb-rust/schemas/X509CertificateChain.schema.json +++ b/gen/pb-rust/schemas/X509CertificateChain.schema.json @@ -20,7 +20,7 @@ }, "dev.sigstore.common.v1.X509Certificate": { "properties": { - "raw_bytes": { + "rawBytes": { "type": "string", "description": "DER-encoded X.509 certificate.", "format": "binary", diff --git a/gen/pb-rust/tests/bundle.txt.sigstore b/gen/pb-rust/tests/bundle.txt.sigstore index 8c439445..fac453e0 100644 --- a/gen/pb-rust/tests/bundle.txt.sigstore +++ b/gen/pb-rust/tests/bundle.txt.sigstore @@ -1 +1 @@ -{"media_type": "application/vnd.dev.sigstore.bundle+json;version=0.1", "verification_material": {"x509_certificate_chain": {"certificates": [{"raw_bytes": "MIIC5zCCAmygAwIBAgIUJ3vpewdf6e91rgjqCqagstF4qn8wCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjMwNDI2MDAyMTA4WhcNMjMwNDI2MDAzMTA4WjAAMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2sd6+lOBcn5MXtnbwca7zcwpprl7GUZiKTO9IWpAUfVTtx+BXGHQCRwsFy/d7dLlf4hurIqhzMD5yaC2kcU9/8c9G55JyBXF8Dx5SQm9y2rPWFIdm29Ql9A3I3yyEFyPo4IBbjCCAWowDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMB0GA1UdDgQWBBTlaUfjpiXGhBP3hOCW0JJZDSPxgzAfBgNVHSMEGDAWgBRxhjCmFHxib/n31vQFGn9f/+tvrDAYBgNVHREBAf8EDjAMgQphQHRueS50b3duMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDCBigYKKwYBBAHWeQIEAgR8BHoAeAB2ACswvNxoiMni4dgmKV50H0g5MZYC8pwzy15DQP6yrIZ6AAABh7rveBsAAAQDAEcwRQIhAKOZPMN9Q9qO1HXigHBPt+Ic16yy2Zgv2KQ23i5WLj16AiAzrFpuayGXdoK+hYePl9dEeXjG/vB2jK/E3sEsIrXtETAKBggqhkjOPQQDAwNpADBmAjEAgmhg80mI/Scr0isBnD5FYXZ8WxA8tnBBPmdf4aNGForGazGXaFQVPXgBVPv+YGI/AjEA0QzPC5dHD/WWXW2GbEC4dpwFk8OGRkiExMOy/+CqabbVg+/lx1N9VGBTlUTft45d"}]}, "tlog_entries": [{"log_index": "7390977", "log_id": {"key_id": "0y8wo8MtY5wrdiIFohx7sHeI5oKDpK5vQhGHI6G+pJY="}, "kind_version": {"kind": "hashedrekord", "version": "0.0.1"}, "integrated_time": "1682468469", "inclusion_promise": {"signed_entry_timestamp": "MEUCICSJs5PgN4W3Lku3ybrwfNLAKMWaOvffg2tnqm19VrWEAiEA16MVPsWDoaAljsxGefpQazpvYfs1pv8lzdgZQ0I4rH0="}, "inclusion_proof": {"log_index": "7376158", "root_hash": "LE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=", "tree_size": "7376159", "hashes": ["zgesNHwk09VvW4IDaPrJMtX59glNyyLPzeJO1Gw1hCI=", "lJiFr9ZP5FO8BjqLAUQ16A/0/LoOOQ0gfeNhdxaxO2w=", "sMImd51DBHQnH1tz4sGk8gXB+FjWyusVXbP0GmpFnB4=", "cDU1nEpl0WCRlxLi/gNVzykDzobU4qG/7BQZxn0qDgU=", "4CRqWzG3qpxKvlHuZg5O6QjQiwOzerbjwsAh30EVlA8=", "Ru0p3GE/zB2zub2/xR5rY/aM4J+5VJmiIuIl2enF/ws=", "2W+NG5yGR68lrLGcw4gn9CSCfeQF98d3LMfdo8tPyok=", "bEs1eYxy9R6hR2veGEwYW4PEdrZKrdqZ7uDlmmNtlas=", "sgQMnwcK7VxxAi+fygxq8iJ+zWqShjXm07/AWobWcXU=", "y4BESazXFcefRzxpN1PfJHoqRaKnPJPM5H/jotx0QY8=", "xiNEdLOpmGQERCR+DCEFVRK+Ns6G0BLV9M6sQQkRhik="], "checkpoint": {"envelope": "rekor.sigstage.dev - 8050909264565447525\n7376159\nLE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=\nTimestamp: 1682468469199678948\n\n\u2014 rekor.sigstage.dev 0y8wozBEAiBbAodz3dBqJjGMhnZEkbaTDVxc8+tBEPKbaWUZoqxFvwIgGtYzFgFaM3UXBRHmzgmcrCxA145dpQ2YD0yFqiPHO7U=\n"}}, "canonicalized_body": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI4MDJkZDYwZmY4ODMzMzgwMmYyNTg1ZTczMDQzYmQyMWMzNDEyODVlMTk5MmZlNWIzMTc1NWUxY2FkZWFlMzBlIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1HVUNNUUNPT0pxVFk2WFdnQjY0aXpLMldWUDA3YjBTRzlNNVdQQ3dLaGZUUHdNdnRzZ1VpOEtlUkd3UWt2dkxZYktIZHFVQ01FYk9YRkcwTk1xRVF4V1ZiNnJtR25leGRBRHVHZjZKbDhxQUM4dG42N3AzUWZWb1h6TXZGQTYxUHp4d1Z3dmI4Zz09IiwicHVibGljS2V5Ijp7ImNvbnRlbnQiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VNMWVrTkRRVzE1WjBGM1NVSkJaMGxWU2pOMmNHVjNaR1kyWlRreGNtZHFjVU54WVdkemRFWTBjVzQ0ZDBObldVbExiMXBKZW1vd1JVRjNUWGNLVG5wRlZrMUNUVWRCTVZWRlEyaE5UV015Ykc1ak0xSjJZMjFWZFZwSFZqSk5ValIzU0VGWlJGWlJVVVJGZUZaNllWZGtlbVJIT1hsYVV6RndZbTVTYkFwamJURnNXa2RzYUdSSFZYZElhR05PVFdwTmQwNUVTVEpOUkVGNVRWUkJORmRvWTA1TmFrMTNUa1JKTWsxRVFYcE5WRUUwVjJwQlFVMUlXWGRGUVZsSUNrdHZXa2w2YWpCRFFWRlpSa3MwUlVWQlEwbEVXV2RCUlRKelpEWXJiRTlDWTI0MVRWaDBibUozWTJFM2VtTjNjSEJ5YkRkSFZWcHBTMVJQT1VsWGNFRUtWV1pXVkhSNEswSllSMGhSUTFKM2MwWjVMMlEzWkV4c1pqUm9kWEpKY1doNlRVUTFlV0ZETW10alZUa3ZPR001UnpVMVNubENXRVk0UkhnMVUxRnRPUXA1TW5KUVYwWkpaRzB5T1ZGc09VRXpTVE41ZVVWR2VWQnZORWxDWW1wRFEwRlhiM2RFWjFsRVZsSXdVRUZSU0M5Q1FWRkVRV2RsUVUxQ1RVZEJNVlZrQ2twUlVVMU5RVzlIUTBOelIwRlJWVVpDZDAxRVRVSXdSMEV4VldSRVoxRlhRa0pVYkdGVlptcHdhVmhIYUVKUU0yaFBRMWN3U2twYVJGTlFlR2Q2UVdZS1FtZE9Wa2hUVFVWSFJFRlhaMEpTZUdocVEyMUdTSGhwWWk5dU16RjJVVVpIYmpsbUx5dDBkbkpFUVZsQ1owNVdTRkpGUWtGbU9FVkVha0ZOWjFGd2FBcFJTRkoxWlZNMU1HSXpaSFZOUTNkSFEybHpSMEZSVVVKbk56aDNRVkZGUlVodGFEQmtTRUo2VDJrNGRsb3liREJoU0ZacFRHMU9kbUpUT1hOaU1tUndDbUpwT1haWldGWXdZVVJCZFVKbmIzSkNaMFZGUVZsUEwwMUJSVWxDUTBGTlNHMW9NR1JJUW5wUGFUaDJXakpzTUdGSVZtbE1iVTUyWWxNNWMySXlaSEFLWW1rNWRsbFlWakJoUkVOQ2FXZFpTMHQzV1VKQ1FVaFhaVkZKUlVGblVqaENTRzlCWlVGQ01rRkRjM2QyVG5odmFVMXVhVFJrWjIxTFZqVXdTREJuTlFwTldsbERPSEIzZW5reE5VUlJVRFo1Y2tsYU5rRkJRVUpvTjNKMlpVSnpRVUZCVVVSQlJXTjNVbEZKYUVGTFQxcFFUVTQ1VVRseFR6RklXR2xuU0VKUUNuUXJTV014Tm5sNU1scG5kakpMVVRJemFUVlhUR294TmtGcFFYcHlSbkIxWVhsSFdHUnZTeXRvV1dWUWJEbGtSV1ZZYWtjdmRrSXlha3N2UlROelJYTUtTWEpZZEVWVVFVdENaMmR4YUd0cVQxQlJVVVJCZDA1d1FVUkNiVUZxUlVGbmJXaG5PREJ0U1M5VFkzSXdhWE5DYmtRMVJsbFlXamhYZUVFNGRHNUNRZ3BRYldSbU5HRk9SMFp2Y2tkaGVrZFlZVVpSVmxCWVowSldVSFlyV1VkSkwwRnFSVUV3VVhwUVF6VmtTRVF2VjFkWVZ6SkhZa1ZETkdSd2QwWnJPRTlIQ2xKcmFVVjRUVTk1THl0RGNXRmlZbFpuS3k5c2VERk9PVlpIUWxSc1ZWUm1kRFExWkFvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSJ9fX19"}]}, "message_signature": {"message_digest": {"algorithm": "SHA2_256", "digest": "gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4="}, "signature": "MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="}} +{"mediaType": "application/vnd.dev.sigstore.bundle+json;version=0.1", "verificationMaterial": {"x509CertificateChain": {"certificates": [{"rawBytes": "MIIC5zCCAmygAwIBAgIUJ3vpewdf6e91rgjqCqagstF4qn8wCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjMwNDI2MDAyMTA4WhcNMjMwNDI2MDAzMTA4WjAAMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2sd6+lOBcn5MXtnbwca7zcwpprl7GUZiKTO9IWpAUfVTtx+BXGHQCRwsFy/d7dLlf4hurIqhzMD5yaC2kcU9/8c9G55JyBXF8Dx5SQm9y2rPWFIdm29Ql9A3I3yyEFyPo4IBbjCCAWowDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMB0GA1UdDgQWBBTlaUfjpiXGhBP3hOCW0JJZDSPxgzAfBgNVHSMEGDAWgBRxhjCmFHxib/n31vQFGn9f/+tvrDAYBgNVHREBAf8EDjAMgQphQHRueS50b3duMCwGCisGAQQBg78wAQEEHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDAuBgorBgEEAYO/MAEIBCAMHmh0dHBzOi8vZ2l0aHViLmNvbS9sb2dpbi9vYXV0aDCBigYKKwYBBAHWeQIEAgR8BHoAeAB2ACswvNxoiMni4dgmKV50H0g5MZYC8pwzy15DQP6yrIZ6AAABh7rveBsAAAQDAEcwRQIhAKOZPMN9Q9qO1HXigHBPt+Ic16yy2Zgv2KQ23i5WLj16AiAzrFpuayGXdoK+hYePl9dEeXjG/vB2jK/E3sEsIrXtETAKBggqhkjOPQQDAwNpADBmAjEAgmhg80mI/Scr0isBnD5FYXZ8WxA8tnBBPmdf4aNGForGazGXaFQVPXgBVPv+YGI/AjEA0QzPC5dHD/WWXW2GbEC4dpwFk8OGRkiExMOy/+CqabbVg+/lx1N9VGBTlUTft45d"}]}, "tlogEntries": [{"logIndex": "7390977", "logId": {"keyId": "0y8wo8MtY5wrdiIFohx7sHeI5oKDpK5vQhGHI6G+pJY="}, "kindVersion": {"kind": "hashedrekord", "version": "0.0.1"}, "integratedTime": "1682468469", "inclusionPromise": {"signedEntryTimestamp": "MEUCICSJs5PgN4W3Lku3ybrwfNLAKMWaOvffg2tnqm19VrWEAiEA16MVPsWDoaAljsxGefpQazpvYfs1pv8lzdgZQ0I4rH0="}, "inclusionProof": {"logIndex": "7376158", "rootHash": "LE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=", "treeSize": "7376159", "hashes": ["zgesNHwk09VvW4IDaPrJMtX59glNyyLPzeJO1Gw1hCI=", "lJiFr9ZP5FO8BjqLAUQ16A/0/LoOOQ0gfeNhdxaxO2w=", "sMImd51DBHQnH1tz4sGk8gXB+FjWyusVXbP0GmpFnB4=", "cDU1nEpl0WCRlxLi/gNVzykDzobU4qG/7BQZxn0qDgU=", "4CRqWzG3qpxKvlHuZg5O6QjQiwOzerbjwsAh30EVlA8=", "Ru0p3GE/zB2zub2/xR5rY/aM4J+5VJmiIuIl2enF/ws=", "2W+NG5yGR68lrLGcw4gn9CSCfeQF98d3LMfdo8tPyok=", "bEs1eYxy9R6hR2veGEwYW4PEdrZKrdqZ7uDlmmNtlas=", "sgQMnwcK7VxxAi+fygxq8iJ+zWqShjXm07/AWobWcXU=", "y4BESazXFcefRzxpN1PfJHoqRaKnPJPM5H/jotx0QY8=", "xiNEdLOpmGQERCR+DCEFVRK+Ns6G0BLV9M6sQQkRhik="], "checkpoint": {"envelope": "rekor.sigstage.dev - 8050909264565447525\n7376159\nLE67t2Zlc0g35az81xMg0cgM2DULj8fNsGGHTcRthcs=\nTimestamp: 1682468469199678948\n\n\u2014 rekor.sigstage.dev 0y8wozBEAiBbAodz3dBqJjGMhnZEkbaTDVxc8+tBEPKbaWUZoqxFvwIgGtYzFgFaM3UXBRHmzgmcrCxA145dpQ2YD0yFqiPHO7U=\n"}}, "canonicalizedBody": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI4MDJkZDYwZmY4ODMzMzgwMmYyNTg1ZTczMDQzYmQyMWMzNDEyODVlMTk5MmZlNWIzMTc1NWUxY2FkZWFlMzBlIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1HVUNNUUNPT0pxVFk2WFdnQjY0aXpLMldWUDA3YjBTRzlNNVdQQ3dLaGZUUHdNdnRzZ1VpOEtlUkd3UWt2dkxZYktIZHFVQ01FYk9YRkcwTk1xRVF4V1ZiNnJtR25leGRBRHVHZjZKbDhxQUM4dG42N3AzUWZWb1h6TXZGQTYxUHp4d1Z3dmI4Zz09IiwicHVibGljS2V5Ijp7ImNvbnRlbnQiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VNMWVrTkRRVzE1WjBGM1NVSkJaMGxWU2pOMmNHVjNaR1kyWlRreGNtZHFjVU54WVdkemRFWTBjVzQ0ZDBObldVbExiMXBKZW1vd1JVRjNUWGNLVG5wRlZrMUNUVWRCTVZWRlEyaE5UV015Ykc1ak0xSjJZMjFWZFZwSFZqSk5ValIzU0VGWlJGWlJVVVJGZUZaNllWZGtlbVJIT1hsYVV6RndZbTVTYkFwamJURnNXa2RzYUdSSFZYZElhR05PVFdwTmQwNUVTVEpOUkVGNVRWUkJORmRvWTA1TmFrMTNUa1JKTWsxRVFYcE5WRUUwVjJwQlFVMUlXWGRGUVZsSUNrdHZXa2w2YWpCRFFWRlpSa3MwUlVWQlEwbEVXV2RCUlRKelpEWXJiRTlDWTI0MVRWaDBibUozWTJFM2VtTjNjSEJ5YkRkSFZWcHBTMVJQT1VsWGNFRUtWV1pXVkhSNEswSllSMGhSUTFKM2MwWjVMMlEzWkV4c1pqUm9kWEpKY1doNlRVUTFlV0ZETW10alZUa3ZPR001UnpVMVNubENXRVk0UkhnMVUxRnRPUXA1TW5KUVYwWkpaRzB5T1ZGc09VRXpTVE41ZVVWR2VWQnZORWxDWW1wRFEwRlhiM2RFWjFsRVZsSXdVRUZSU0M5Q1FWRkVRV2RsUVUxQ1RVZEJNVlZrQ2twUlVVMU5RVzlIUTBOelIwRlJWVVpDZDAxRVRVSXdSMEV4VldSRVoxRlhRa0pVYkdGVlptcHdhVmhIYUVKUU0yaFBRMWN3U2twYVJGTlFlR2Q2UVdZS1FtZE9Wa2hUVFVWSFJFRlhaMEpTZUdocVEyMUdTSGhwWWk5dU16RjJVVVpIYmpsbUx5dDBkbkpFUVZsQ1owNVdTRkpGUWtGbU9FVkVha0ZOWjFGd2FBcFJTRkoxWlZNMU1HSXpaSFZOUTNkSFEybHpSMEZSVVVKbk56aDNRVkZGUlVodGFEQmtTRUo2VDJrNGRsb3liREJoU0ZacFRHMU9kbUpUT1hOaU1tUndDbUpwT1haWldGWXdZVVJCZFVKbmIzSkNaMFZGUVZsUEwwMUJSVWxDUTBGTlNHMW9NR1JJUW5wUGFUaDJXakpzTUdGSVZtbE1iVTUyWWxNNWMySXlaSEFLWW1rNWRsbFlWakJoUkVOQ2FXZFpTMHQzV1VKQ1FVaFhaVkZKUlVGblVqaENTRzlCWlVGQ01rRkRjM2QyVG5odmFVMXVhVFJrWjIxTFZqVXdTREJuTlFwTldsbERPSEIzZW5reE5VUlJVRFo1Y2tsYU5rRkJRVUpvTjNKMlpVSnpRVUZCVVVSQlJXTjNVbEZKYUVGTFQxcFFUVTQ1VVRseFR6RklXR2xuU0VKUUNuUXJTV014Tm5sNU1scG5kakpMVVRJemFUVlhUR294TmtGcFFYcHlSbkIxWVhsSFdHUnZTeXRvV1dWUWJEbGtSV1ZZYWtjdmRrSXlha3N2UlROelJYTUtTWEpZZEVWVVFVdENaMmR4YUd0cVQxQlJVVVJCZDA1d1FVUkNiVUZxUlVGbmJXaG5PREJ0U1M5VFkzSXdhWE5DYmtRMVJsbFlXamhYZUVFNGRHNUNRZ3BRYldSbU5HRk9SMFp2Y2tkaGVrZFlZVVpSVmxCWVowSldVSFlyV1VkSkwwRnFSVUV3VVhwUVF6VmtTRVF2VjFkWVZ6SkhZa1ZETkdSd2QwWnJPRTlIQ2xKcmFVVjRUVTk1THl0RGNXRmlZbFpuS3k5c2VERk9PVlpIUWxSc1ZWUm1kRFExWkFvdExTMHRMVVZPUkNCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2c9PSJ9fX19"}]}, "messageSignature": {"messageDigest": {"algorithm": "SHA2_256", "digest": "gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4="}, "signature": "MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="}} From f21f9efc5e6d7c21a3b063556e109d86a5299368 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Fri, 4 Aug 2023 16:55:04 -0400 Subject: [PATCH 6/7] pb-rust: schema generation bugs Signed-off-by: Jack Leightcap --- Makefile | 2 +- gen/jsonschema/jsonschema.sh | 4 +- .../ArtifactVerificationOptions.schema.json | 34 ++--------- gen/jsonschema/schemas/Bundle.schema.json | 13 +--- .../schemas/CertificateIdentities.schema.json | 15 +---- .../schemas/CertificateIdentity.schema.json | 15 +---- gen/jsonschema/schemas/HashOutput.schema.json | 13 +--- gen/jsonschema/schemas/Input.schema.json | 60 +++---------------- .../schemas/MessageSignature.schema.json | 13 +--- gen/jsonschema/schemas/PublicKey.schema.json | 19 +----- .../schemas/PublicKeyIdentities.schema.json | 19 +----- .../SubjectAlternativeName.schema.json | 15 +---- .../TransparencyLogInstance.schema.json | 32 ++-------- .../schemas/TrustedRoot.schema.json | 32 ++-------- .../ArtifactVerificationOptions.schema.json | 34 ++--------- gen/pb-rust/schemas/Bundle.schema.json | 13 +--- .../schemas/CertificateIdentities.schema.json | 15 +---- .../schemas/CertificateIdentity.schema.json | 15 +---- gen/pb-rust/schemas/HashOutput.schema.json | 13 +--- gen/pb-rust/schemas/Input.schema.json | 60 +++---------------- .../schemas/MessageSignature.schema.json | 13 +--- gen/pb-rust/schemas/PublicKey.schema.json | 19 +----- .../schemas/PublicKeyIdentities.schema.json | 19 +----- .../SubjectAlternativeName.schema.json | 15 +---- .../TransparencyLogInstance.schema.json | 32 ++-------- gen/pb-rust/schemas/TrustedRoot.schema.json | 32 ++-------- 26 files changed, 75 insertions(+), 491 deletions(-) diff --git a/Makefile b/Makefile index a0e665ba..ec1be44f 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ jsonschema: docker-image-jsonschema -c "cd defs/gen/jsonschema && ./jsonschema.sh -I ../../protos -I /googleapis/ --jsonschema_out=schemas ../../protos/*.proto" gen/pb-rust/schemas: jsonschema - cp -r gen/jsonschema/schemas $@ + cp -r gen/jsonschema/schemas gen/pb-rust rust: docker-image gen/pb-rust/schemas @echo "Generating rust protobuf files" diff --git a/gen/jsonschema/jsonschema.sh b/gen/jsonschema/jsonschema.sh index f7472f20..a24391be 100755 --- a/gen/jsonschema/jsonschema.sh +++ b/gen/jsonschema/jsonschema.sh @@ -1,4 +1,4 @@ -!/bin/sh +#!/bin/sh set -u set -e @@ -6,7 +6,7 @@ set -e protoc --plugin=/root/go/bin/protoc-gen-jsonschema \ --jsonschema_opt=disallow_additional_properties \ --jsonschema_opt=enforce_oneof \ - --jsonschema_opt=enums_as_strings \ + --jsonschema_opt=enums_as_strings_only \ --jsonschema_opt=file_extension=schema.json \ --jsonschema_opt=json_fieldnames \ "$@" diff --git a/gen/jsonschema/schemas/ArtifactVerificationOptions.schema.json b/gen/jsonschema/schemas/ArtifactVerificationOptions.schema.json index 5618f366..744a374f 100644 --- a/gen/jsonschema/schemas/ArtifactVerificationOptions.schema.json +++ b/gen/jsonschema/schemas/ArtifactVerificationOptions.schema.json @@ -103,30 +103,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -157,22 +142,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/jsonschema/schemas/Bundle.schema.json b/gen/jsonschema/schemas/Bundle.schema.json index ac66af1c..5ca9e649 100644 --- a/gen/jsonschema/schemas/Bundle.schema.json +++ b/gen/jsonschema/schemas/Bundle.schema.json @@ -101,18 +101,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/jsonschema/schemas/CertificateIdentities.schema.json b/gen/jsonschema/schemas/CertificateIdentities.schema.json index b00d284a..31a7a32b 100644 --- a/gen/jsonschema/schemas/CertificateIdentities.schema.json +++ b/gen/jsonschema/schemas/CertificateIdentities.schema.json @@ -52,22 +52,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/jsonschema/schemas/CertificateIdentity.schema.json b/gen/jsonschema/schemas/CertificateIdentity.schema.json index 117f4852..14a515f4 100644 --- a/gen/jsonschema/schemas/CertificateIdentity.schema.json +++ b/gen/jsonschema/schemas/CertificateIdentity.schema.json @@ -62,22 +62,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/jsonschema/schemas/HashOutput.schema.json b/gen/jsonschema/schemas/HashOutput.schema.json index 2687ef4f..ff72ba45 100644 --- a/gen/jsonschema/schemas/HashOutput.schema.json +++ b/gen/jsonschema/schemas/HashOutput.schema.json @@ -7,18 +7,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/jsonschema/schemas/Input.schema.json b/gen/jsonschema/schemas/Input.schema.json index e23bb548..0f190157 100644 --- a/gen/jsonschema/schemas/Input.schema.json +++ b/gen/jsonschema/schemas/Input.schema.json @@ -147,18 +147,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, @@ -249,30 +240,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -329,22 +305,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { @@ -578,18 +543,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/jsonschema/schemas/MessageSignature.schema.json b/gen/jsonschema/schemas/MessageSignature.schema.json index 603bb83a..37def2f2 100644 --- a/gen/jsonschema/schemas/MessageSignature.schema.json +++ b/gen/jsonschema/schemas/MessageSignature.schema.json @@ -26,18 +26,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/jsonschema/schemas/PublicKey.schema.json b/gen/jsonschema/schemas/PublicKey.schema.json index 28105b87..b380c3a7 100644 --- a/gen/jsonschema/schemas/PublicKey.schema.json +++ b/gen/jsonschema/schemas/PublicKey.schema.json @@ -13,30 +13,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/jsonschema/schemas/PublicKeyIdentities.schema.json b/gen/jsonschema/schemas/PublicKeyIdentities.schema.json index 05a5864d..72dc4fa4 100644 --- a/gen/jsonschema/schemas/PublicKeyIdentities.schema.json +++ b/gen/jsonschema/schemas/PublicKeyIdentities.schema.json @@ -27,30 +27,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/jsonschema/schemas/SubjectAlternativeName.schema.json b/gen/jsonschema/schemas/SubjectAlternativeName.schema.json index ff25d78f..967cfe61 100644 --- a/gen/jsonschema/schemas/SubjectAlternativeName.schema.json +++ b/gen/jsonschema/schemas/SubjectAlternativeName.schema.json @@ -7,22 +7,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/jsonschema/schemas/TransparencyLogInstance.schema.json b/gen/jsonschema/schemas/TransparencyLogInstance.schema.json index 3d189653..3c7e0d9a 100644 --- a/gen/jsonschema/schemas/TransparencyLogInstance.schema.json +++ b/gen/jsonschema/schemas/TransparencyLogInstance.schema.json @@ -11,18 +11,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, @@ -67,30 +58,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/jsonschema/schemas/TrustedRoot.schema.json b/gen/jsonschema/schemas/TrustedRoot.schema.json index f3e53e2d..5b1f2a62 100644 --- a/gen/jsonschema/schemas/TrustedRoot.schema.json +++ b/gen/jsonschema/schemas/TrustedRoot.schema.json @@ -84,30 +84,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -221,18 +206,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json b/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json index 5618f366..744a374f 100644 --- a/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json +++ b/gen/pb-rust/schemas/ArtifactVerificationOptions.schema.json @@ -103,30 +103,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -157,22 +142,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/pb-rust/schemas/Bundle.schema.json b/gen/pb-rust/schemas/Bundle.schema.json index ac66af1c..5ca9e649 100644 --- a/gen/pb-rust/schemas/Bundle.schema.json +++ b/gen/pb-rust/schemas/Bundle.schema.json @@ -101,18 +101,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/pb-rust/schemas/CertificateIdentities.schema.json b/gen/pb-rust/schemas/CertificateIdentities.schema.json index b00d284a..31a7a32b 100644 --- a/gen/pb-rust/schemas/CertificateIdentities.schema.json +++ b/gen/pb-rust/schemas/CertificateIdentities.schema.json @@ -52,22 +52,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/pb-rust/schemas/CertificateIdentity.schema.json b/gen/pb-rust/schemas/CertificateIdentity.schema.json index 117f4852..14a515f4 100644 --- a/gen/pb-rust/schemas/CertificateIdentity.schema.json +++ b/gen/pb-rust/schemas/CertificateIdentity.schema.json @@ -62,22 +62,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/pb-rust/schemas/HashOutput.schema.json b/gen/pb-rust/schemas/HashOutput.schema.json index 2687ef4f..ff72ba45 100644 --- a/gen/pb-rust/schemas/HashOutput.schema.json +++ b/gen/pb-rust/schemas/HashOutput.schema.json @@ -7,18 +7,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/pb-rust/schemas/Input.schema.json b/gen/pb-rust/schemas/Input.schema.json index e23bb548..0f190157 100644 --- a/gen/pb-rust/schemas/Input.schema.json +++ b/gen/pb-rust/schemas/Input.schema.json @@ -147,18 +147,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, @@ -249,30 +240,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -329,22 +305,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { @@ -578,18 +543,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/pb-rust/schemas/MessageSignature.schema.json b/gen/pb-rust/schemas/MessageSignature.schema.json index 603bb83a..37def2f2 100644 --- a/gen/pb-rust/schemas/MessageSignature.schema.json +++ b/gen/pb-rust/schemas/MessageSignature.schema.json @@ -26,18 +26,9 @@ "algorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, diff --git a/gen/pb-rust/schemas/PublicKey.schema.json b/gen/pb-rust/schemas/PublicKey.schema.json index 28105b87..b380c3a7 100644 --- a/gen/pb-rust/schemas/PublicKey.schema.json +++ b/gen/pb-rust/schemas/PublicKey.schema.json @@ -13,30 +13,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/pb-rust/schemas/PublicKeyIdentities.schema.json b/gen/pb-rust/schemas/PublicKeyIdentities.schema.json index 05a5864d..72dc4fa4 100644 --- a/gen/pb-rust/schemas/PublicKeyIdentities.schema.json +++ b/gen/pb-rust/schemas/PublicKeyIdentities.schema.json @@ -27,30 +27,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/pb-rust/schemas/SubjectAlternativeName.schema.json b/gen/pb-rust/schemas/SubjectAlternativeName.schema.json index ff25d78f..967cfe61 100644 --- a/gen/pb-rust/schemas/SubjectAlternativeName.schema.json +++ b/gen/pb-rust/schemas/SubjectAlternativeName.schema.json @@ -7,22 +7,11 @@ "type": { "enum": [ "SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED", - 0, "EMAIL", - 1, "URI", - 2, - "OTHER_NAME", - 3 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "OTHER_NAME" ], + "type": "string", "title": "Subject Alternative Name Type" }, "regexp": { diff --git a/gen/pb-rust/schemas/TransparencyLogInstance.schema.json b/gen/pb-rust/schemas/TransparencyLogInstance.schema.json index 3d189653..3c7e0d9a 100644 --- a/gen/pb-rust/schemas/TransparencyLogInstance.schema.json +++ b/gen/pb-rust/schemas/TransparencyLogInstance.schema.json @@ -11,18 +11,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, @@ -67,30 +58,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, diff --git a/gen/pb-rust/schemas/TrustedRoot.schema.json b/gen/pb-rust/schemas/TrustedRoot.schema.json index f3e53e2d..5b1f2a62 100644 --- a/gen/pb-rust/schemas/TrustedRoot.schema.json +++ b/gen/pb-rust/schemas/TrustedRoot.schema.json @@ -84,30 +84,15 @@ "keyDetails": { "enum": [ "PUBLIC_KEY_DETAILS_UNSPECIFIED", - 0, "PKCS1_RSA_PKCS1V5", - 1, "PKCS1_RSA_PSS", - 2, "PKIX_RSA_PKCS1V5", - 3, "PKIX_RSA_PSS", - 4, "PKIX_ECDSA_P256_SHA_256", - 5, "PKIX_ECDSA_P256_HMAC_SHA_256", - 6, - "PKIX_ED25519", - 7 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "PKIX_ED25519" ], + "type": "string", "title": "Public Key Details", "description": "Details of a specific public key, capturing the the key encoding method, and signature algorithm. To avoid the possibility of contradicting formats such as PKCS1 with ED25519 the valid permutations are listed as a linear set instead of a cartesian set (i.e one combined variable instead of two, one for encoding and one for the signature algorithm)." }, @@ -221,18 +206,9 @@ "hashAlgorithm": { "enum": [ "HASH_ALGORITHM_UNSPECIFIED", - 0, - "SHA2_256", - 1 - ], - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - } + "SHA2_256" ], + "type": "string", "title": "This package defines commonly used message types within the Sigstore\n community.", "description": "This package defines commonly used message types within the Sigstore community. Only a subset of the secure hash standard algorithms are supported. See \u003chttps://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\u003e for more details. UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force any proto JSON serialization to emit the used hash algorithm, as default option is to *omit* the default value of an enum (which is the first value, represented by '0'." }, From 1b22bffdc585ccc3c3b5960649c3a7a69d3a9c42 Mon Sep 17 00:00:00 2001 From: Jack Leightcap Date: Mon, 7 Aug 2023 16:57:34 -0400 Subject: [PATCH 7/7] pb-rust: re-enable test suite Signed-off-by: Jack Leightcap --- .github/workflows/rust-build.yml | 14 ++++++++++++++ gen/pb-rust/tests/integration.rs | 5 ++--- gen/pb-rust/tests/unit.rs | 5 ++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust-build.yml b/.github/workflows/rust-build.yml index d28224ce..e61c2a52 100644 --- a/.github/workflows/rust-build.yml +++ b/.github/workflows/rust-build.yml @@ -47,3 +47,17 @@ jobs: - run: | cd gen/pb-rust cargo build --verbose + + test: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + + steps: + - uses: actions/checkout@v3 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: | + cd gen/pb-rust + cargo test --tests diff --git a/gen/pb-rust/tests/integration.rs b/gen/pb-rust/tests/integration.rs index 48271bb7..6ef078f9 100644 --- a/gen/pb-rust/tests/integration.rs +++ b/gen/pb-rust/tests/integration.rs @@ -2,8 +2,7 @@ use pretty_assertions::{assert_eq, assert_ne}; use serde_json; use sigstore_protobuf_specs::{ Bundle, DevSigstoreBundleV1VerificationMaterial as VerificationMaterial, - DevSigstoreCommonV1HashOutput as HashOutput, - DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1LogId as LogId, + DevSigstoreCommonV1HashOutput as HashOutput, DevSigstoreCommonV1LogId as LogId, DevSigstoreCommonV1MessageSignature as MessageSignature, DevSigstoreCommonV1X509Certificate as X509Certificate, DevSigstoreCommonV1X509CertificateChain as X509CertificateChain, @@ -75,7 +74,7 @@ fn bundle() { }), message_signature: Some(MessageSignature { message_digest: Some(HashOutput{ - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + algorithm: Some(String::from("SHA2_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")) }), signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g==")) diff --git a/gen/pb-rust/tests/unit.rs b/gen/pb-rust/tests/unit.rs index 6d523f54..f6346a4e 100644 --- a/gen/pb-rust/tests/unit.rs +++ b/gen/pb-rust/tests/unit.rs @@ -1,6 +1,5 @@ use sigstore_protobuf_specs::{ DevSigstoreCommonV1HashOutput as HashOutput, - DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1MessageSignature as MessageSignature, }; @@ -8,7 +7,7 @@ use sigstore_protobuf_specs::{ #[test] fn primitives() { let hash_output = HashOutput { - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + algorithm: Some(String::from("SHA2_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), }; @@ -25,7 +24,7 @@ fn primitives() { fn nested() { let message_signature= MessageSignature { message_digest: Some(HashOutput { - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA_256"))), + algorithm: Some(String::from("SHA_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), }), signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="))