| 1 |
// This file is @generated by prost-build. |
| 2 |
/// TransparencyLogInstance describes the immutable parameters from a |
| 3 |
/// transparency log. |
| 4 |
/// See <https://www.rfc-editor.org/rfc/rfc9162.html#name-log-parameters> |
| 5 |
/// for more details. |
| 6 |
/// The included parameters are the minimal set required to identify a log, |
| 7 |
/// and verify an inclusion proof/promise. |
| 8 |
#[derive( |
| 9 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 10 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 11 |
)] |
| 12 |
#[derive(::prost_reflect::ReflectMessage)] |
| 13 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.TransparencyLogInstance")] |
| 14 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 15 |
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] |
| 16 |
pub struct TransparencyLogInstance { |
| 17 |
/// The base URL at which can be used to URLs for the client. |
| 18 |
/// SHOULD match the origin on the log checkpoint: |
| 19 |
/// <https://github.com/C2SP/C2SP/blob/main/tlog-checkpoint.md#note-text.> |
| 20 |
#[prost(string, tag = "1")] |
| 21 |
pub base_url: ::prost::alloc::string::String, |
| 22 |
/// The hash algorithm used for the Merkle Tree. |
| 23 |
#[prost(enumeration = "super::super::common::v1::HashAlgorithm", tag = "2")] |
| 24 |
pub hash_algorithm: i32, |
| 25 |
/// The public key used to verify signatures generated by the log. |
| 26 |
/// This attribute contains the signature algorithm used by the log. |
| 27 |
#[prost(message, optional, tag = "3")] |
| 28 |
pub public_key: ::core::option::Option<super::super::common::v1::PublicKey>, |
| 29 |
/// The identifier for this transparency log. |
| 30 |
/// Represented as the SHA-256 hash of the log's public key, |
| 31 |
/// calculated over the DER encoding of the key represented as |
| 32 |
/// SubjectPublicKeyInfo. |
| 33 |
/// See <https://www.rfc-editor.org/rfc/rfc6962#section-3.2> |
| 34 |
/// For Rekor v2 instances, log_id and checkpoint_key_id will be set |
| 35 |
/// to the same value. |
| 36 |
/// It is recommended to use checkpoint_key_id instead, since log_id is not |
| 37 |
/// guaranteed to be unique across multiple deployments. Clients |
| 38 |
/// must use the key name and key ID, as defined by the signed-note spec |
| 39 |
/// linked below, from a checkpoint to determine the correct |
| 40 |
/// TransparencyLogInstance to verify a proof. |
| 41 |
/// log_id will eventually be deprecated in favor of checkpoint_id. |
| 42 |
#[prost(message, optional, tag = "4")] |
| 43 |
pub log_id: ::core::option::Option<super::super::common::v1::LogId>, |
| 44 |
/// The unique identifier for the log, used in the checkpoint. |
| 45 |
/// Only supported for TrustedRoot media types matching or greater than |
| 46 |
/// application/vnd.dev.sigstore.trustedroot.v0.2+json |
| 47 |
/// Its calculation is described in |
| 48 |
/// <https://github.com/C2SP/C2SP/blob/main/signed-note.md#signatures> |
| 49 |
/// SHOULD be set for all logs. When not set, clients MUST use log_id. |
| 50 |
/// |
| 51 |
/// For Ed25519 signatures, the key ID is computed per the C2SP spec: |
| 52 |
/// key ID = SHA-256(key name || 0x0A || 0x01 || 32-byte Ed25519 public key)\[:4\] |
| 53 |
/// For ECDSA signatures, the key ID is computed per the C2SP spec: |
| 54 |
/// key ID = SHA-256(PKIX ASN.1 DER-encoded public key, in SubjectPublicKeyInfo format)\[:4\] |
| 55 |
/// For RSA signatures, the signature type will be 0xff with an appended identifier for the format, |
| 56 |
/// "PKIX-RSA-PKCS#1v1.5": |
| 57 |
/// key ID = SHA-256(key name || 0x0A || 0xff || PKIX-RSA-PKCS#1v1.5 || PKIX ASN.1 DER-encoded public key)\[:4\] |
| 58 |
/// |
| 59 |
/// This is provided for convenience. Clients can also calculate the |
| 60 |
/// checkpoint key ID given the log's public key. |
| 61 |
/// SHOULD be 4 bytes long, as a truncated hash. |
| 62 |
/// |
| 63 |
/// To find a matching TransparencyLogInstance in the TrustedRoot, |
| 64 |
/// clients will parse the checkpoint, and for each signature line, |
| 65 |
/// use the key name (i.e. log origin, base_url from TrustedRoot) |
| 66 |
/// and checkpoint key ID (i.e. checkpoint_key_id from TrustedRoot) |
| 67 |
/// which can then be compared against the TrustedRoot log instances. |
| 68 |
#[prost(message, optional, tag = "5")] |
| 69 |
pub checkpoint_key_id: ::core::option::Option<super::super::common::v1::LogId>, |
| 70 |
/// The name of the operator of this log deployment. Operator MUST be |
| 71 |
/// formatted as a scheme-less URI, e.g. sigstore.dev |
| 72 |
/// Only supported for TrustedRoot media types matching or greater than |
| 73 |
/// application/vnd.dev.sigstore.trustedroot.v0.2+json |
| 74 |
/// This MUST be used when there are multiple transparency log instances |
| 75 |
/// to determine if log proof verification meets a specified threshold, |
| 76 |
/// e.g. two proofs from log deployments operated by the same operator |
| 77 |
/// should count as only one valid proof. |
| 78 |
#[prost(string, tag = "6")] |
| 79 |
pub operator: ::prost::alloc::string::String, |
| 80 |
} |
| 81 |
/// CertificateAuthority enlists the information required to identify which |
| 82 |
/// CA to use and perform signature verification. |
| 83 |
#[derive( |
| 84 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 85 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 86 |
)] |
| 87 |
#[derive(::prost_reflect::ReflectMessage)] |
| 88 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.CertificateAuthority")] |
| 89 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 90 |
#[derive(Clone, PartialEq, ::prost::Message)] |
| 91 |
pub struct CertificateAuthority { |
| 92 |
/// The root certificate MUST be self-signed, and so the subject and |
| 93 |
/// issuer are the same. |
| 94 |
#[prost(message, optional, tag = "1")] |
| 95 |
pub subject: ::core::option::Option<super::super::common::v1::DistinguishedName>, |
| 96 |
/// The URI identifies the certificate authority. |
| 97 |
/// |
| 98 |
/// It is RECOMMENDED that the URI is the base URL for the certificate |
| 99 |
/// authority, that can be provided to any SDK/client provided |
| 100 |
/// by the certificate authority to interact with the certificate |
| 101 |
/// authority. |
| 102 |
#[prost(string, tag = "2")] |
| 103 |
pub uri: ::prost::alloc::string::String, |
| 104 |
/// The certificate chain for this CA. The last certificate in the chain |
| 105 |
/// MUST be the trust anchor. The trust anchor MAY be a self-signed root |
| 106 |
/// CA certificate or MAY be an intermediate CA certificate. |
| 107 |
#[prost(message, optional, tag = "3")] |
| 108 |
pub cert_chain: ::core::option::Option< |
| 109 |
super::super::common::v1::X509CertificateChain, |
| 110 |
>, |
| 111 |
/// The time the *entire* chain was valid. This is at max the |
| 112 |
/// longest interval when *all* certificates in the chain were valid, |
| 113 |
/// but it MAY be shorter. Clients MUST check timestamps against *both* |
| 114 |
/// the `valid_for` time range *and* the entire certificate chain. |
| 115 |
/// |
| 116 |
/// The TimeRange should be considered valid *inclusive* of the |
| 117 |
/// endpoints. |
| 118 |
#[prost(message, optional, tag = "4")] |
| 119 |
pub valid_for: ::core::option::Option<super::super::common::v1::TimeRange>, |
| 120 |
/// The name of the operator of this certificate or timestamp authority. |
| 121 |
/// Operator MUST be formatted as a scheme-less URI, e.g. sigstore.dev |
| 122 |
/// This MUST be used when there are multiple timestamp authorities to |
| 123 |
/// determine if the signed timestamp verification meets a specified |
| 124 |
/// threshold, e.g. two signed timestamps from timestamp authorities |
| 125 |
/// operated by the same operator should count as only one valid |
| 126 |
/// timestamp. |
| 127 |
#[prost(string, tag = "5")] |
| 128 |
pub operator: ::prost::alloc::string::String, |
| 129 |
} |
| 130 |
/// TrustedRoot describes the client's complete set of trusted entities. |
| 131 |
/// How the TrustedRoot is populated is not specified, but can be a |
| 132 |
/// combination of many sources such as TUF repositories, files on disk etc. |
| 133 |
/// |
| 134 |
/// The TrustedRoot is not meant to be used for any artifact verification, only |
| 135 |
/// to capture the complete/global set of trusted verification materials. |
| 136 |
/// When verifying an artifact, based on the artifact and policies, a selection |
| 137 |
/// of keys/authorities are expected to be extracted and provided to the |
| 138 |
/// verification function. This way the set of keys/authorities can be kept to |
| 139 |
/// a minimal set by the policy to gain better control over what signatures |
| 140 |
/// that are allowed. |
| 141 |
/// |
| 142 |
/// The embedded transparency logs, CT logs, CAs and TSAs MUST include any |
| 143 |
/// previously used instance -- otherwise signatures made in the past cannot |
| 144 |
/// be verified. |
| 145 |
/// |
| 146 |
/// All the listed instances SHOULD be sorted by the 'valid_for.start' |
| 147 |
/// in ascending order, that is, the oldest instance first. Clients |
| 148 |
/// MUST accept instances that overlaps in time, if not clients may |
| 149 |
/// experience problems during rotations of verification materials. |
| 150 |
/// |
| 151 |
/// To be able to manage planned rotations of either transparency logs or |
| 152 |
/// certificate authorities, clienst MUST accept lists of instances where |
| 153 |
/// the last instance have a 'valid_for' that belongs to the future. |
| 154 |
/// This should not be a problem as clients SHOULD first seek the trust root |
| 155 |
/// for a suitable instance before creating a per artifact trust root (that |
| 156 |
/// is, a sub-set of the complete trust root) that is used for verification. |
| 157 |
#[derive( |
| 158 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 159 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 160 |
)] |
| 161 |
#[derive(::prost_reflect::ReflectMessage)] |
| 162 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.TrustedRoot")] |
| 163 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 164 |
#[derive(Clone, PartialEq, ::prost::Message)] |
| 165 |
pub struct TrustedRoot { |
| 166 |
/// MUST be application/vnd.dev.sigstore.trustedroot.v0.2+json |
| 167 |
/// when encoded as JSON. |
| 168 |
/// Clients MAY choose to also support |
| 169 |
/// application/vnd.dev.sigstore.trustedroot.v0.1+json |
| 170 |
/// Clients MAY process and parse content with the media type defined |
| 171 |
/// in the old format: |
| 172 |
/// application/vnd.dev.sigstore.trustedroot+json;version=0.1 |
| 173 |
#[prost(string, tag = "1")] |
| 174 |
pub media_type: ::prost::alloc::string::String, |
| 175 |
/// A set of trusted Rekor servers. |
| 176 |
#[prost(message, repeated, tag = "2")] |
| 177 |
pub tlogs: ::prost::alloc::vec::Vec<TransparencyLogInstance>, |
| 178 |
/// A set of trusted certificate authorities (e.g Fulcio), and any |
| 179 |
/// intermediate certificates they provide. |
| 180 |
/// If a CA is issuing multiple intermediate certificate, each |
| 181 |
/// combination shall be represented as separate chain. I.e, a single |
| 182 |
/// root cert may appear in multiple chains but with different |
| 183 |
/// intermediate and/or leaf certificates. |
| 184 |
/// The certificates are intended to be used for verifying artifact |
| 185 |
/// signatures. |
| 186 |
#[prost(message, repeated, tag = "3")] |
| 187 |
pub certificate_authorities: ::prost::alloc::vec::Vec<CertificateAuthority>, |
| 188 |
/// A set of trusted certificate transparency logs. |
| 189 |
#[prost(message, repeated, tag = "4")] |
| 190 |
pub ctlogs: ::prost::alloc::vec::Vec<TransparencyLogInstance>, |
| 191 |
/// A set of trusted timestamping authorities. |
| 192 |
#[prost(message, repeated, tag = "5")] |
| 193 |
pub timestamp_authorities: ::prost::alloc::vec::Vec<CertificateAuthority>, |
| 194 |
} |
| 195 |
/// SigningConfig represents the trusted entities/state needed by Sigstore |
| 196 |
/// signing. In particular, it primarily contains service URLs that a Sigstore |
| 197 |
/// signer may need to connect to for the online aspects of signing. |
| 198 |
#[derive( |
| 199 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 200 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 201 |
)] |
| 202 |
#[derive(::prost_reflect::ReflectMessage)] |
| 203 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.SigningConfig")] |
| 204 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 205 |
#[derive(Clone, PartialEq, ::prost::Message)] |
| 206 |
pub struct SigningConfig { |
| 207 |
/// MUST be application/vnd.dev.sigstore.signingconfig.v0.2+json |
| 208 |
/// Clients MAY choose to also support |
| 209 |
/// application/vnd.dev.sigstore.signingconfig.v0.1+json |
| 210 |
#[prost(string, tag = "5")] |
| 211 |
pub media_type: ::prost::alloc::string::String, |
| 212 |
/// URLs to Fulcio-compatible CAs, capable of receiving |
| 213 |
/// Certificate Signing Requests (CSRs) and responding with |
| 214 |
/// issued certificates. |
| 215 |
/// |
| 216 |
/// These URLs MUST be the "base" URL for the CAs, which clients |
| 217 |
/// should construct an appropriate CSR endpoint on top of. |
| 218 |
/// For example, if a CA URL is `<https://example.com/ca`,> then |
| 219 |
/// the client MAY construct the CSR endpoint as |
| 220 |
/// `<https://example.com/ca/api/v2/signingCert`.> |
| 221 |
/// |
| 222 |
/// Clients MUST select only one Service with the highest API version |
| 223 |
/// that the client is compatible with, that is within its |
| 224 |
/// validity period, and has the newest validity start date. |
| 225 |
/// Client SHOULD select the first Service that meets this requirement. |
| 226 |
/// All listed Services SHOULD be sorted by the `valid_for` window in |
| 227 |
/// descending order, with the newest instance first. |
| 228 |
#[prost(message, repeated, tag = "6")] |
| 229 |
pub ca_urls: ::prost::alloc::vec::Vec<Service>, |
| 230 |
/// URLs to OpenID Connect identity providers. |
| 231 |
/// |
| 232 |
/// These URLs MUST be the "base" URLs for the OIDC IdPs, which clients |
| 233 |
/// should perform well-known OpenID Connect discovery against. |
| 234 |
/// |
| 235 |
/// Clients MUST select only one Service with the highest API version |
| 236 |
/// that the client is compatible with, that is within its |
| 237 |
/// validity period, and has the newest validity start date. |
| 238 |
/// Client SHOULD select the first Service that meets this requirement. |
| 239 |
/// All listed Services SHOULD be sorted by the `valid_for` window in |
| 240 |
/// descending order, with the newest instance first. |
| 241 |
#[prost(message, repeated, tag = "7")] |
| 242 |
pub oidc_urls: ::prost::alloc::vec::Vec<Service>, |
| 243 |
/// URLs to Rekor transparency logs. |
| 244 |
/// |
| 245 |
/// These URL MUST be the "base" URLs for the transparency logs, |
| 246 |
/// which clients should construct appropriate API endpoints on top of. |
| 247 |
/// |
| 248 |
/// Clients MUST group Services by `operator` and select at most one |
| 249 |
/// Service from each operator. Clients MUST select Services with the |
| 250 |
/// highest API version that the client is compatible with, that are |
| 251 |
/// within its validity period, and have the newest validity start dates. |
| 252 |
/// All listed Services SHOULD be sorted by the `valid_for` window in |
| 253 |
/// descending order, with the newest instance first. |
| 254 |
/// |
| 255 |
/// Clients MUST select Services based on the selector value of |
| 256 |
/// `rekor_tlog_config`. |
| 257 |
#[prost(message, repeated, tag = "8")] |
| 258 |
pub rekor_tlog_urls: ::prost::alloc::vec::Vec<Service>, |
| 259 |
/// Specifies how a client should select the set of Rekor transparency |
| 260 |
/// logs to write to. |
| 261 |
#[prost(message, optional, tag = "9")] |
| 262 |
pub rekor_tlog_config: ::core::option::Option<ServiceConfiguration>, |
| 263 |
/// URLs to RFC 3161 Time Stamping Authorities (TSA). |
| 264 |
/// |
| 265 |
/// These URLs MUST be the *full* URL for the TSA, meaning that it |
| 266 |
/// should be suitable for submitting Time Stamp Requests (TSRs) to |
| 267 |
/// via HTTP, per RFC 3161. |
| 268 |
/// |
| 269 |
/// Clients MUST group Services by `operator` and select at most one |
| 270 |
/// Service from each operator. Clients MUST select Services with the |
| 271 |
/// highest API version that the client is compatible with, that are |
| 272 |
/// within its validity period, and have the newest validity start dates. |
| 273 |
/// All listed Services SHOULD be sorted by the `valid_for` window in |
| 274 |
/// descending order, with the newest instance first. |
| 275 |
/// |
| 276 |
/// Clients MUST select Services based on the selector value of |
| 277 |
/// `tsa_config`. |
| 278 |
#[prost(message, repeated, tag = "10")] |
| 279 |
pub tsa_urls: ::prost::alloc::vec::Vec<Service>, |
| 280 |
/// Specifies how a client should select the set of TSAs to request |
| 281 |
/// signed timestamps from. |
| 282 |
#[prost(message, optional, tag = "11")] |
| 283 |
pub tsa_config: ::core::option::Option<ServiceConfiguration>, |
| 284 |
} |
| 285 |
/// Service represents an instance of a service that is a part of Sigstore infrastructure. |
| 286 |
/// When selecting one or multiple services from a list of services, clients MUST: |
| 287 |
/// * Use the API version hint to determine the service with the highest API version |
| 288 |
/// that the client is compatible with. |
| 289 |
/// * Only select services within the specified validity period and that have the |
| 290 |
/// newest validity start date. |
| 291 |
/// When selecting multiple services, clients MUST: |
| 292 |
/// * Use the ServiceConfiguration to determine how many services MUST be selected. |
| 293 |
/// Clients MUST return an error if there are not enough services that meet the |
| 294 |
/// selection criteria. |
| 295 |
/// * Group services by `operator` and select at most one service from an operator. |
| 296 |
/// During verification, clients MUST treat valid verification metadata from the |
| 297 |
/// operator as valid only once towards a threshold. |
| 298 |
/// * Select services from only the highest supported API version. |
| 299 |
#[derive( |
| 300 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 301 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 302 |
)] |
| 303 |
#[derive(::prost_reflect::ReflectMessage)] |
| 304 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.Service")] |
| 305 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 306 |
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] |
| 307 |
pub struct Service { |
| 308 |
/// URL of the service. MUST include scheme and authority. MAY include path. |
| 309 |
#[prost(string, tag = "1")] |
| 310 |
pub url: ::prost::alloc::string::String, |
| 311 |
/// Specifies the major API version. A value of 0 represents a service that |
| 312 |
/// has not yet been released. |
| 313 |
#[prost(uint32, tag = "2")] |
| 314 |
pub major_api_version: u32, |
| 315 |
/// Validity period of a service. A service that has only a start date |
| 316 |
/// SHOULD be considered the most recent instance of that service, but |
| 317 |
/// the client MUST NOT assume there is only one valid instance. |
| 318 |
/// The TimeRange MUST be considered valid *inclusive* of the |
| 319 |
/// endpoints. |
| 320 |
#[prost(message, optional, tag = "3")] |
| 321 |
pub valid_for: ::core::option::Option<super::super::common::v1::TimeRange>, |
| 322 |
/// Specifies the name of the service operator. When selecting multiple |
| 323 |
/// services, clients MUST use the operator to select services from |
| 324 |
/// distinct operators. Operator MUST be formatted as a scheme-less |
| 325 |
/// URI, e.g. sigstore.dev |
| 326 |
#[prost(string, tag = "4")] |
| 327 |
pub operator: ::prost::alloc::string::String, |
| 328 |
} |
| 329 |
/// ServiceConfiguration specifies how a client should select a set of |
| 330 |
/// Services to connect to, along with a count when a specific number |
| 331 |
/// of Services is requested. |
| 332 |
#[derive( |
| 333 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 334 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 335 |
)] |
| 336 |
#[derive(::prost_reflect::ReflectMessage)] |
| 337 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.ServiceConfiguration")] |
| 338 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 339 |
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] |
| 340 |
pub struct ServiceConfiguration { |
| 341 |
/// How a client should select a set of Services to connect to. |
| 342 |
/// Clients SHOULD NOT select services from multiple API versions. |
| 343 |
#[prost(enumeration = "ServiceSelector", tag = "1")] |
| 344 |
pub selector: i32, |
| 345 |
/// count specifies the number of Services the client should use. |
| 346 |
/// Only used when selector is set to EXACT, and count MUST be greater |
| 347 |
/// than 0. count MUST be less than or equal to the number of Services. |
| 348 |
/// Clients MUST return an error is there are not enough services |
| 349 |
/// that meet selection criteria. |
| 350 |
#[prost(uint32, tag = "2")] |
| 351 |
pub count: u32, |
| 352 |
} |
| 353 |
/// ClientTrustConfig describes the complete state needed by a client |
| 354 |
/// to perform both signing and verification operations against a particular |
| 355 |
/// instance of Sigstore. |
| 356 |
#[derive( |
| 357 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 358 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 359 |
)] |
| 360 |
#[derive(::prost_reflect::ReflectMessage)] |
| 361 |
#[prost_reflect(message_name = "dev.sigstore.trustroot.v1.ClientTrustConfig")] |
| 362 |
#[prost_reflect(file_descriptor_set_bytes = "crate::FILE_DESCRIPTOR_SET_BYTES")] |
| 363 |
#[derive(Clone, PartialEq, ::prost::Message)] |
| 364 |
pub struct ClientTrustConfig { |
| 365 |
/// MUST be application/vnd.dev.sigstore.clienttrustconfig.v0.1+json |
| 366 |
#[prost(string, tag = "1")] |
| 367 |
pub media_type: ::prost::alloc::string::String, |
| 368 |
/// The root of trust, which MUST be present. |
| 369 |
#[prost(message, optional, tag = "2")] |
| 370 |
pub trusted_root: ::core::option::Option<TrustedRoot>, |
| 371 |
/// Configuration for signing clients, which MUST be present. |
| 372 |
#[prost(message, optional, tag = "3")] |
| 373 |
pub signing_config: ::core::option::Option<SigningConfig>, |
| 374 |
} |
| 375 |
/// ServiceSelector specifies how a client SHOULD select a set of |
| 376 |
/// Services to connect to. A client SHOULD throw an error if |
| 377 |
/// the value is SERVICE_SELECTOR_UNDEFINED. |
| 378 |
#[derive( |
| 379 |
sigstore_protobuf_specs_derive::Deserialize_proto, |
| 380 |
sigstore_protobuf_specs_derive::Serialize_proto |
| 381 |
)] |
| 382 |
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] |
| 383 |
#[repr(i32)] |
| 384 |
pub enum ServiceSelector { |
| 385 |
Undefined = 0, |
| 386 |
/// Clients SHOULD select all Services based on supported API version |
| 387 |
/// and validity window. |
| 388 |
All = 1, |
| 389 |
/// Clients SHOULD select one Service based on supported API version |
| 390 |
/// and validity window. It is up to the client implementation to |
| 391 |
/// decide how to select the Service, e.g. random or round-robin. |
| 392 |
Any = 2, |
| 393 |
/// Clients SHOULD select a specific number of Services based on |
| 394 |
/// supported API version and validity window, using the provided |
| 395 |
/// `count`. It is up to the client implementation to decide how to |
| 396 |
/// select the Service, e.g. random or round-robin. |
| 397 |
Exact = 3, |
| 398 |
} |
| 399 |
impl ServiceSelector { |
| 400 |
/// String value of the enum field names used in the ProtoBuf definition. |
| 401 |
/// |
| 402 |
/// The values are not transformed in any way and thus are considered stable |
| 403 |
/// (if the ProtoBuf definition does not change) and safe for programmatic use. |
| 404 |
pub fn as_str_name(&self) -> &'static str { |
| 405 |
match self { |
| 406 |
Self::Undefined => "SERVICE_SELECTOR_UNDEFINED", |
| 407 |
Self::All => "ALL", |
| 408 |
Self::Any => "ANY", |
| 409 |
Self::Exact => "EXACT", |
| 410 |
} |
| 411 |
} |
| 412 |
/// Creates an enum from field names used in the ProtoBuf definition. |
| 413 |
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> { |
| 414 |
match value { |
| 415 |
"SERVICE_SELECTOR_UNDEFINED" => Some(Self::Undefined), |
| 416 |
"ALL" => Some(Self::All), |
| 417 |
"ANY" => Some(Self::Any), |
| 418 |
"EXACT" => Some(Self::Exact), |
| 419 |
_ => None, |
| 420 |
} |
| 421 |
} |
| 422 |
} |