AB#2644 Fetch measurements from CDN (#653)

* Fetch measurements from CDN

* Perform metadata validation on fetched measurements

* Remove deprecated public bucket

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-11-28 10:27:33 +01:00 committed by GitHub
parent c978329839
commit d52f3db2a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 406 additions and 144 deletions

View file

@ -44,6 +44,21 @@ func (p *Provider) UnmarshalJSON(b []byte) error {
return nil
}
// MarshalYAML marshals the Provider to YAML string.
func (p Provider) MarshalYAML() (interface{}, error) {
return p.String(), nil
}
// UnmarshalYAML unmarshals the Provider from YAML string.
func (p *Provider) UnmarshalYAML(unmarshal func(any) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
}
*p = FromString(s)
return nil
}
// FromString returns cloud provider from string.
func FromString(s string) Provider {
s = strings.ToLower(s)