From 9d8a7a59bae30982d1def82d99b4dcbe98b30ad3 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)