| 1 |
// Copyright 2025 The Sigstore Authors |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
package dev.sigstore.rekor.v2; |
| 17 |
|
| 18 |
import "google/api/field_behavior.proto"; |
| 19 |
|
| 20 |
import "rekor/v2/dsse.proto"; |
| 21 |
import "rekor/v2/hashedrekord.proto"; |
| 22 |
|
| 23 |
option go_package = "github.com/sigstore/protobuf-specs/gen/pb-go/rekor/v2"; |
| 24 |
|
| 25 |
option java_package = "dev.sigstore.proto.rekor.v2"; |
| 26 |
option java_multiple_files = true; |
| 27 |
option java_outer_classname = "RekorV2Entry"; |
| 28 |
option ruby_package = "Sigstore::Rekor::V2"; |
| 29 |
|
| 30 |
// Entry is the message that is canonicalized and uploaded to the log. |
| 31 |
// This format is meant to be compliant with Rekor v1 entries in that |
| 32 |
// the `apiVersion` and `kind` can be parsed before parsing the spec. |
| 33 |
// Clients are expected to understand and handle the differences in the |
| 34 |
// contents of `spec` between Rekor v1 (a polymorphic OpenAPI defintion) |
| 35 |
// and Rekor v2 (a typed proto defintion). |
| 36 |
message Entry { |
| 37 |
string kind = 1 [(google.api.field_behavior) = REQUIRED]; |
| 38 |
string api_version = 2 [(google.api.field_behavior) = REQUIRED]; |
| 39 |
Spec spec = 3 [(google.api.field_behavior) = REQUIRED]; |
| 40 |
} |
| 41 |
|
| 42 |
// Spec contains one of the Rekor entry types. |
| 43 |
message Spec { |
| 44 |
oneof spec { |
| 45 |
HashedRekordLogEntryV002 hashed_rekord_v002 = 1 [(google.api.field_behavior) = REQUIRED]; |
| 46 |
DSSELogEntryV002 dsse_v002 = 2 [(google.api.field_behavior) = REQUIRED]; |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
// Create a new HashedRekord or DSSE |
| 51 |
message CreateEntryRequest { |
| 52 |
oneof spec { |
| 53 |
HashedRekordRequestV002 hashed_rekord_request_v002 = 1 [(google.api.field_behavior) = REQUIRED]; |
| 54 |
DSSERequestV002 dsse_request_v002 = 2 [(google.api.field_behavior) = REQUIRED]; |
| 55 |
} |
| 56 |
} |