From eb93d1cf8420ef172a443ce1dc669a5b37ffdc40 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Tue, 9 Apr 2024 15:34:55 +0100 Subject: [PATCH] attestation: use domain suffix from environment when configuring data plane client --- internal/services/attestation/client/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/services/attestation/client/client.go b/internal/services/attestation/client/client.go index 949471aec6186..60065b4f0bdaf 100644 --- a/internal/services/attestation/client/client.go +++ b/internal/services/attestation/client/client.go @@ -67,7 +67,11 @@ func (c *Client) DataPlaneClientWithEndpoint(endpoint string) (*attestation.Poli segments = segments[2:] } authTokenUri := fmt.Sprintf("https://%s/", strings.Join(segments, ".")) - api := environments.AttestationAPI(authTokenUri) + domainSuffix, ok := c.o.Environment.Attestation.DomainSuffix() + if !ok { + return nil, fmt.Errorf("building Authorizer for %q: domain suffix for Attestation service could not be determined", endpoint) + } + api := environments.AttestationAPI(authTokenUri, *domainSuffix) auth, err := c.o.Authorizers.AuthorizerFunc(api) if err != nil { return nil, fmt.Errorf("building Authorizer for %q: %+v", endpoint, err)