mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 14:41:09 +01:00
update link policy fetch URL (#19371)
* update link policy fetch URL * fix fmt
This commit is contained in:
parent
051e6fe25f
commit
670c9522a5
@ -91,10 +91,6 @@ func (t *HCPLinkTokenManager) fetchPolicy() (string, error) {
|
|||||||
return "", fmt.Errorf("error creating HTTP request: %w", err)
|
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)
|
retryableReq, err := retryablehttp.FromRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("error adding HTTP request retry wrapping: %w", err)
|
return "", fmt.Errorf("error adding HTTP request retry wrapping: %w", err)
|
||||||
@ -168,10 +164,11 @@ func (t *HCPLinkTokenManager) updateInLinePolicy() {
|
|||||||
func NewHCPLinkTokenManager(scadaConfig *scada.Config, core *vault.Core, logger hclog.Logger) (*HCPLinkTokenManager, error) {
|
func NewHCPLinkTokenManager(scadaConfig *scada.Config, core *vault.Core, logger hclog.Logger) (*HCPLinkTokenManager, error) {
|
||||||
tokenLogger := logger.Named("token_manager")
|
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.HCPConfig.APIAddress(),
|
||||||
scadaConfig.Resource.Location.OrganizationID,
|
scadaConfig.Resource.Location.OrganizationID,
|
||||||
scadaConfig.Resource.Location.ProjectID,
|
scadaConfig.Resource.Location.ProjectID,
|
||||||
|
scadaConfig.Resource.ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
m := &HCPLinkTokenManager{
|
m := &HCPLinkTokenManager{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user