Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop optional from PublicKey.raw_bytes #326

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
Comment on lines -158 to -162
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging: I don't fully understand this codegen change -- raw_bytes was originally marked explicitly with optional, so there absolutely should never have been a required variant to begin with.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is strange, what happens if you generate jsonschema from scratch before this change? Is required still present? Just wondering if this is stale or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if I re-generate before this change the required comes back. My only guess here is that because it's wrapped within a oneOf, it has no effect (since it's still optional under the other oneOf variants).

{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/ClientTrustConfig.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/Input.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/PublicKey.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/PublicKeyIdentities.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/TransparencyLogInstance.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
5 changes: 0 additions & 5 deletions gen/jsonschema/schemas/TrustedRoot.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@
"additionalProperties": false,
"type": "object",
"oneOf": [
{
"required": [
"raw_bytes"
]
},
{
"required": [
"valid_for"
Expand Down
219 changes: 109 additions & 110 deletions gen/pb-go/common/v1/sigstore_common.pb.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/pb-ruby/lib/sigstore_common_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ pub struct Rfc3161SignedTimestamp {
pub struct PublicKey {
/// DER-encoded public key, encoding method is specified by the
/// key_details attribute.
#[prost(bytes = "vec", optional, tag = "1")]
pub raw_bytes: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(bytes = "vec", tag = "1")]
pub raw_bytes: ::prost::alloc::vec::Vec<u8>,
/// Key encoding and signature algorithm to use for this key.
#[prost(enumeration = "PublicKeyDetails", tag = "2")]
pub key_details: i32,
Expand Down
Binary file not shown.
10 changes: 4 additions & 6 deletions gen/pb-typescript/src/__generated__/sigstore_common.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/sigstore_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ message RFC3161SignedTimestamp {
message PublicKey {
// DER-encoded public key, encoding method is specified by the
// key_details attribute.
optional bytes raw_bytes = 1;
bytes raw_bytes = 1 [(google.api.field_behavior) = REQUIRED];
// Key encoding and signature algorithm to use for this key.
PublicKeyDetails key_details = 2;
// Optional validity period for this key, *inclusive* of the endpoints.
Expand Down
Loading