Skip to content

Commit

Permalink
backport of commit 670c952 (hashicorp#19605)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
  • Loading branch information
1 parent b500045 commit 37145a7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions vault/hcp_link/capabilities/api_capability/token_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ func (t *HCPLinkTokenManager) fetchPolicy() (string, error) {
return "", fmt.Errorf("error creating HTTP request: %w", err)
}

query := req.URL.Query()
query.Add("cluster_id", t.scadaConfig.Resource.ID)
req.URL.RawQuery = query.Encode()

retryableReq, err := retryablehttp.FromRequest(req)
if err != nil {
return "", fmt.Errorf("error adding HTTP request retry wrapping: %w", err)
Expand Down Expand Up @@ -165,10 +161,11 @@ func (t *HCPLinkTokenManager) updateInLinePolicy() {
func NewHCPLinkTokenManager(scadaConfig *scada.Config, core *vault.Core, logger hclog.Logger) (*HCPLinkTokenManager, error) {
tokenLogger := logger.Named("token_manager")

policyURL := fmt.Sprintf("https://%s/vault/2020-11-25/organizations/%s/projects/%s/link/policy",
policyURL := fmt.Sprintf("https://%s/vault-link/2022-11-07/organizations/%s/projects/%s/link/policy/%s",
scadaConfig.HCPConfig.APIAddress(),
scadaConfig.Resource.Location.OrganizationID,
scadaConfig.Resource.Location.ProjectID,
scadaConfig.Resource.ID,
)

m := &HCPLinkTokenManager{
Expand Down

0 comments on commit 37145a7

Please sign in to comment.