api: use new signature JSON format (#1872)

* use new impl for client.UploadAzureSEVSNP

* fix: fetcher must parse new signature format

* version-file is not persistentflag

* fix fetcher tests
This commit is contained in:
Adrian Stobbe 2023-06-05 16:10:44 +02:00 committed by GitHub
parent fa01569cc6
commit 99a88c033c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 77 additions and 143 deletions

View file

@ -42,7 +42,7 @@ type AzureSEVSNPVersionSignature struct {
// JSONPath returns the path to the JSON file for the request to the config api.
func (s AzureSEVSNPVersionSignature) JSONPath() string {
return path.Join(attestationURLPath, variant.AzureSEVSNP{}.String(), s.Version, ".sig")
return path.Join(attestationURLPath, variant.AzureSEVSNP{}.String(), s.Version+".sig")
}
// URL returns the URL for the request to the config api.
@ -53,7 +53,7 @@ func (s AzureSEVSNPVersionSignature) URL() (string, error) {
// ValidateRequest validates the request.
func (s AzureSEVSNPVersionSignature) ValidateRequest() error {
if !strings.HasSuffix(s.Version, ".json") {
return fmt.Errorf("version has no .json suffix")
return fmt.Errorf("%s version has no .json suffix", s.Version)
}
return nil
}