From 86c2e4519d58977d826add144f7f00ac32eaff7a Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Tue, 10 Sep 2024 15:25:30 +0530 Subject: [PATCH 1/6] feat: add secret reminder attribute --- internal/client/model.go | 86 +++++++------- internal/provider/resource/secret_resource.go | 109 ++++++++++++------ 2 files changed, 121 insertions(+), 74 deletions(-) diff --git a/internal/client/model.go b/internal/client/model.go index 0f30b49..b370dad 100644 --- a/internal/client/model.go +++ b/internal/client/model.go @@ -367,21 +367,23 @@ type EncryptedSecret struct { // create secrets. type CreateSecretV3Request struct { - SecretName string `json:"secretName"` - WorkspaceID string `json:"workspaceId"` - Type string `json:"type"` - Environment string `json:"environment"` - SecretKeyCiphertext string `json:"secretKeyCiphertext"` - SecretKeyIV string `json:"secretKeyIV"` - SecretKeyTag string `json:"secretKeyTag"` - SecretValueCiphertext string `json:"secretValueCiphertext"` - SecretValueIV string `json:"secretValueIV"` - SecretValueTag string `json:"secretValueTag"` - SecretCommentCiphertext string `json:"secretCommentCiphertext"` - SecretCommentIV string `json:"secretCommentIV"` - SecretCommentTag string `json:"secretCommentTag"` - SecretPath string `json:"secretPath"` - TagIDs []string `json:"tags"` + SecretName string `json:"secretName"` + WorkspaceID string `json:"workspaceId"` + Type string `json:"type"` + Environment string `json:"environment"` + SecretKeyCiphertext string `json:"secretKeyCiphertext"` + SecretKeyIV string `json:"secretKeyIV"` + SecretKeyTag string `json:"secretKeyTag"` + SecretValueCiphertext string `json:"secretValueCiphertext"` + SecretValueIV string `json:"secretValueIV"` + SecretValueTag string `json:"secretValueTag"` + SecretCommentCiphertext string `json:"secretCommentCiphertext"` + SecretCommentIV string `json:"secretCommentIV"` + SecretCommentTag string `json:"secretCommentTag"` + SecretPath string `json:"secretPath"` + SecretReminderNote string `json:"secretReminderNote"` + SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` + TagIDs []string `json:"tags"` } // delete secret by name api. @@ -395,15 +397,17 @@ type DeleteSecretV3Request struct { // update secret by name api. type UpdateSecretByNameV3Request struct { - SecretName string `json:"secretName"` - WorkspaceID string `json:"workspaceId"` - Environment string `json:"environment"` - Type string `json:"type"` - SecretPath string `json:"secretPath"` - SecretValueCiphertext string `json:"secretValueCiphertext"` - SecretValueIV string `json:"secretValueIV"` - SecretValueTag string `json:"secretValueTag"` - TagIDs []string `json:"tags,omitempty"` + SecretName string `json:"secretName"` + WorkspaceID string `json:"workspaceId"` + Environment string `json:"environment"` + Type string `json:"type"` + SecretPath string `json:"secretPath"` + SecretReminderNote string `json:"secretReminderNote"` + SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` + SecretValueCiphertext string `json:"secretValueCiphertext"` + SecretValueIV string `json:"secretValueIV"` + SecretValueTag string `json:"secretValueTag"` + TagIDs []string `json:"tags,omitempty"` } // get secret by name api. @@ -446,14 +450,16 @@ type GetSingleRawSecretByNameSecretResponse struct { // create secrets. type CreateRawSecretV3Request struct { - WorkspaceID string `json:"workspaceId"` - Type string `json:"type"` - Environment string `json:"environment"` - SecretKey string `json:"secretKey"` - SecretValue string `json:"secretValue"` - SecretComment string `json:"secretComment"` - SecretPath string `json:"secretPath"` - TagIDs []string `json:"tagIds"` + WorkspaceID string `json:"workspaceId"` + Type string `json:"type"` + Environment string `json:"environment"` + SecretKey string `json:"secretKey"` + SecretValue string `json:"secretValue"` + SecretComment string `json:"secretComment"` + SecretPath string `json:"secretPath"` + SecretReminderNote string `json:"secretReminderNote"` + SecretReminderRepeatDays int64 `json:"secretReminder"` + TagIDs []string `json:"tagIds"` } type DeleteRawSecretV3Request struct { @@ -466,13 +472,15 @@ type DeleteRawSecretV3Request struct { // update secret by name api. type UpdateRawSecretByNameV3Request struct { - SecretName string `json:"secretName"` - WorkspaceID string `json:"workspaceId"` - Environment string `json:"environment"` - Type string `json:"type"` - SecretPath string `json:"secretPath"` - SecretValue string `json:"secretValue"` - TagIDs []string `json:"tagIds"` + SecretName string `json:"secretName"` + WorkspaceID string `json:"workspaceId"` + Environment string `json:"environment"` + Type string `json:"type"` + SecretPath string `json:"secretPath"` + SecretReminderNote string `json:"secretReminderNote"` + SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` + SecretValue string `json:"secretValue"` + TagIDs []string `json:"tagIds"` } type CreateProjectRequest struct { diff --git a/internal/provider/resource/secret_resource.go b/internal/provider/resource/secret_resource.go index d926428..3a91514 100644 --- a/internal/provider/resource/secret_resource.go +++ b/internal/provider/resource/secret_resource.go @@ -29,15 +29,21 @@ type secretResource struct { client *infisical.Client } +type SecretReminder struct { + Note types.String `tfsdk:"note"` + RepeatDays types.Int64 `tfsdk:"repeat_days"` +} + // secretResourceSourceModel describes the data source data model. type secretResourceModel struct { - FolderPath types.String `tfsdk:"folder_path"` - EnvSlug types.String `tfsdk:"env_slug"` - Name types.String `tfsdk:"name"` - Value types.String `tfsdk:"value"` - WorkspaceId types.String `tfsdk:"workspace_id"` - LastUpdated types.String `tfsdk:"last_updated"` - Tags types.List `tfsdk:"tag_ids"` + FolderPath types.String `tfsdk:"folder_path"` + EnvSlug types.String `tfsdk:"env_slug"` + Name types.String `tfsdk:"name"` + SecretReminder *SecretReminder `tfsdk:"secret_reminder"` + Value types.String `tfsdk:"value"` + WorkspaceId types.String `tfsdk:"workspace_id"` + LastUpdated types.String `tfsdk:"last_updated"` + Tags types.List `tfsdk:"tag_ids"` } // Metadata returns the resource type name. @@ -85,6 +91,22 @@ func (r *secretResource) Schema(_ context.Context, _ resource.SchemaRequest, res Optional: true, Description: "Tag ids to be attached for the secrets.", }, + "secret_reminder": schema.SingleNestedAttribute{ + Attributes: map[string]schema.Attribute{ + "note": schema.StringAttribute{ + Description: "Note for the secret rotation reminder", + Computed: false, + Optional: true, + }, + "repeat_days": schema.Int64Attribute{ + Description: "Frequency of secret rotation reminder in days", + Computed: false, + Required: true, + }, + }, + Optional: true, + Computed: false, + }, }, } } @@ -192,11 +214,13 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, } err = r.client.CreateSecretsV3(infisical.CreateSecretV3Request{ - Environment: plan.EnvSlug.ValueString(), - SecretName: plan.Name.ValueString(), - Type: "shared", - SecretPath: plan.FolderPath.ValueString(), - WorkspaceID: serviceTokenDetails.Workspace, + Environment: plan.EnvSlug.ValueString(), + SecretName: plan.Name.ValueString(), + Type: "shared", + SecretPath: plan.FolderPath.ValueString(), + SecretReminderNote: plan.SecretReminder.Note.ValueString(), + SecretReminderRepeatDays: plan.SecretReminder.RepeatDays.ValueInt64(), + WorkspaceID: serviceTokenDetails.Workspace, SecretKeyCiphertext: base64.StdEncoding.EncodeToString(encryptedKey.CipherText), SecretKeyIV: base64.StdEncoding.EncodeToString(encryptedKey.Nonce), @@ -220,13 +244,15 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, plan.WorkspaceId = types.StringValue(serviceTokenDetails.Workspace) } else if r.client.Config.IsMachineIdentityAuth { err := r.client.CreateRawSecretsV3(infisical.CreateRawSecretV3Request{ - Environment: plan.EnvSlug.ValueString(), - WorkspaceID: plan.WorkspaceId.ValueString(), - Type: "shared", - SecretPath: plan.FolderPath.ValueString(), - SecretKey: plan.Name.ValueString(), - SecretValue: plan.Value.ValueString(), - TagIDs: secretTagIds, + Environment: plan.EnvSlug.ValueString(), + WorkspaceID: plan.WorkspaceId.ValueString(), + Type: "shared", + SecretPath: plan.FolderPath.ValueString(), + SecretReminderNote: plan.SecretReminder.Note.ValueString(), + SecretReminderRepeatDays: plan.SecretReminder.RepeatDays.ValueInt64(), + SecretKey: plan.Name.ValueString(), + SecretValue: plan.Value.ValueString(), + TagIDs: secretTagIds, }) if err != nil { @@ -472,6 +498,15 @@ func (r *secretResource) Update(ctx context.Context, req resource.UpdateRequest, secretTagIds = append(secretTagIds, strings.ToLower(slug.ValueString())) } + // null check secret reminder + var secretReminderNote string + var secretReminderRepeatDays int64 + + if plan.SecretReminder != nil { + secretReminderNote = plan.SecretReminder.Note.ValueString() + secretReminderRepeatDays = plan.SecretReminder.RepeatDays.ValueInt64() + } + if r.client.Config.AuthStrategy == infisical.AuthStrategy.SERVICE_TOKEN { serviceTokenDetails, err := r.client.GetServiceTokenDetailsV2() @@ -522,15 +557,17 @@ func (r *secretResource) Update(ctx context.Context, req resource.UpdateRequest, } err = r.client.UpdateSecretsV3(infisical.UpdateSecretByNameV3Request{ - Environment: plan.EnvSlug.ValueString(), - SecretName: plan.Name.ValueString(), - Type: "shared", - SecretPath: plan.FolderPath.ValueString(), - WorkspaceID: serviceTokenDetails.Workspace, - TagIDs: secretTagIds, - SecretValueCiphertext: base64.StdEncoding.EncodeToString(encryptedSecretValue.CipherText), - SecretValueIV: base64.StdEncoding.EncodeToString(encryptedSecretValue.Nonce), - SecretValueTag: base64.StdEncoding.EncodeToString(encryptedSecretValue.AuthTag), + Environment: plan.EnvSlug.ValueString(), + SecretName: plan.Name.ValueString(), + Type: "shared", + SecretPath: plan.FolderPath.ValueString(), + WorkspaceID: serviceTokenDetails.Workspace, + TagIDs: secretTagIds, + SecretValueCiphertext: base64.StdEncoding.EncodeToString(encryptedSecretValue.CipherText), + SecretValueIV: base64.StdEncoding.EncodeToString(encryptedSecretValue.Nonce), + SecretValueTag: base64.StdEncoding.EncodeToString(encryptedSecretValue.AuthTag), + SecretReminderNote: secretReminderNote, + SecretReminderRepeatDays: secretReminderRepeatDays, }) if err != nil { @@ -546,13 +583,15 @@ func (r *secretResource) Update(ctx context.Context, req resource.UpdateRequest, } else if r.client.Config.IsMachineIdentityAuth { err := r.client.UpdateRawSecretV3(infisical.UpdateRawSecretByNameV3Request{ - Environment: plan.EnvSlug.ValueString(), - WorkspaceID: plan.WorkspaceId.ValueString(), - Type: "shared", - TagIDs: secretTagIds, - SecretPath: plan.FolderPath.ValueString(), - SecretName: plan.Name.ValueString(), - SecretValue: plan.Value.ValueString(), + Environment: plan.EnvSlug.ValueString(), + WorkspaceID: plan.WorkspaceId.ValueString(), + Type: "shared", + TagIDs: secretTagIds, + SecretPath: plan.FolderPath.ValueString(), + SecretName: plan.Name.ValueString(), + SecretValue: plan.Value.ValueString(), + SecretReminderNote: secretReminderNote, + SecretReminderRepeatDays: secretReminderRepeatDays, }) if err != nil { From c8b8938ac493e28e7838cfeeb4f26b9123eeed27 Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Tue, 10 Sep 2024 15:35:01 +0530 Subject: [PATCH 2/6] feat: add secret reminder example --- examples/resources/infisical_secret/resource.tf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/resources/infisical_secret/resource.tf b/examples/resources/infisical_secret/resource.tf index 45e9102..f73a410 100644 --- a/examples/resources/infisical_secret/resource.tf +++ b/examples/resources/infisical_secret/resource.tf @@ -22,11 +22,15 @@ resource "infisical_secret" "mongo_secret" { } resource "infisical_secret" "smtp_secret" { - name = "SMTP" - value = "" - env_slug = "dev" - workspace_id = "PROJECT_ID" - folder_path = "/mail-service" + name = "SMTP" + value = "" + env_slug = "dev" + workspace_id = "PROJECT_ID" + folder_path = "/mail-service" + secret_reminder = { + note = "Rotate this secret using X API" + repeat_days = 30 + } } From a8614d6e199f60798ffc1444ac48364e16cfde93 Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Tue, 10 Sep 2024 15:39:41 +0530 Subject: [PATCH 3/6] feat: add secret reminder doc --- docs/resources/secret.md | 16 ++++++++++++++++ examples/resources/infisical_secret/resource.tf | 12 ++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/resources/secret.md b/docs/resources/secret.md index e8af6f3..8a99d48 100644 --- a/docs/resources/secret.md +++ b/docs/resources/secret.md @@ -42,6 +42,10 @@ resource "infisical_secret" "smtp_secret" { env_slug = "dev" workspace_id = "PROJECT_ID" folder_path = "/mail-service" + secret_reminder = { + note = "Rotate this secret using X API" + repeat_days = 30 + } } @@ -74,9 +78,21 @@ resource "infisical_secret" "github_action_secret" { ### Optional +- `secret_reminder` (Attributes) (see [below for nested schema](#nestedatt--secret_reminder)) - `tag_ids` (List of String) Tag ids to be attached for the secrets. - `workspace_id` (String) The Infisical project ID (Required for Machine Identity auth, and service tokens with multiple scopes) ### Read-Only - `last_updated` (String) + + +### Nested Schema for `secret_reminder` + +Required: + +- `repeat_days` (Number) Frequency of secret rotation reminder in days + +Optional: + +- `note` (String) Note for the secret rotation reminder diff --git a/examples/resources/infisical_secret/resource.tf b/examples/resources/infisical_secret/resource.tf index f73a410..e271e04 100644 --- a/examples/resources/infisical_secret/resource.tf +++ b/examples/resources/infisical_secret/resource.tf @@ -22,13 +22,13 @@ resource "infisical_secret" "mongo_secret" { } resource "infisical_secret" "smtp_secret" { - name = "SMTP" - value = "" - env_slug = "dev" - workspace_id = "PROJECT_ID" - folder_path = "/mail-service" + name = "SMTP" + value = "" + env_slug = "dev" + workspace_id = "PROJECT_ID" + folder_path = "/mail-service" secret_reminder = { - note = "Rotate this secret using X API" + note = "Rotate this secret using X API" repeat_days = 30 } } From a9ef00a52ec0b5a9dfc9f61dde0ca7edad11670a Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Tue, 10 Sep 2024 23:33:52 +0530 Subject: [PATCH 4/6] fix: secretReminderRepeatDays field --- internal/client/model.go | 2 +- internal/provider/resource/secret_resource.go | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/client/model.go b/internal/client/model.go index b370dad..8d8a540 100644 --- a/internal/client/model.go +++ b/internal/client/model.go @@ -458,7 +458,7 @@ type CreateRawSecretV3Request struct { SecretComment string `json:"secretComment"` SecretPath string `json:"secretPath"` SecretReminderNote string `json:"secretReminderNote"` - SecretReminderRepeatDays int64 `json:"secretReminder"` + SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` TagIDs []string `json:"tagIds"` } diff --git a/internal/provider/resource/secret_resource.go b/internal/provider/resource/secret_resource.go index 3a91514..a5441a3 100644 --- a/internal/provider/resource/secret_resource.go +++ b/internal/provider/resource/secret_resource.go @@ -218,8 +218,6 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, SecretName: plan.Name.ValueString(), Type: "shared", SecretPath: plan.FolderPath.ValueString(), - SecretReminderNote: plan.SecretReminder.Note.ValueString(), - SecretReminderRepeatDays: plan.SecretReminder.RepeatDays.ValueInt64(), WorkspaceID: serviceTokenDetails.Workspace, SecretKeyCiphertext: base64.StdEncoding.EncodeToString(encryptedKey.CipherText), @@ -243,13 +241,23 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, // Set state to fully populated data plan.WorkspaceId = types.StringValue(serviceTokenDetails.Workspace) } else if r.client.Config.IsMachineIdentityAuth { + + // null check secret reminder + var secretReminderNote string + var secretReminderRepeatDays int64 + + if plan.SecretReminder != nil { + secretReminderNote = plan.SecretReminder.Note.ValueString() + secretReminderRepeatDays = plan.SecretReminder.RepeatDays.ValueInt64() + } + err := r.client.CreateRawSecretsV3(infisical.CreateRawSecretV3Request{ Environment: plan.EnvSlug.ValueString(), WorkspaceID: plan.WorkspaceId.ValueString(), Type: "shared", SecretPath: plan.FolderPath.ValueString(), - SecretReminderNote: plan.SecretReminder.Note.ValueString(), - SecretReminderRepeatDays: plan.SecretReminder.RepeatDays.ValueInt64(), + SecretReminderNote: secretReminderNote, + SecretReminderRepeatDays: secretReminderRepeatDays, SecretKey: plan.Name.ValueString(), SecretValue: plan.Value.ValueString(), TagIDs: secretTagIds, From e1a0b365173632309f885e8d726fb3d7383dde99 Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Wed, 11 Sep 2024 02:55:48 +0530 Subject: [PATCH 5/6] chore: remove unused fields --- internal/client/model.go | 4 ---- internal/provider/resource/secret_resource.go | 2 -- 2 files changed, 6 deletions(-) diff --git a/internal/client/model.go b/internal/client/model.go index 8d8a540..a6184e5 100644 --- a/internal/client/model.go +++ b/internal/client/model.go @@ -381,8 +381,6 @@ type CreateSecretV3Request struct { SecretCommentIV string `json:"secretCommentIV"` SecretCommentTag string `json:"secretCommentTag"` SecretPath string `json:"secretPath"` - SecretReminderNote string `json:"secretReminderNote"` - SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` TagIDs []string `json:"tags"` } @@ -402,8 +400,6 @@ type UpdateSecretByNameV3Request struct { Environment string `json:"environment"` Type string `json:"type"` SecretPath string `json:"secretPath"` - SecretReminderNote string `json:"secretReminderNote"` - SecretReminderRepeatDays int64 `json:"secretReminderRepeatDays"` SecretValueCiphertext string `json:"secretValueCiphertext"` SecretValueIV string `json:"secretValueIV"` SecretValueTag string `json:"secretValueTag"` diff --git a/internal/provider/resource/secret_resource.go b/internal/provider/resource/secret_resource.go index a5441a3..4d5b6c0 100644 --- a/internal/provider/resource/secret_resource.go +++ b/internal/provider/resource/secret_resource.go @@ -574,8 +574,6 @@ func (r *secretResource) Update(ctx context.Context, req resource.UpdateRequest, SecretValueCiphertext: base64.StdEncoding.EncodeToString(encryptedSecretValue.CipherText), SecretValueIV: base64.StdEncoding.EncodeToString(encryptedSecretValue.Nonce), SecretValueTag: base64.StdEncoding.EncodeToString(encryptedSecretValue.AuthTag), - SecretReminderNote: secretReminderNote, - SecretReminderRepeatDays: secretReminderRepeatDays, }) if err != nil { From 1a0500d2a504a0f4b23a835dcaae8f537d84c9dc Mon Sep 17 00:00:00 2001 From: Meet Shah Date: Wed, 11 Sep 2024 03:33:18 +0530 Subject: [PATCH 6/6] chore: refactor and add validation to match api --- go.mod | 39 +++++++------- go.sum | 51 +++++++++++++++++++ internal/provider/resource/secret_resource.go | 36 +++++++------ 3 files changed, 93 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 452e087..9aa928c 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,15 @@ module terraform-provider-infisical -go 1.19 +go 1.21 + +toolchain go1.23.1 require ( github.com/go-resty/resty/v2 v2.7.0 github.com/hashicorp-demoapp/hashicups-client-go v0.1.0 github.com/hashicorp/terraform-plugin-docs v0.15.0 - github.com/hashicorp/terraform-plugin-framework v1.3.0 - github.com/hashicorp/terraform-plugin-go v0.15.0 + github.com/hashicorp/terraform-plugin-framework v1.10.0 + github.com/hashicorp/terraform-plugin-go v0.23.0 github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-testing v1.2.0 ) @@ -23,16 +25,16 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.10 // indirect + github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hc-install v0.5.2 // indirect @@ -40,9 +42,10 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.18.1 // indirect github.com/hashicorp/terraform-json v0.16.0 // indirect + github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 // indirect - github.com/hashicorp/terraform-registry-address v0.2.0 // indirect - github.com/hashicorp/terraform-svchost v0.1.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/xstrings v1.3.2 // indirect github.com/imdario/mergo v0.3.13 // indirect @@ -60,16 +63,16 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.2 // indirect - golang.org/x/crypto v0.8.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/grpc v1.63.2 // indirect + google.golang.org/protobuf v1.34.0 // indirect ) diff --git a/go.sum b/go.sum index 1935d1b..ea6f423 100644 --- a/go.sum +++ b/go.sum @@ -41,16 +41,22 @@ github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp-demoapp/hashicups-client-go v0.1.0 h1:5eUmjDEqF4viZHLwS9UKSqwDHJ2T9ZQamqSf5dn+qcE= github.com/hashicorp-demoapp/hashicups-client-go v0.1.0/go.mod h1:fJF8CZhWlImByx49t7RZvuoxskStDwqIWi5/GOSJqGI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -70,6 +76,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= +github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= +github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -89,8 +97,14 @@ github.com/hashicorp/terraform-plugin-docs v0.15.0 h1:W5xYB5kCUBqO7lyjE2UMmUBh95 github.com/hashicorp/terraform-plugin-docs v0.15.0/go.mod h1:K5Taof1Y7sL4dw6Ie0qMFyQnHN0W+RSVMD0iIyFDFJc= github.com/hashicorp/terraform-plugin-framework v1.3.0 h1:WtP1CIaWAfbzME17xoUXvJcyh5Ewu9attdhbfWNnYLs= github.com/hashicorp/terraform-plugin-framework v1.3.0/go.mod h1:A1WD3Ry7FhrThViUTbkx4ZDsMq9oaAv4U9oTI8bBzCU= +github.com/hashicorp/terraform-plugin-framework v1.10.0 h1:xXhICE2Fns1RYZxEQebwkB2+kXouLC932Li9qelozrc= +github.com/hashicorp/terraform-plugin-framework v1.10.0/go.mod h1:qBXLDn69kM97NNVi/MQ9qgd1uWWsVftGSnygYG1tImM= +github.com/hashicorp/terraform-plugin-framework-validators v0.13.0 h1:bxZfGo9DIUoLLtHMElsu+zwqI4IsMZQBRRy4iLzZJ8E= +github.com/hashicorp/terraform-plugin-framework-validators v0.13.0/go.mod h1:wGeI02gEhj9nPANU62F2jCaHjXulejm/X+af4PdZaNo= github.com/hashicorp/terraform-plugin-go v0.15.0 h1:1BJNSUFs09DS8h/XNyJNJaeusQuWc/T9V99ylU9Zwp0= github.com/hashicorp/terraform-plugin-go v0.15.0/go.mod h1:tk9E3/Zx4RlF/9FdGAhwxHExqIHHldqiQGt20G6g+nQ= +github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co= +github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= @@ -99,8 +113,12 @@ github.com/hashicorp/terraform-plugin-testing v1.2.0 h1:pASRAe6BOZFO4xSGQr9WzitX github.com/hashicorp/terraform-plugin-testing v1.2.0/go.mod h1:+8bp3O7xUb1UtBcdknrGdVRIuTw4b62TYSIgXHqlyew= github.com/hashicorp/terraform-registry-address v0.2.0 h1:92LUg03NhfgZv44zpNTLBGIbiyTokQCDcdH5BhVHT3s= github.com/hashicorp/terraform-registry-address v0.2.0/go.mod h1:478wuzJPzdmqT6OGbB/iH82EDcI8VFM4yujknh/1nIs= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.0 h1:0+RcgZdZYNd81Vw7tu62g9JiLLvbOigp7QtyNh6CjXk= github.com/hashicorp/terraform-svchost v0.1.0/go.mod h1:ut8JaH0vumgdCfJaihdcZULqkAwHdQNwNH7taIDdsZM= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -111,6 +129,7 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= @@ -174,9 +193,12 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -185,15 +207,24 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -205,30 +236,50 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= +google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/provider/resource/secret_resource.go b/internal/provider/resource/secret_resource.go index 4d5b6c0..a6bd184 100644 --- a/internal/provider/resource/secret_resource.go +++ b/internal/provider/resource/secret_resource.go @@ -9,8 +9,10 @@ import ( "terraform-provider-infisical/internal/crypto" "time" + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -102,6 +104,10 @@ func (r *secretResource) Schema(_ context.Context, _ resource.SchemaRequest, res Description: "Frequency of secret rotation reminder in days", Computed: false, Required: true, + Validators: []validator.Int64{ + int64validator.AtLeast(1), + int64validator.AtMost(365), + }, }, }, Optional: true, @@ -214,11 +220,11 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, } err = r.client.CreateSecretsV3(infisical.CreateSecretV3Request{ - Environment: plan.EnvSlug.ValueString(), - SecretName: plan.Name.ValueString(), - Type: "shared", - SecretPath: plan.FolderPath.ValueString(), - WorkspaceID: serviceTokenDetails.Workspace, + Environment: plan.EnvSlug.ValueString(), + SecretName: plan.Name.ValueString(), + Type: "shared", + SecretPath: plan.FolderPath.ValueString(), + WorkspaceID: serviceTokenDetails.Workspace, SecretKeyCiphertext: base64.StdEncoding.EncodeToString(encryptedKey.CipherText), SecretKeyIV: base64.StdEncoding.EncodeToString(encryptedKey.Nonce), @@ -241,7 +247,7 @@ func (r *secretResource) Create(ctx context.Context, req resource.CreateRequest, // Set state to fully populated data plan.WorkspaceId = types.StringValue(serviceTokenDetails.Workspace) } else if r.client.Config.IsMachineIdentityAuth { - + // null check secret reminder var secretReminderNote string var secretReminderRepeatDays int64 @@ -565,15 +571,15 @@ func (r *secretResource) Update(ctx context.Context, req resource.UpdateRequest, } err = r.client.UpdateSecretsV3(infisical.UpdateSecretByNameV3Request{ - Environment: plan.EnvSlug.ValueString(), - SecretName: plan.Name.ValueString(), - Type: "shared", - SecretPath: plan.FolderPath.ValueString(), - WorkspaceID: serviceTokenDetails.Workspace, - TagIDs: secretTagIds, - SecretValueCiphertext: base64.StdEncoding.EncodeToString(encryptedSecretValue.CipherText), - SecretValueIV: base64.StdEncoding.EncodeToString(encryptedSecretValue.Nonce), - SecretValueTag: base64.StdEncoding.EncodeToString(encryptedSecretValue.AuthTag), + Environment: plan.EnvSlug.ValueString(), + SecretName: plan.Name.ValueString(), + Type: "shared", + SecretPath: plan.FolderPath.ValueString(), + WorkspaceID: serviceTokenDetails.Workspace, + TagIDs: secretTagIds, + SecretValueCiphertext: base64.StdEncoding.EncodeToString(encryptedSecretValue.CipherText), + SecretValueIV: base64.StdEncoding.EncodeToString(encryptedSecretValue.Nonce), + SecretValueTag: base64.StdEncoding.EncodeToString(encryptedSecretValue.AuthTag), }) if err != nil {