Skip to content
Snippets Groups Projects
Unverified Commit 775f38b4 authored by Bob Callaway's avatar Bob Callaway Committed by GitHub
Browse files

remove extradata field from types (#418)

parent ada00fe2
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 149 deletions
......@@ -38,9 +38,6 @@ import (
// swagger:model alpineV001Schema
type AlpineV001Schema struct {
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// package
// Required: true
Package *AlpineV001SchemaPackage `json:"package"`
......
......@@ -42,9 +42,6 @@ type HelmV001Schema struct {
// Required: true
Chart *HelmV001SchemaChart `json:"chart"`
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// public key
// Required: true
PublicKey *HelmV001SchemaPublicKey `json:"publicKey"`
......
......@@ -42,9 +42,6 @@ type IntotoV001Schema struct {
// Required: true
Content *IntotoV001SchemaContent `json:"content"`
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// The public key that can verify the signature
// Required: true
// Format: byte
......
......@@ -42,9 +42,6 @@ type JarV001Schema struct {
// Required: true
Archive *JarV001SchemaArchive `json:"archive"`
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// signature
Signature *JarV001SchemaSignature `json:"signature,omitempty"`
}
......
......@@ -42,9 +42,6 @@ type RekordV001Schema struct {
// Required: true
Data *RekordV001SchemaData `json:"data"`
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// signature
// Required: true
Signature *RekordV001SchemaSignature `json:"signature"`
......
......@@ -37,9 +37,6 @@ import (
// swagger:model rfc3161V001Schema
type Rfc3161V001Schema struct {
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// tsr
// Required: true
Tsr *Rfc3161V001SchemaTsr `json:"tsr"`
......
......@@ -38,9 +38,6 @@ import (
// swagger:model rpmV001Schema
type RpmV001Schema struct {
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// package
// Required: true
Package *RpmV001SchemaPackage `json:"package"`
......
......@@ -37,9 +37,6 @@ import (
// swagger:model tufV001Schema
type TUFV001Schema struct {
// Arbitrary content to be included in the verifiable entry in the transparency log
ExtraData interface{} `json:"extraData,omitempty"`
// metadata
// Required: true
Metadata *TUFV001SchemaMetadata `json:"metadata"`
......
......@@ -2443,11 +2443,6 @@ func init() {
"package"
],
"properties": {
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"package": {
"description": "Information about the package associated with the entry",
"type": "object",
......@@ -2662,11 +2657,6 @@ func init() {
}
}
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"publicKey": {
"description": "The public key that can verify the package signature",
"type": "object",
......@@ -2778,11 +2768,6 @@ func init() {
}
}
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"publicKey": {
"description": "The public key that can verify the signature",
"type": "string",
......@@ -2888,11 +2873,6 @@ func init() {
}
}
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"signature": {
"description": "Information about the included signature in the JAR file",
"type": "object",
......@@ -3025,11 +3005,6 @@ func init() {
}
}
},
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"signature": {
"description": "Information about the detached signature associated with the entry",
"type": "object",
......@@ -3151,11 +3126,6 @@ func init() {
"tsr"
],
"properties": {
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"tsr": {
"description": "Information about the tsr file associated with the entry",
"type": "object",
......@@ -3220,11 +3190,6 @@ func init() {
"package"
],
"properties": {
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"package": {
"description": "Information about the package associated with the entry",
"type": "object",
......@@ -3363,11 +3328,6 @@ func init() {
"root"
],
"properties": {
"extraData": {
"description": "Arbitrary content to be included in the verifiable entry in the transparency log",
"type": "object",
"additionalProperties": true
},
"metadata": {
"description": "TUF metadata",
"type": "object",
......
......@@ -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" ]
......
......@@ -281,7 +281,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}
canonicalEntry := models.AlpineV001Schema{}
canonicalEntry.ExtraData = v.AlpineModel.ExtraData
var err error
......@@ -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)
......
......@@ -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 {
......
......@@ -261,7 +261,6 @@ func (v *V001Entry) Canonicalize(ctx context.Context) ([]byte, error) {
}
canonicalEntry := models.HelmV001Schema{}
canonicalEntry.ExtraData = v.HelmObj.ExtraData
var err error
......
......@@ -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": [
......
......@@ -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": [
......
......@@ -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
......@@ -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)
......
......@@ -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 {
......
......@@ -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" ]
......
......@@ -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{}
......@@ -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)
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment