From cba8cf5e593d23ef90bddda8d5b71c3c14467bf3 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 18 Apr 2024 16:22:52 -0700 Subject: [PATCH 01/10] openapi: mark object as actually base64 Signed-off-by: William Woodruff --- openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi.yaml b/openapi.yaml index 1a8a7c145..61b6d519c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -458,6 +458,7 @@ definitions: body: type: object additionalProperties: true + format: byte integratedTime: type: integer description: The time the entry was added to the log as a Unix timestamp in seconds From a54a6f1c236ed5713b19140aa63f13b34e1b4a72 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 18 Apr 2024 16:38:37 -0700 Subject: [PATCH 02/10] generated: regen embedded_spec.go Signed-off-by: William Woodruff --- pkg/generated/restapi/embedded_spec.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/generated/restapi/embedded_spec.go b/pkg/generated/restapi/embedded_spec.go index 234f9122c..572198dd4 100644 --- a/pkg/generated/restapi/embedded_spec.go +++ b/pkg/generated/restapi/embedded_spec.go @@ -482,6 +482,7 @@ func init() { }, "body": { "type": "object", + "format": "byte", "additionalProperties": true }, "integratedTime": { @@ -2375,6 +2376,7 @@ func init() { }, "body": { "type": "object", + "format": "byte", "additionalProperties": true }, "integratedTime": { From 5b4eba2d9ca7e2800efbdd57d40b6ec01abaa9a0 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:08:35 -0700 Subject: [PATCH 03/10] hashedrekord: fix $id Signed-off-by: William Woodruff --- pkg/types/hashedrekord/v0.0.1/hashedrekord_v0_0_1_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/types/hashedrekord/v0.0.1/hashedrekord_v0_0_1_schema.json b/pkg/types/hashedrekord/v0.0.1/hashedrekord_v0_0_1_schema.json index 576071ed8..47cbac0e8 100644 --- a/pkg/types/hashedrekord/v0.0.1/hashedrekord_v0_0_1_schema.json +++ b/pkg/types/hashedrekord/v0.0.1/hashedrekord_v0_0_1_schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://rekor.sigstore.dev/types/rekord/rekord_v0_0_1_schema.json", + "$id": "http://rekor.sigstore.dev/types/rekord/hashedrekord_v0_0_1_schema.json", "title": "Hashed Rekor v0.0.1 Schema", "description": "Schema for Hashed Rekord object", "type": "object", From 64ca6cb3e0b1c54ec57891ee382597fa534aa657 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:14:25 -0700 Subject: [PATCH 04/10] fix types, regenerate Go files Signed-off-by: William Woodruff --- openapi.yaml | 6 ++---- pkg/generated/models/log_entry.go | 23 +++++++++++++++++++---- pkg/generated/restapi/embedded_spec.go | 13 +++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 61b6d519c..7ff6fd256 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -456,9 +456,9 @@ definitions: type: integer minimum: 0 body: - type: object + type: string additionalProperties: true - format: byte + description: The base64-encoded proposed log entry integratedTime: type: integer description: The time the entry was added to the log as a Unix timestamp in seconds @@ -467,8 +467,6 @@ definitions: properties: data: format: byte - - format: byte verification: type: object properties: diff --git a/pkg/generated/models/log_entry.go b/pkg/generated/models/log_entry.go index ee32ded41..746bf4917 100644 --- a/pkg/generated/models/log_entry.go +++ b/pkg/generated/models/log_entry.go @@ -91,9 +91,9 @@ type LogEntryAnon struct { // attestation Attestation *LogEntryAnonAttestation `json:"attestation,omitempty"` - // body + // The base64-encoded proposed log entry // Required: true - Body interface{} `json:"body"` + Body string `json:"body"` // The time the entry was added to the log as a Unix timestamp in seconds // Required: true @@ -168,8 +168,23 @@ func (m *LogEntryAnon) validateAttestation(formats strfmt.Registry) error { func (m *LogEntryAnon) validateBody(formats strfmt.Registry) error { - if m.Body == nil { - return errors.Required("body", "body", nil) + if err := validate.Required("body", "body", m.Body.BodyAdditionalProperties); err != nil { + return err + } + + if err := validate.Required("body", "body", m.Body.BodyAdditionalProperties); err != nil { + return err + } + + if m.Body.BodyAdditionalProperties != nil { + if err := m.Body.BodyAdditionalProperties.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body") + } + return err + } } return nil diff --git a/pkg/generated/restapi/embedded_spec.go b/pkg/generated/restapi/embedded_spec.go index 572198dd4..07787198b 100644 --- a/pkg/generated/restapi/embedded_spec.go +++ b/pkg/generated/restapi/embedded_spec.go @@ -473,7 +473,6 @@ func init() { "properties": { "attestation": { "type": "object", - "format": "byte", "properties": { "data": { "format": "byte" @@ -481,8 +480,8 @@ func init() { } }, "body": { - "type": "object", - "format": "byte", + "description": "The base64-encoded proposed log entry", + "type": "string", "additionalProperties": true }, "integratedTime": { @@ -2367,7 +2366,6 @@ func init() { "properties": { "attestation": { "type": "object", - "format": "byte", "properties": { "data": { "format": "byte" @@ -2375,8 +2373,8 @@ func init() { } }, "body": { - "type": "object", - "format": "byte", + "description": "The base64-encoded proposed log entry", + "type": "string", "additionalProperties": true }, "integratedTime": { @@ -2409,7 +2407,6 @@ func init() { }, "LogEntryAnonAttestation": { "type": "object", - "format": "byte", "properties": { "data": { "format": "byte" @@ -3304,7 +3301,7 @@ func init() { } }, "$schema": "http://json-schema.org/draft-07/schema", - "$id": "http://rekor.sigstore.dev/types/rekord/rekord_v0_0_1_schema.json" + "$id": "http://rekor.sigstore.dev/types/rekord/hashedrekord_v0_0_1_schema.json" }, "helm": { "description": "Helm chart", From 5f93d5e193713108c171123b473fe5b6816a09d1 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:17:37 -0700 Subject: [PATCH 05/10] remove additionalProperties Signed-off-by: William Woodruff --- openapi.yaml | 1 - pkg/generated/models/log_entry.go | 19 ++----------------- pkg/generated/restapi/embedded_spec.go | 6 ++---- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 7ff6fd256..43318fec5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -457,7 +457,6 @@ definitions: minimum: 0 body: type: string - additionalProperties: true description: The base64-encoded proposed log entry integratedTime: type: integer diff --git a/pkg/generated/models/log_entry.go b/pkg/generated/models/log_entry.go index 746bf4917..c4bfaaf24 100644 --- a/pkg/generated/models/log_entry.go +++ b/pkg/generated/models/log_entry.go @@ -93,7 +93,7 @@ type LogEntryAnon struct { // The base64-encoded proposed log entry // Required: true - Body string `json:"body"` + Body *string `json:"body"` // The time the entry was added to the log as a Unix timestamp in seconds // Required: true @@ -168,25 +168,10 @@ func (m *LogEntryAnon) validateAttestation(formats strfmt.Registry) error { func (m *LogEntryAnon) validateBody(formats strfmt.Registry) error { - if err := validate.Required("body", "body", m.Body.BodyAdditionalProperties); err != nil { + if err := validate.Required("body", "body", m.Body); err != nil { return err } - if err := validate.Required("body", "body", m.Body.BodyAdditionalProperties); err != nil { - return err - } - - if m.Body.BodyAdditionalProperties != nil { - if err := m.Body.BodyAdditionalProperties.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body") - } - return err - } - } - return nil } diff --git a/pkg/generated/restapi/embedded_spec.go b/pkg/generated/restapi/embedded_spec.go index 07787198b..446f697e0 100644 --- a/pkg/generated/restapi/embedded_spec.go +++ b/pkg/generated/restapi/embedded_spec.go @@ -481,8 +481,7 @@ func init() { }, "body": { "description": "The base64-encoded proposed log entry", - "type": "string", - "additionalProperties": true + "type": "string" }, "integratedTime": { "description": "The time the entry was added to the log as a Unix timestamp in seconds", @@ -2374,8 +2373,7 @@ func init() { }, "body": { "description": "The base64-encoded proposed log entry", - "type": "string", - "additionalProperties": true + "type": "string" }, "integratedTime": { "description": "The time the entry was added to the log as a Unix timestamp in seconds", From d04848d00a0e97bf7cedf627cda37815d99a3fa1 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:26:49 -0700 Subject: [PATCH 06/10] cmd, pkg: propagate openapi changes Signed-off-by: William Woodruff --- cmd/rekor-cli/app/get.go | 2 +- pkg/api/entries.go | 7 +++++-- pkg/tle/tle.go | 16 ++++------------ pkg/verify/verify.go | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/cmd/rekor-cli/app/get.go b/cmd/rekor-cli/app/get.go index 20246aa42..ccfab7926 100644 --- a/cmd/rekor-cli/app/get.go +++ b/cmd/rekor-cli/app/get.go @@ -208,7 +208,7 @@ func parseEntry(uuid string, e models.LogEntryAnon) (interface{}, error) { return tle.GenerateTransparencyLogEntry(e) } - b, err := base64.StdEncoding.DecodeString(e.Body.(string)) + b, err := base64.StdEncoding.DecodeString(*e.Body) if err != nil { return nil, err } diff --git a/pkg/api/entries.go b/pkg/api/entries.go index 349725f2d..4b945138a 100644 --- a/pkg/api/entries.go +++ b/pkg/api/entries.go @@ -18,6 +18,7 @@ package api import ( "bytes" "context" + "encoding/base64" "encoding/hex" "errors" "fmt" @@ -88,10 +89,11 @@ func logEntryFromLeaf(ctx context.Context, signer signature.Signer, _ trilliancl } virtualIndex := sharding.VirtualLogIndex(leaf.GetLeafIndex(), tid, ranges) + leafValue := base64.StdEncoding.EncodeToString(leaf.LeafValue) logEntryAnon := models.LogEntryAnon{ LogID: swag.String(api.pubkeyHash), LogIndex: &virtualIndex, - Body: leaf.LeafValue, + Body: &leafValue, IntegratedTime: swag.Int64(leaf.IntegrateTimestamp.AsTime().Unix()), } @@ -239,10 +241,11 @@ func createLogEntry(params entries.CreateLogEntryParams) (models.LogEntry, middl // The log index should be the virtual log index across all shards virtualIndex := sharding.VirtualLogIndex(queuedLeaf.LeafIndex, api.logRanges.ActiveTreeID(), api.logRanges) + leafValue := base64.StdEncoding.EncodeToString(queuedLeaf.GetLeafValue()) logEntryAnon := models.LogEntryAnon{ LogID: swag.String(api.pubkeyHash), LogIndex: swag.Int64(virtualIndex), - Body: queuedLeaf.GetLeafValue(), + Body: &leafValue, IntegratedTime: swag.Int64(queuedLeaf.IntegrateTimestamp.AsTime().Unix()), } diff --git a/pkg/tle/tle.go b/pkg/tle/tle.go index 2e51f5bcc..f0fe8dedb 100644 --- a/pkg/tle/tle.go +++ b/pkg/tle/tle.go @@ -50,20 +50,12 @@ func GenerateTransparencyLogEntry(anon models.LogEntryAnon) (*rekor_pb.Transpare inclusionProofHashes[i] = hashBytes } - // Different call paths may supply string or []byte. If string, it is base64 encoded. var body []byte - switch v := anon.Body.(type) { - case string: - b, err := base64.StdEncoding.DecodeString(v) - if err != nil { - return nil, fmt.Errorf("base64 decoding body: %w", err) - } - body = b - case []byte: - body = v - default: - return nil, fmt.Errorf("body is not string or []byte: (%T)%v", v, v) + b, err := base64.StdEncoding.DecodeString(*anon.Body) + if err != nil { + return nil, fmt.Errorf("base64 decoding body: %w", err) } + body = b pe, err := models.UnmarshalProposedEntry(bytes.NewReader(body), runtime.JSONConsumer()) if err != nil { diff --git a/pkg/verify/verify.go b/pkg/verify/verify.go index 7b519b58e..9baf00ac0 100644 --- a/pkg/verify/verify.go +++ b/pkg/verify/verify.go @@ -155,7 +155,7 @@ func VerifyInclusion(ctx context.Context, e *models.LogEntryAnon) error { } // Verify the inclusion proof. - entryBytes, err := base64.StdEncoding.DecodeString(e.Body.(string)) + entryBytes, err := base64.StdEncoding.DecodeString(*e.Body) if err != nil { return err } From 6af67be641b0ebd848931613aa41646b74a9b13e Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:30:59 -0700 Subject: [PATCH 07/10] more type persuasion Signed-off-by: William Woodruff --- cmd/backfill-redis/main.go | 2 +- pkg/tle/tle_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/backfill-redis/main.go b/cmd/backfill-redis/main.go index a443c0505..7912ed036 100644 --- a/cmd/backfill-redis/main.go +++ b/cmd/backfill-redis/main.go @@ -153,7 +153,7 @@ func main() { var insertErrs []error for uuid, entry := range resp.Payload { // uuid is the global UUID - tree ID and entry UUID - e, _, _, err := unmarshalEntryImpl(entry.Body.(string)) + e, _, _, err := unmarshalEntryImpl(*entry.Body) if err != nil { parseErrs = append(parseErrs, fmt.Errorf("error unmarshalling entry for %s: %w", uuid, err)) continue diff --git a/pkg/tle/tle_test.go b/pkg/tle/tle_test.go index 64a9b5787..b31f75221 100644 --- a/pkg/tle/tle_test.go +++ b/pkg/tle/tle_test.go @@ -48,7 +48,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "valid entry", expectSuccess: true, proposedEntry: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI2MmQwOGYyOGM2OWNhZGE3YjQyYTQ1Nzk0YjQ3ZWU2YzgxYTdkZmE3MTY4NDZiMzljODhmMGFkMTljMjA2OTk3In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQm14U0N1TW1HSzhNQWRMd1FWZ21TZjVXKzlkdU5iQXN1cUNQNlNucUxCUkFpRUFvNGtGRVdDTG9HcTVUaysrUEhtTEgrb3N1emVTRjN4OTdBbmVicTRlbVRvPSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUk1ha05EUVhKVFowRjNTVUpCWjBsVVRWQkRlVXdyYmxOb2MycHdaa2hZYUZkYVRVWkNUVUZIUlVSQlMwSm5aM0ZvYTJwUFVGRlJSRUY2UVhFS1RWSlZkMFYzV1VSV1VWRkxSWGQ0ZW1GWFpIcGtSemw1V2xNMWExcFlXWGhGVkVGUVFtZE9Wa0pCVFZSRFNFNXdXak5PTUdJelNteE5RalJZUkZSSm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UXA2ZVdzOUNpMHRMUzB0UlU1RUlFTkZVbFJKUmtsRFFWUkZMUzB0TFMwSyJ9fX19"), IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(2), @@ -92,7 +92,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "body is not valid base64", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "not_base_64", + Body: swag.String("not_base_64"), IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(1), @@ -112,7 +112,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "logID is not valid hex", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI2MmQwOGYyOGM2OWNhZGE3YjQyYTQ1Nzk0YjQ3ZWU2YzgxYTdkZmE3MTY4NDZiMzljODhmMGFkMTljMjA2OTk3In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQm14U0N1TW1HSzhNQWRMd1FWZ21TZjVXKzlkdU5iQXN1cUNQNlNucUxCUkFpRUFvNGtGRVdDTG9HcTVUaysrUEhtTEgrb3N1emVTRjN4OTdBbmVicTRlbVRvPSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUk1ha05EUVhKVFowRjNTVUpCWjBsVVRWQkRlVXdyYmxOb2MycHdaa2hZYUZkYVRVWkNUVUZIUlVSQlMwSm5aM0ZvYTJwUFVGRlJSRUY2UVhFS1RWSlZkMFYzV1VSV1VWRkxSWGQ0ZW1GWFpIcGtSemw1V2xNMWExcFlXWGhGVkVGUVFtZE9Wa0pCVFZSRFNFNXdXak5PTUdJelNteE5RalJZU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EVjRkUXA2ZVdzOUNpMHRMUzB0UlU1RUlFTkZVbFJKUmtsRFFWUkZMUzB0TFMwSyJ9fX19"), IntegratedTime: swag.Int64(123), LogID: swag.String("not_valid_hex"), LogIndex: swag.Int64(1), @@ -132,7 +132,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "rootHash is not valid hex", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI2MmQwOGYyOGM2OWNhZGE3YjQyYTQ1Nzk0YjQ3ZWU2YzgxYTdkZmE3MTY4NDZiMzljODhmMGFkMTljMjA2OTk3In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQm14U0N1TW1HSzhNQWRMd1FWZ21TZjVXKzlkdU5iQXN1cUNQNlNucUxCUkFpRUFvNGtGRVdDTG9HcTVUaysrUEhtTEgrb3N1emVTRjN4OTdBbmVicTRlbVRvPSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUk1ha05EUVhKVFowRjNTVUpCWjBsVVRWQkRlVXdyYmxOb2MycHdaa2hZYUZkYVRVWkNUVUZIUlVSQlMwSm5aM0ZvYTJwUFVGRlJSRUY2UVhFS1RWSlZkMFYzV1VSV1VWRkxSWGQ0ZW1GWFpIcGtSemw1V2xNMWExcFlXWGhGVkVGUVFtZE9Wa0pCVFZSRFNFNXdXak5PTUdJelNteE5RalJZUkZSSmVRcE5SRWwzVFdwRmQwNUVXWGhOVm05WVJGUkplVTFFU1hkTmFrVjNUbFJaZUUxR2IzZEZla1ZTVFVFNFIwRXhWVVZEYUUxSll6SnNibU16VW5aamJWVjNDbGRVUVZSQ1oyTnhhR3RxVDFCUlNVS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Q21KWFJuQmlhVFUxWWxkNFFXTnRWbTFqZVRsdldsZEdhMk41T1hSWldFNHdXbGhKZDBWbldVdExkMWxDUWtGSFJIWjZRVUpCWjFGRlkwaFdlbUZFUVcwS1FtZHZja0puUlVWQldVOHZUVUZGUmtKQ2FISlpiazR3VEROU2JHTnVTbWhhYlRsNVlsTXhjbVJYU214ak0xSm9XVEp6ZDA1bldVdExkMWxDUWtGSFJBcDJla0ZDUVhkUmIxcHFSVEZPVjFGNVdXMUplRTU2V210TlZFVTFXV3BHYlU5VVNUSk9WRlV6V1hwTk5WbDZTbWxQVkdzMVdtcFNhRnBxWjNkWmVrRTFDa0puYjNKQ1owVkZRVmxQTDAxQlJVSkNRM1J2WkVoU2QyTjZiM1pNTTFKMllUSldkVXh0Um1wa1IyeDJZbTVOZFZveWJEQmhTRlpwWkZoT2JHTnRUbllLWW01U2JHSnVVWFZaTWpsMFRVSTRSME5wYzBkQlVWRkNaemM0ZDBGUldVVkZXRXBzV201TmRtRkhWbWhhU0UxMllsZEdlbVJIVm5sTlEwRkhRMmx6UndwQlVWRkNaemM0ZDBGUlVVVkZhMG94WVZkNGEwbEdVbXhqTTFGblZVaFdhV0pIYkhwaFJFRkxRbWRuY1docmFrOVFVVkZFUVhkT2IwRkVRbXhCYWtWQkNtdDJORTFLYUdGRGFFMUJaMHBWVTNWWll6bFBWRWt3WTB0bU9XTnlObU14Y1RreVYyOXFMM1ZsV0RKRFR6Z3JMMDQyU25SM1FVNTRVSElyTjNWNlpGQUtRV3BDYVhwR2NHZEVMelJzWW5aa1NuRnplWE5HYlVSeU1TdFNNSGhKWjI1S1N5c3JaWGROYmtKaVMxQkVMemd3VTNJelFYTTVMMWxxV1U5M05EVjRkUXA2ZVdzOUNpMHRMUzB0UlU1RUlFTkZVbFJKUmtsRFFWUkZMUzB0TFMwSyJ9fX19"), IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(1), @@ -152,7 +152,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "one inclusion proof hash is not valid hex", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI2MmQwOGYyOGM2OWNhZGE3YjQyYTQ1Nzk0YjQ3ZWU2YzgxYTdkZmE3MTY4NDZiMzljODhmMGFkMTljMjA2OTk3In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQm14U0N1TW1HSzhNQWRMd1FWZ21TZjVXKzlkdU5iQXN1cUNQNlNucUxCUkFpRUFvNGtGRVdDTG9HcTVUaysrUEhtTEgrb3N1emVTRjN4OTdBbmVicTRlbVRvPSIsInB1YmxpY0tleSI6eyJjb250ZW50IjoiTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVUk1ha05EUVhKVFowRjNTVUpCWjBsVVRWQkRlVXdyYmxOb2MycHdaa2hZYUZkYVRVWkNUVUZIUlVSQlMwSm5aM0ZvYTJwUFVGRlJSRUY2UVhFS1RWSlZkMFYzV1VSV1VWRkxSWGQ0ZW1GWFpIcGtSemw1V2xNMWExcFlXWGhGVkVGUVFtZE9Wa0pCVFZSRFNFNXdXak5PTUdJelNteE5RalJZUkZSSmVRcE5SRWwzVFdwRmQwNUVXWGhOVm05WVJGUkplVTFFU1hkTmFrVjNUbFJaZUUxR2IzZEZla1ZTVFVFNFIwRXhWVVZEYUUxSll6SnNibU16VW5aamJWVjNDbGRVUVZSQ1oyTnhhR3RxVDFCUlNVSkNaMmR4YUd0cVQxQlJUVUpDZDA1RFFVRlVVMVJ2VEhWS2N5OTFSV05IU2tRME5VWmFiVE5wWmxKTU4yOXVRVWNLWlZaNWJuWkhVbmN6WnpKMU0wbFhTREZuU2tSamNERjRSWFI2UVZCUWJYQmhlV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ISlpiazR3VEROU2JHTnVTbWhhYlRsNVlsTXhjbVJYU214ak0xSm9XVEp6ZDA1bldVdExkMWxDUWtGSFJBcDJla0ZDUVhkUmIxcHFSVEZPVjFGNVdXMUplRTU2V210TlZFVTFXV3BHYlU5VVNUSk9WRlV6V1hwTk5WbDZTbWxQVkdzMVdtcFNhRnBxWjNkWmVrRTFDa0puYjNKQ1owVkZRVmxQTDAxQlJVSkNRM1J2WkVoU2QyTjZiM1pNTTFKMllUSldkVXh0Um1wa1IyeDJZbTVOZFZveWJEQmhTRlpwWkZoT2JHTnRUbllLWW01U2JHSnVVWFZaTWpsMFRVSTRSME5wYzBkQlVWRkNaemM0ZDBGUldVVkZXRXBzV201TmRtRkhWbWhhU0UxMllsZEdlbVJIVm5sTlEwRkhRMmx6UndwQlVWRkNaemM0ZDBGUlVVVkZhMG94WVZkNGEwbEdVbXhqTTFGblZVaFdhV0pIYkhwaFJFRkxRbWRuY1docmFrOVFVVkZFUVhkT2IwRkVRbXhCYWtWQkNtdDJORTFLYUdGRGFFMUJaMHBWVTNWWll6bFBWRWt3WTB0bU9XTnlObU14Y1RreVYyOXFMM1ZsV0RKRFR6Z3JMMDQyU25SM1FVNTRVSElyTjNWNlpGQUtRV3BDYVhwR2NHZEVMelJzWW5aa1NuRnplWE5HYlVSeU1TdFNNSGhKWjI1S1N5c3JaWGROYmtKaVMxQkVMemd3VTNJelFYTTVMMWxxV1U5M05EVjRkUXA2ZVdzOUNpMHRMUzB0UlU1RUlFTkZVbFJKUmtsRFFWUkZMUzB0TFMwSyJ9fX19"), IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(1), @@ -172,7 +172,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "body is valid base64 but not valid entry", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "aW52YWxpZF9lbnRyeQo=", // "invalid_entry" + Body: swag.String("aW52YWxpZF9lbnRyeQo=", // "invalid_entry)" IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(1), @@ -192,7 +192,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "kind/version are valid but spec is not schema valid", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoiaGFzaGVkcmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7ImhhcyI6eyJhbGdvcml0aG0iOiJzaGEyNTYiLCJ2YWx1ZSI6IjYyZDA4ZjI4YzY5Y2FkYTdiNDJhNDU3OTRiNDdlZTZjODFhN2RmYTcxNjg0NmIzOWM4OGYwYWQxOWMyMDY5OTcifX0sInNpZ25hdHVyZSI6eyJjb250ZW50IjoiTUVVQ0lCbXhTQ3VNbUdLOE1BZEx3UVZnbVNmNVcrOWR1TmJBc3VxQ1A2U25xTEJSQWlFQW80a0ZFV0NMb0dxNVRrKytQSG1MSCtvc3V6ZVNGM3g5N0FuZWJxNGVtVG89IiwicHVibGljS2V5Ijp7ImNvbnRlbnQiOiJMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VSTWFrTkRRWEpUWjBGM1NVSkJaMGxVVFZCRGVVd3JibE5vYzJwd1praFlhRmRhVFVaQ1RVRkhSVVJCUzBKblozRm9hMnBQVUZGUlJFRjZRWEVLVFZKVmQwVjNXVVJXVVZGTFJYZDRlbUZYWkhwa1J6bDVXbE0xYTFwWVdYaEZWRUZRUW1kT1ZrSkJUVlJEU0U1d1dqTk9NR0l6U214TlFqUllSRlJKZVFwTlJFbDNUV3BGZDA1RVdYaE5WbTlZUkZSSmVVMUVTWGROYWtWM1RsUlplRTFHYjNkRmVrVlNUVUU0UjBFeFZVVkRhRTFKWXpKc2JtTXpVblpqYlZWM0NsZFVRVlJDWjJOeGFHdHFUMUJSU1VKQ1oyZHhhR3RxVDFCUlRVSkNkMDVEUVVGVVUxUnZUSFZLY3k5MVJXTkhTa1EwTlVaYW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2a978b2ce9523323b43e90a3f Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:32:57 -0700 Subject: [PATCH 08/10] tle_test: syntax Signed-off-by: William Woodruff --- pkg/tle/tle_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tle/tle_test.go b/pkg/tle/tle_test.go index b31f75221..0c9b47111 100644 --- a/pkg/tle/tle_test.go +++ b/pkg/tle/tle_test.go @@ -172,7 +172,7 @@ func TestGenerateTransparencyLogEntry(t *testing.T) { description: "body is valid base64 but not valid entry", expectSuccess: false, proposedEntry: models.LogEntryAnon{ - Body: swag.String("aW52YWxpZF9lbnRyeQo=", // "invalid_entry)" + Body: swag.String("aW52YWxpZF9lbnRyeQo="), // "invalid_entry" IntegratedTime: swag.Int64(123), LogID: swag.String("deadbeef"), LogIndex: swag.Int64(1), From 2e097557a947bb7ab947966096f681e8325ed7ba Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 10:36:20 -0700 Subject: [PATCH 09/10] verify_test: more type fixes Signed-off-by: William Woodruff --- pkg/verify/verify_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/verify/verify_test.go b/pkg/verify/verify_test.go index eae1c6775..7d88cc3c1 100644 --- a/pkg/verify/verify_test.go +++ b/pkg/verify/verify_test.go @@ -189,7 +189,7 @@ func TestInclusion(t *testing.T) { { name: "valid inclusion", e: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA2MjNkOTdiMWQ4In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUUQvUGRQUW1LV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tbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19"), IntegratedTime: &time, LogID: &logID, LogIndex: swag.Int64(1), @@ -210,7 +210,7 @@ func TestInclusion(t *testing.T) { { name: "invalid inclusion - bad body hash", e: models.LogEntryAnon{ - Body: "ayJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA2MjNkOTdiMWQ4In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUUQvUGRQUW1LV0MxKzBCTkVkNWdLdlFHcjF4eGwzaWVVZmZ2M2prMXp6Skt3SWhBTEJqM3hmQXlXeGx6NGpwb0lFSVYxVWZLOXZua1VVT1NvZVp4QlpQSEtQQyIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQlFWVUpNU1VNZ1MwVlpMUzB0TFMwS1RVWnJkMFYzV1VoTGIxcEplbW93UTBGUldVbExiMXBKZW1vd1JFRlJZMFJSWjBGRlRVOWpWR1pTUWxNNWFtbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19", + Body: swag.String("ayJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA2MjNkOTdiMWQ4In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUUQvUGRQUW1LV0MxKzBCTkVkNWdLdlFHcjF4eGwzaWVVZmZ2M2prMXp6Skt3SWhBTEJqM3hmQXlXeGx6NGpwb0lFSVYxVWZLOXZua1VVT1NvZVp4QlpQSEtQQyIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQlFWVUpNU1VNZ1MwVlpMUzB0TFMwS1RVWnJkMFYzV1VoTGIxcEplbW93UTBGUldVbExiMXBKZW1vd1JFRlJZMFJSWjBGRlRVOWpWR1pTUWxNNWFtbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19"), IntegratedTime: &time, LogID: &logID, LogIndex: swag.Int64(1), @@ -268,7 +268,7 @@ func TestCheckpoint(t *testing.T) { { name: "valid checkpoint", e: models.LogEntryAnon{ - Body: "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA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1VoTGIxcEplbW93UTBGUldVbExiMXBKZW1vd1JFRlJZMFJSWjBGRlRVOWpWR1pTUWxNNWFtbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19"), IntegratedTime: &time, LogID: &logID, LogIndex: swag.Int64(1), @@ -290,7 +290,7 @@ func TestCheckpoint(t *testing.T) { { name: "root hash mismatch", e: models.LogEntryAnon{ - Body: "ayJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA2MjNkOTdiMWQ4In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUUQvUGRQUW1LV0MxKzBCTkVkNWdLdlFHcjF4eGwzaWVVZmZ2M2prMXp6Skt3SWhBTEJqM3hmQXlXeGx6NGpwb0lFSVYxVWZLOXZua1VVT1NvZVp4QlpQSEtQQyIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQlFWVUpNU1VNZ1MwVlpMUzB0TFMwS1RVWnJkMFYzV1VoTGIxcEplbW93UTBGUldVbExiMXBKZW1vd1JFRlJZMFJSWjBGRlRVOWpWR1pTUWxNNWFtbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19", + Body: swag.String("ayJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJlY2RjNTUzNmY3M2JkYWU4ODE2ZjBlYTQwNzI2ZWY1ZTliODEwZDkxNDQ5MzA3NTkwM2JiOTA2MjNkOTdiMWQ4In19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUUQvUGRQUW1LV0MxKzBCTkVkNWdLdlFHcjF4eGwzaWVVZmZ2M2prMXp6Skt3SWhBTEJqM3hmQXlXeGx6NGpwb0lFSVYxVWZLOXZua1VVT1NvZVp4QlpQSEtQQyIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQlFWVUpNU1VNZ1MwVlpMUzB0TFMwS1RVWnJkMFYzV1VoTGIxcEplbW93UTBGUldVbExiMXBKZW1vd1JFRlJZMFJSWjBGRlRVOWpWR1pTUWxNNWFtbFlUVGd4UmxvNFoyMHZNU3R2YldWTmR3cHRiaTh6TkRjdk5UVTJaeTlzY21sVE56SjFUV2haT1V4alZDczFWVW8yWmtkQ1oyeHlOVm80VERCS1RsTjFZWE41WldRNVQzUmhVblozUFQwS0xTMHRMUzFGVGtRZ1VGVkNURWxESUV0RldTMHRMUzB0Q2c9PSJ9fX19"), IntegratedTime: &time, LogID: &logID, LogIndex: swag.Int64(1), From 2377d733246b395361526e2e34b565ae26762ea9 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 19 Apr 2024 14:03:15 -0700 Subject: [PATCH 10/10] dsse/e2e_test: more type fixes Signed-off-by: William Woodruff --- pkg/types/dsse/v0.0.1/e2e_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/types/dsse/v0.0.1/e2e_test.go b/pkg/types/dsse/v0.0.1/e2e_test.go index 7bae657fa..f30d19588 100644 --- a/pkg/types/dsse/v0.0.1/e2e_test.go +++ b/pkg/types/dsse/v0.0.1/e2e_test.go @@ -341,7 +341,7 @@ func DecodeV001FromRekorResponse(t *testing.T, resp *entries.CreateLogEntryCreat t.Helper() for _, e := range resp.Payload { - b, err := base64.StdEncoding.DecodeString(e.Body.(string)) + b, err := base64.StdEncoding.DecodeString(*e.Body) if err != nil { t.Errorf("could not decode body into dsse type: %v", err) } @@ -700,7 +700,7 @@ func TestThreePublicKeysTwoSignatures(t *testing.T) { } for _, k := range resp.Payload { - b, err := base64.StdEncoding.DecodeString(k.Body.(string)) + b, err := base64.StdEncoding.DecodeString(*k.Body) if err != nil { t.Errorf("unexpected error returned from rekor: %v", err.Error()) }