Skip to content

Commit

Permalink
update hcp-sdk-go and breaking change w/ hvs api (#1080)
Browse files Browse the repository at this point in the history
* update hcp-sdk-go and breaking change w/ hvs api

* add changelog

* go mod tidy
  • Loading branch information
dhuckins authored Aug 29, 2024
1 parent af50703 commit 603e57b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/1080.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
update hcp-sdk-go
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/hcp-sdk-go v0.105.0
github.com/hashicorp/hcp-sdk-go v0.110.0
github.com/hashicorp/terraform-plugin-docs v0.19.4
github.com/hashicorp/terraform-plugin-framework v1.5.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC16
github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA=
github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI=
github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
github.com/hashicorp/hcp-sdk-go v0.105.0 h1:KKqOBi13+wMEvMEG65brBJIXzvZcxjehVzk6vipaaSE=
github.com/hashicorp/hcp-sdk-go v0.105.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk=
github.com/hashicorp/hcp-sdk-go v0.110.0 h1:eaDO6XoEb0H+g00Ka3C+ZbRibhwWyA2YNmv48xFCL2w=
github.com/hashicorp/hcp-sdk-go v0.110.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk=
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ=
Expand Down
13 changes: 9 additions & 4 deletions internal/clients/vault_secrets_preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ func GetRotatingSecretState(ctx context.Context, client *Client, loc *sharedmode
// CreateMongoDBAtlasRotationIntegration NOTE: currently just needed for tests
func CreateMongoDBAtlasRotationIntegration(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, integrationName, mongodbAtlasPublicKey, mongodbAtlasPrivateKey string) (*secretmodels.Secrets20231128MongoDBAtlasIntegration, error) {
body := secretmodels.SecretServiceCreateMongoDBAtlasIntegrationBody{
IntegrationName: integrationName,
MongodbAPIPublicKey: mongodbAtlasPublicKey,
MongodbAPIPrivateKey: mongodbAtlasPrivateKey,
Name: integrationName,
Capabilities: []*secretmodels.Secrets20231128Capability{
secretmodels.Secrets20231128CapabilityROTATION.Pointer(),
},
StaticCredentialDetails: &secretmodels.Secrets20231128MongoDBAtlasStaticCredentialsRequest{
APIPublicKey: mongodbAtlasPublicKey,
APIPrivateKey: mongodbAtlasPrivateKey,
},
}
params := secret_service.NewCreateMongoDBAtlasIntegrationParamsWithContext(ctx).
WithOrganizationID(loc.OrganizationID).
Expand All @@ -124,7 +129,7 @@ func DeleteMongoDBAtlasRotationIntegration(ctx context.Context, client *Client,
params := secret_service.NewDeleteMongoDBAtlasIntegrationParamsWithContext(ctx).
WithOrganizationID(loc.OrganizationID).
WithProjectID(loc.ProjectID).
WithIntegrationName(integrationName)
WithName(integrationName)

_, err := client.VaultSecretsPreview.DeleteMongoDBAtlasIntegration(params, nil)
if err != nil {
Expand Down

0 comments on commit 603e57b

Please sign in to comment.