Skip to content

Commit

Permalink
attestation: use domain suffix from environment when configuring data…
Browse files Browse the repository at this point in the history
… plane client
  • Loading branch information
manicminer committed Apr 10, 2024
1 parent 4b58b4b commit eb93d1c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/services/attestation/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb93d1c

Please sign in to comment.