Skip to content

Commit

Permalink
sign cached objects
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Sep 22, 2023
1 parent 5fc68d2 commit a03b776
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions internal/api/attestationconfigapi/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}

0 comments on commit a03b776

Please sign in to comment.