From a03b7764a34d024b4f2d4c6bc99dbeb5d2d96951 Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Fri, 22 Sep 2023 12:24:05 +0200 Subject: [PATCH] sign cached objects --- internal/api/attestationconfigapi/reporter.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/api/attestationconfigapi/reporter.go b/internal/api/attestationconfigapi/reporter.go index b83b3a357b..452f5b1b85 100644 --- a/internal/api/attestationconfigapi/reporter.go +++ b/internal/api/attestationconfigapi/reporter.go @@ -22,7 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/edgelesssys/constellation/v2/internal/api/client" - apiclient "github.com/edgelesssys/constellation/v2/internal/api/client" "github.com/edgelesssys/constellation/v2/internal/attestation/variant" ) @@ -91,8 +90,9 @@ func (c *Client) SetCacheWindowSize(size int) { // cacheAzureSEVSNPVersion uploads the latest observed version numbers of the Azure SEVSNP. This version is used to later report the latest version numbers to the API. func (c Client) cacheAzureSEVSNPVersion(ctx context.Context, version AzureSEVSNPVersion, date time.Time) error { dateStr := date.Format(VersionFormat) + ".json" - res := putCmdWithoutSigning{ + res := putCmd{ apiObject: reportedAzureSEVSNPVersionAPI{Version: dateStr, AzureSEVSNPVersion: version}, + signer: c.signer, } return res.Execute(ctx, c.s3Client) } @@ -193,11 +193,3 @@ func (i reportedAzureSEVSNPVersionAPI) ValidateRequest() error { func (i reportedAzureSEVSNPVersionAPI) Validate() error { return nil } - -type putCmdWithoutSigning struct { - apiObject apiclient.APIObject -} - -func (p putCmdWithoutSigning) Execute(ctx context.Context, c *apiclient.Client) error { - return apiclient.Update(ctx, c, p.apiObject) -}