mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-03 14:54:53 -04:00
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:
parent
c978329839
commit
d52f3db2a3
16 changed files with 406 additions and 144 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue