Skip to content

Commit

Permalink
remove extradata field from types (#418)
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway authored Aug 20, 2021
1 parent ada00fe commit 775f38b
Show file tree
Hide file tree
Showing 30 changed files with 0 additions and 224 deletions.
3 changes: 0 additions & 3 deletions pkg/generated/models/alpine_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/helm_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/intoto_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/jar_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/rekord_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/rfc3161_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/rpm_v001_schema.go

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

3 changes: 0 additions & 3 deletions pkg/generated/models/tuf_v001_schema.go

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

40 changes: 0 additions & 40 deletions pkg/generated/restapi/embedded_spec.go

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

5 changes: 0 additions & 5 deletions pkg/types/alpine/v0.0.1/alpine_v0_0_1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
"required": [ "content" ]
}
]
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
}
},
"required": [ "publicKey", "package" ]
Expand Down
4 changes: 0 additions & 4 deletions pkg/types/alpine/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}

canonicalEntry := models.AlpineV001Schema{}
canonicalEntry.ExtraData = v.AlpineModel.ExtraData

var err error

Expand All @@ -301,9 +300,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
// set .PKGINFO headers
canonicalEntry.Package.Pkginfo = v.apkObj.Pkginfo

// ExtraData is copied through unfiltered
canonicalEntry.ExtraData = v.AlpineModel.ExtraData

// wrap in valid object with kind and apiVersion set
apk := models.Alpine{}
apk.APIVersion = swag.String(APIVERSION)
Expand Down
17 changes: 0 additions & 17 deletions pkg/types/alpine/v0.0.1/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,23 +346,6 @@ func TestCrossFieldValidation(t *testing.T) {
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: true,
},
{
caseDesc: "valid obj with extradata",
entry: V001Entry{
AlpineModel: models.AlpineV001Schema{
PublicKey: &models.AlpineV001SchemaPublicKey{
Content: strfmt.Base64(keyBytes),
},
Package: &models.AlpineV001SchemaPackage{
Content: strfmt.Base64(dataBytes),
},
ExtraData: []byte("{\"something\": \"here\""),
},
},
hasExtEntities: false,
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: true,
},
}

for _, tc := range testCases {
Expand Down
1 change: 0 additions & 1 deletion pkg/types/helm/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}

canonicalEntry := models.HelmV001Schema{}
canonicalEntry.ExtraData = v.HelmObj.ExtraData

var err error

Expand Down
5 changes: 0 additions & 5 deletions pkg/types/helm/v0.0.1/helm_v0_0_1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@
}
},
"required": [ "provenance" ]
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
}
},
"required": [
Expand Down
5 changes: 0 additions & 5 deletions pkg/types/intoto/v0.0.1/intoto_v0_0_1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
"description": "The public key that can verify the signature",
"type": "string",
"format": "byte"
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
}
},
"required": [
Expand Down
4 changes: 0 additions & 4 deletions pkg/types/jar/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}

canonicalEntry := models.JarV001Schema{}
canonicalEntry.ExtraData = v.JARModel.ExtraData

var err error
// need to canonicalize key content
Expand All @@ -248,9 +247,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
canonicalEntry.Archive.Hash.Value = v.JARModel.Archive.Hash.Value
// archive content is not set deliberately

// ExtraData is copied through unfiltered
canonicalEntry.ExtraData = v.JARModel.ExtraData

// wrap in valid object with kind and apiVersion set
jar := models.Jar{}
jar.APIVersion = swag.String(APIVERSION)
Expand Down
14 changes: 0 additions & 14 deletions pkg/types/jar/v0.0.1/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,6 @@ func TestCrossFieldValidation(t *testing.T) {
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: false,
},
{
caseDesc: "valid obj with extradata",
entry: V001Entry{
JARModel: models.JarV001Schema{
Archive: &models.JarV001SchemaArchive{
Content: strfmt.Base64(jarBytes),
},
ExtraData: []byte("{\"something\": \"here\""),
},
},
hasExtEntities: false,
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: true,
},
}

for _, tc := range testCases {
Expand Down
5 changes: 0 additions & 5 deletions pkg/types/jar/v0.0.1/jar_v0_0_1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@
"required": [ "content" ]
}
]
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
}
},
"required": [ "archive" ]
Expand Down
4 changes: 0 additions & 4 deletions pkg/types/rekord/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}

canonicalEntry := models.RekordV001Schema{}
canonicalEntry.ExtraData = v.RekordObj.ExtraData

// need to canonicalize signature & key content
canonicalEntry.Signature = &models.RekordV001SchemaSignature{}
Expand All @@ -331,9 +330,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
canonicalEntry.Data.Hash = v.RekordObj.Data.Hash
// data content is not set deliberately

// ExtraData is copied through unfiltered
canonicalEntry.ExtraData = v.RekordObj.ExtraData

// wrap in valid object with kind and apiVersion set
rekordObj := models.Rekord{}
rekordObj.APIVersion = swag.String(APIVERSION)
Expand Down
21 changes: 0 additions & 21 deletions pkg/types/rekord/v0.0.1/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,27 +498,6 @@ func TestCrossFieldValidation(t *testing.T) {
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: true,
},
{
caseDesc: "valid obj with extradata",
entry: V001Entry{
RekordObj: models.RekordV001Schema{
Signature: &models.RekordV001SchemaSignature{
Format: "pgp",
Content: strfmt.Base64(sigBytes),
PublicKey: &models.RekordV001SchemaSignaturePublicKey{
Content: strfmt.Base64(keyBytes),
},
},
Data: &models.RekordV001SchemaData{
Content: strfmt.Base64(dataBytes),
},
ExtraData: []byte("{\"something\": \"here\""),
},
},
hasExtEntities: false,
expectUnmarshalSuccess: true,
expectCanonicalizeSuccess: true,
},
}

for _, tc := range testCases {
Expand Down
5 changes: 0 additions & 5 deletions pkg/types/rekord/v0.0.1/rekord_v0_0_1_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@
"required": [ "content" ]
}
]
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
}
},
"required": [ "signature", "data" ]
Expand Down
3 changes: 0 additions & 3 deletions pkg/types/rfc3161/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
},
}

// ExtraData is copied through unfiltered
canonicalEntry.ExtraData = v.Rfc3161Obj.ExtraData

// wrap in valid object with kind and apiVersion set
ref3161Obj := models.Rfc3161{}
ref3161Obj.APIVersion = swag.String(APIVERSION)
Expand Down
Loading

0 comments on commit 775f38b

Please sign in to comment.