constellation/internal/attestation/azure/snp/imds.go
Thomas Tendyck 3b9f7530fb license: change headers
find -name '*.go' -exec sed -i 's/SPDX-License-Identifier: AGPL-3.0-only/SPDX-License-Identifier: BUSL-1.1/' {} +
2025-07-15 23:34:48 +02:00

35 lines
594 B
Go

/*
Copyright (c) Edgeless Systems GmbH
SPDX-License-Identifier: BUSL-1.1
*/
package snp
import (
"context"
"fmt"
"github.com/edgelesssys/constellation/v2/internal/cloud/azure"
)
const tagMAAURL = "constellation-maa-url"
type imdsClient struct {
imdsClient *azure.IMDSClient
}
func newIMDSClient() *imdsClient {
return &imdsClient{
imdsClient: azure.NewIMDSClient(),
}
}
func (c *imdsClient) getMAAURL(ctx context.Context) (string, error) {
tags, err := c.imdsClient.Tags(ctx)
if err != nil {
return "", fmt.Errorf("getting tags: %w", err)
}
return tags[tagMAAURL], nil
}