From 719efa9d973f581cb2690017a88a11c154fbc617 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 18 Oct 2023 10:18:43 -0700 Subject: [PATCH 01/44] Remove provider attributes validation Remove api_key from framework provider Make url attribute required in SDKv2 provider Clean up logging, error message, etc. Update provider documentation --- docs/index.md | 54 +++++++++----------------- pkg/artifactory/provider/framework.go | 56 ++++++++++----------------- pkg/artifactory/provider/sdkv2.go | 25 ++++++------ 3 files changed, 50 insertions(+), 85 deletions(-) diff --git a/docs/index.md b/docs/index.md index 0d4ae6f5b..211f4ee12 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,20 +1,14 @@ # Artifactory Provider -The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the -resources supported by Artifactory. The provider needs to be configured -with the proper credentials before it can be used. +The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the resources supported by Artifactory. The provider needs to be configured with the proper credentials before it can be used. -Links to documentation for specific resources can be found in the table of -contents to the left. +Links to documentation for specific resources can be found in the table of contents to the left. -This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. -You can determine which license you have by accessing the following the URL -`${host}/artifactory/api/system/licenses/`. +This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. You can determine which license you have by accessing the following the URL `${host}/artifactory/api/system/licenses/`. -You can either access it via api, or web browser - it does require admin level credentials, but it's one of the few -APIs that will work without a license (side node: you can also install your license here with a `POST`). +You can either access it via API, or web browser - it require admin level credentials. -```bash +```sh curl -sL ${host}/artifactory/api/system/licenses/ | jq . { "type" : "Enterprise Plus Trial", @@ -24,23 +18,14 @@ curl -sL ${host}/artifactory/api/system/licenses/ | jq . ``` -The following 3 license types (`jq .type`) do **NOT** support APIs: -- Community Edition for C/C++ -- JCR Edition -- OSS - -~> -We maintain two major versions of Terraform Provider - 6.x and 7.x. Version 6.x is compatible with the Artifactory versions 7.49.x and below, -version 7.x is only compatible with Artifactory 7.50.x and above due to changes in the projects functionality. - ## Example Usage -```hcl +```tf # Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html) terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "6.22.3" + version = "9.7.0" } } } @@ -61,16 +46,14 @@ resource "artifactory_local_pypi_repository" "pypi-libs" { ## Authentication The Artifactory provider supports two ways of authentication. The following methods are supported: - - * Access Token - * JFrog API Key Header +* Access Token +* API Key ### Access Token -Artifactory access tokens may be used via the Authorization header by providing the `access_token` field to the provider -block. Getting this value from the environment is supported with `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` variables. +Artifactory access tokens may be used via the Authorization header by providing the `access_token` attribute to the provider block. Getting this value from the environment is supported with `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` variables. Usage: -```hcl +```tf # Configure the Artifactory provider provider "artifactory" { url = "artifactory.site.com/artifactory" @@ -78,16 +61,16 @@ provider "artifactory" { } ``` -### JFrog API Key Header +### API Key -!> **Warning** An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API Key Deprecation Process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process). +!>An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API Key Deprecation Process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process). -Artifactory API keys may be used via the `X-JFrog-Art-Api` header by providing the `api_key` field in the provider block. +~>If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set, the provider will ignore `api_key` attribute. -Getting this value from the environment is supported with the `ARTIFACTORY_API_KEY` variable. +Artifactory API keys may be used via the `X-JFrog-Art-Api` header by providing the `api_key` attribute in the provider block. Usage: -```hcl +```tf # Configure the Artifactory provider provider "artifactory" { url = "artifactory.site.com/artifactory" @@ -99,8 +82,7 @@ provider "artifactory" { The following arguments are supported: -* `url` - (Optional) URL of Artifactory. This can also be sourced from the `ARTIFACTORY_URL` environment variable. +* `url` - (Optional) URL of Artifactory. This can also be sourced from the `JFROG_URL` or `ARTIFACTORY_URL` environment variable. * `access_token` - (Optional) This can also be sourced from `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variables. -* `api_key` - (Optional, deprecated) API key for api auth. Uses `X-JFrog-Art-Api` header. - Conflicts with `access_token`. This can also be sourced from the `ARTIFACTORY_API_KEY` environment variable. +* `api_key` - (Optional, deprecated) API key for api auth. * `check_license` - (Optional) Toggle for pre-flight checking of Artifactory license. Default to `true`. diff --git a/pkg/artifactory/provider/framework.go b/pkg/artifactory/provider/framework.go index 1b23bf460..48eab958f 100644 --- a/pkg/artifactory/provider/framework.go +++ b/pkg/artifactory/provider/framework.go @@ -5,33 +5,30 @@ import ( "fmt" "os" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/configuration" "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/security" "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/user" "github.com/jfrog/terraform-provider-shared/client" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" + validatorfw_string "github.com/jfrog/terraform-provider-shared/validator/fw/string" ) // Ensure the implementation satisfies the provider.Provider interface. var _ provider.Provider = &ArtifactoryProvider{} -type ArtifactoryProvider struct { - // Version is an example field that can be set with an actual provider - // version on release, "dev" when the provider is built and ran locally, - // and "test" when running acceptance testing. - version string -} +type ArtifactoryProvider struct{} // ArtifactoryProviderModel describes the provider data model. type ArtifactoryProviderModel struct { Url types.String `tfsdk:"url"` AccessToken types.String `tfsdk:"access_token"` - ApiKey types.String `tfsdk:"api_key"` CheckLicense types.Bool `tfsdk:"check_license"` } @@ -47,18 +44,18 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq Attributes: map[string]schema.Attribute{ "url": schema.StringAttribute{ Description: "Artifactory URL.", - Optional: true, + Required: true, + Validators: []validator.String{ + validatorfw_string.IsURLHttpOrHttps(), + }, }, "access_token": schema.StringAttribute{ - Description: "This is a access token that can be given to you by your admin under `Identity and Access`. If not set, the 'api_key' attribute value will be used.", + Description: "This is a access token that can be given to you by your admin under `User Management -> Access Tokens`.", Optional: true, Sensitive: true, - }, - "api_key": schema.StringAttribute{ - Description: "API token. Projects functionality will not work with any auth method other than access tokens", - DeprecationMessage: "An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available.", - Optional: true, - Sensitive: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, }, "check_license": schema.BoolAttribute{ Description: "Toggle for pre-flight checking of Artifactory Pro and Enterprise license. Default to `true`.", @@ -89,13 +86,9 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config accessToken = config.AccessToken.ValueString() } - if config.Url.ValueString() != "" { - url = config.Url.ValueString() - } - if accessToken == "" { resp.Diagnostics.AddError( - "Missing Access AccessToken Configuration", + "Missing JFrog Access Token", "While configuring the provider, the Access Token was not found in "+ "the JFROG_ACCESS_TOKEN environment variable or provider "+ "configuration block access_token attribute.", @@ -103,33 +96,26 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config return } - if url == "" { - resp.Diagnostics.AddError( - "Missing URL Configuration", - "While configuring the provider, the url was not found in "+ - "the JFROG_URL/ARTIFACTORY_URL environment variables or provider "+ - "configuration block url attribute.", - ) - return + if config.Url.ValueString() != "" { + url = config.Url.ValueString() } restyBase, err := client.Build(url, productId) if err != nil { resp.Diagnostics.AddError( "Error creating Resty client", - fmt.Sprintf("%v", err), + err.Error(), ) } restyBase, err = client.AddAuth(restyBase, "", accessToken) if err != nil { resp.Diagnostics.AddError( "Error adding Auth to Resty client", - fmt.Sprintf("%v", err), + err.Error(), ) } if config.CheckLicense.IsNull() || config.CheckLicense.ValueBool() { - licenseErr := utilsdk.CheckArtifactoryLicense(restyBase, "Enterprise", "Commercial", "Edge") - if licenseErr != nil { + if licenseErr := utilsdk.CheckArtifactoryLicense(restyBase, "Enterprise", "Commercial", "Edge"); licenseErr != nil { resp.Diagnostics.AddError( "Error getting Artifactory license", fmt.Sprintf("%v", licenseErr), @@ -140,15 +126,15 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config version, err := utilsdk.GetArtifactoryVersion(restyBase) if err != nil { - resp.Diagnostics.AddError( + resp.Diagnostics.AddWarning( "Error getting Artifactory version", - "The provider functionality might be affected by the absence of Artifactory version in the context.", + fmt.Sprintf("The provider functionality might be affected by the absence of Artifactory version in the context. %v", err), ) return } featureUsage := fmt.Sprintf("Terraform/%s", req.TerraformVersion) - utilsdk.SendUsage(ctx, restyBase, "terraform-provider-artifactory/"+Version, featureUsage) + utilsdk.SendUsage(ctx, restyBase, productId, featureUsage) resp.DataSourceData = utilsdk.ProvderMetadata{ Client: restyBase, diff --git a/pkg/artifactory/provider/sdkv2.go b/pkg/artifactory/provider/sdkv2.go index a651c202c..741d1a83d 100644 --- a/pkg/artifactory/provider/sdkv2.go +++ b/pkg/artifactory/provider/sdkv2.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -20,7 +19,7 @@ func SdkV2() *schema.Provider { Schema: map[string]*schema.Schema{ "url": { Type: schema.TypeString, - Optional: true, + Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.IsURLWithHTTPorHTTPS), Description: "Artifactory URL.", }, @@ -28,9 +27,8 @@ func SdkV2() *schema.Provider { Type: schema.TypeString, Optional: true, Sensitive: true, - ConflictsWith: []string{"access_token"}, ValidateDiagFunc: validator.StringIsNotEmpty, - Description: "API token. Projects functionality will not work with any auth method other than access tokens", + Description: "API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set, the provider will ignore this attribute.", Deprecated: "An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).\n" + "In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys.\n" + "By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available.", @@ -53,9 +51,6 @@ func SdkV2() *schema.Provider { } p.ConfigureContextFunc = func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - tflog.Debug(ctx, "ConfigureContextFunc") - tflog.Info(ctx, fmt.Sprintf("Provider version: %s", Version)) - terraformVersion := p.TerraformVersion if terraformVersion == "" { terraformVersion = "0.11+compatible" @@ -68,17 +63,15 @@ func SdkV2() *schema.Provider { // Creates the client for artifactory, will prefer token auth over basic auth if both set func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVersion string) (interface{}, diag.Diagnostics) { - tflog.Debug(ctx, "providerConfigure") - // Check environment variables, first available OS variable will be assigned to the var url := CheckEnvVars([]string{"JFROG_URL", "ARTIFACTORY_URL"}, "http://localhost:8082") accessToken := CheckEnvVars([]string{"JFROG_ACCESS_TOKEN", "ARTIFACTORY_ACCESS_TOKEN"}, "") - if d.Get("url") != "" { - url = d.Get("url").(string) + if v, ok := d.GetOk("url"); ok { + url = v.(string) } - if d.Get("access_token") != "" { - accessToken = d.Get("access_token").(string) + if v, ok := d.GetOk("access_token"); ok && v != "" { + accessToken = v.(string) } apiKey := d.Get("api_key").(string) @@ -107,7 +100,11 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer version, err := utilsdk.GetArtifactoryVersion(restyBase) if err != nil { - return nil, diag.FromErr(err) + return nil, diag.Diagnostics{{ + Severity: diag.Warning, + Summary: "Error getting Artifactory version", + Detail: fmt.Sprintf("The provider functionality might be affected by the absence of Artifactory version in the context. %v", err), + }} } featureUsage := fmt.Sprintf("Terraform/%s", terraformVersion) From 966c91a7d2a534018263dd33d8abf563fceff3ad Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 18 Oct 2023 15:41:06 -0700 Subject: [PATCH 02/44] Put api_key back to framework provider Add url empty check --- pkg/artifactory/provider/framework.go | 25 +++++++++++++++++++++---- pkg/artifactory/provider/sdkv2.go | 10 ++++++++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/pkg/artifactory/provider/framework.go b/pkg/artifactory/provider/framework.go index 48eab958f..8066c6963 100644 --- a/pkg/artifactory/provider/framework.go +++ b/pkg/artifactory/provider/framework.go @@ -29,6 +29,7 @@ type ArtifactoryProvider struct{} type ArtifactoryProviderModel struct { Url types.String `tfsdk:"url"` AccessToken types.String `tfsdk:"access_token"` + ApiKey types.String `tfsdk:"api_key"` CheckLicense types.Bool `tfsdk:"check_license"` } @@ -44,7 +45,7 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq Attributes: map[string]schema.Attribute{ "url": schema.StringAttribute{ Description: "Artifactory URL.", - Required: true, + Optional: true, Validators: []validator.String{ validatorfw_string.IsURLHttpOrHttps(), }, @@ -57,6 +58,12 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq stringvalidator.LengthAtLeast(1), }, }, + "api_key": schema.StringAttribute{ + Description: "API token. Projects functionality will not work with any auth method other than access tokens", + DeprecationMessage: "An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available.", + Optional: true, + Sensitive: true, + }, "check_license": schema.BoolAttribute{ Description: "Toggle for pre-flight checking of Artifactory Pro and Enterprise license. Default to `true`.", Optional: true, @@ -66,8 +73,6 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq } func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { - // Provider specific implementation. - // Check environment variables, first available OS variable will be assigned to the var url := CheckEnvVars([]string{"JFROG_URL", "ARTIFACTORY_URL"}, "") accessToken := CheckEnvVars([]string{"JFROG_ACCESS_TOKEN", "ARTIFACTORY_ACCESS_TOKEN"}, "") @@ -90,7 +95,7 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config resp.Diagnostics.AddError( "Missing JFrog Access Token", "While configuring the provider, the Access Token was not found in "+ - "the JFROG_ACCESS_TOKEN environment variable or provider "+ + "the JFROG_ACCESS_TOKEN/ARTIFACTORY_ACCESS_TOKEN environment variable or provider "+ "configuration block access_token attribute.", ) return @@ -100,6 +105,16 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config url = config.Url.ValueString() } + if url == "" { + resp.Diagnostics.AddError( + "Missing URL Configuration", + "While configuring the provider, the url was not found in "+ + "the JFROG_URL/ARTIFACTORY_URL environment variable or provider "+ + "configuration block url attribute.", + ) + return + } + restyBase, err := client.Build(url, productId) if err != nil { resp.Diagnostics.AddError( @@ -107,6 +122,7 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config err.Error(), ) } + restyBase, err = client.AddAuth(restyBase, "", accessToken) if err != nil { resp.Diagnostics.AddError( @@ -114,6 +130,7 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config err.Error(), ) } + if config.CheckLicense.IsNull() || config.CheckLicense.ValueBool() { if licenseErr := utilsdk.CheckArtifactoryLicense(restyBase, "Enterprise", "Commercial", "Edge"); licenseErr != nil { resp.Diagnostics.AddError( diff --git a/pkg/artifactory/provider/sdkv2.go b/pkg/artifactory/provider/sdkv2.go index 741d1a83d..3ce5c47be 100644 --- a/pkg/artifactory/provider/sdkv2.go +++ b/pkg/artifactory/provider/sdkv2.go @@ -19,7 +19,7 @@ func SdkV2() *schema.Provider { Schema: map[string]*schema.Schema{ "url": { Type: schema.TypeString, - Required: true, + Optional: true, ValidateDiagFunc: validation.ToDiagFunc(validation.IsURLWithHTTPorHTTPS), Description: "Artifactory URL.", }, @@ -64,15 +64,20 @@ func SdkV2() *schema.Provider { // Creates the client for artifactory, will prefer token auth over basic auth if both set func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVersion string) (interface{}, diag.Diagnostics) { // Check environment variables, first available OS variable will be assigned to the var - url := CheckEnvVars([]string{"JFROG_URL", "ARTIFACTORY_URL"}, "http://localhost:8082") + url := CheckEnvVars([]string{"JFROG_URL", "ARTIFACTORY_URL"}, "") accessToken := CheckEnvVars([]string{"JFROG_ACCESS_TOKEN", "ARTIFACTORY_ACCESS_TOKEN"}, "") if v, ok := d.GetOk("url"); ok { url = v.(string) } + if url == "" { + return nil, diag.Errorf("missing URL Configuration") + } + if v, ok := d.GetOk("access_token"); ok && v != "" { accessToken = v.(string) } + apiKey := d.Get("api_key").(string) restyBase, err := client.Build(url, productId) @@ -84,6 +89,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer if err != nil { return nil, diag.FromErr(err) } + // Due to migration from SDK v2 to plugin framework, we have to remove defaults from the provider configuration. // https://discuss.hashicorp.com/t/muxing-upgraded-tfsdk-and-framework-provider-with-default-provider-configuration/43945 checkLicense := true From 56edfa4d78fddb2557aabd5a314eb389066767cc Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 18 Oct 2023 15:47:46 -0700 Subject: [PATCH 03/44] Update CHANGELOG --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a0f259cc..677ba6da7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 9.7.1 (Oct 19, 2023) + +IMPROVEMENTS: + +* provider: + * Remove conflict validation between `access_token` and `api_key` attributes. If set, `access_token` will take precedent over `api_key`. + * Update documentation to align with actual provider behavior. + +PR: [#832](https://github.com/jfrog/terraform-provider-artifactory/pull/832) +Issue: [#663](https://github.com/jfrog/terraform-provider-artifactory/issues/663) + ## 9.7.0 (Oct 18, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.1 IMPROVEMENTS: From d32f5e1bf066ec52be064a596fea84a431fecdd6 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Wed, 18 Oct 2023 23:11:38 +0000 Subject: [PATCH 04/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 677ba6da7..dfdec8a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.1 (Oct 19, 2023) +## 9.7.1 (Oct 19, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.2 IMPROVEMENTS: From 4d0195450a2c08be8d971e77554671701d759767 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 19 Oct 2023 14:47:48 -0700 Subject: [PATCH 05/44] Make provider attributes match between SDKv2 and framework providers --- pkg/artifactory/provider/framework.go | 6 +++--- pkg/artifactory/provider/sdkv2.go | 2 +- sample.tf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/artifactory/provider/framework.go b/pkg/artifactory/provider/framework.go index 8066c6963..d25b8c2b6 100644 --- a/pkg/artifactory/provider/framework.go +++ b/pkg/artifactory/provider/framework.go @@ -51,7 +51,7 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq }, }, "access_token": schema.StringAttribute{ - Description: "This is a access token that can be given to you by your admin under `User Management -> Access Tokens`.", + Description: "This is a access token that can be given to you by your admin under `User Management -> Access Tokens`. If not set, the 'api_key' attribute value will be used.", Optional: true, Sensitive: true, Validators: []validator.String{ @@ -59,7 +59,7 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq }, }, "api_key": schema.StringAttribute{ - Description: "API token. Projects functionality will not work with any auth method other than access tokens", + Description: "API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set, the provider will ignore this attribute.", DeprecationMessage: "An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available.", Optional: true, Sensitive: true, @@ -123,7 +123,7 @@ func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.Config ) } - restyBase, err = client.AddAuth(restyBase, "", accessToken) + restyBase, err = client.AddAuth(restyBase, config.ApiKey.ValueString(), accessToken) if err != nil { resp.Diagnostics.AddError( "Error adding Auth to Resty client", diff --git a/pkg/artifactory/provider/sdkv2.go b/pkg/artifactory/provider/sdkv2.go index 3ce5c47be..98c88b8ef 100644 --- a/pkg/artifactory/provider/sdkv2.go +++ b/pkg/artifactory/provider/sdkv2.go @@ -37,7 +37,7 @@ func SdkV2() *schema.Provider { Type: schema.TypeString, Optional: true, Sensitive: true, - Description: "This is a access token that can be given to you by your admin under `Identity and Access`. If not set, the 'api_key' attribute value will be used.", + Description: "This is a access token that can be given to you by your admin under `User Management -> Access Tokens`. If not set, the 'api_key' attribute value will be used.", }, "check_license": { Type: schema.TypeBool, diff --git a/sample.tf b/sample.tf index e493a783c..dafe02e7a 100644 --- a/sample.tf +++ b/sample.tf @@ -3,7 +3,7 @@ terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "7.10.1" + version = "9.7.2" } } } From 2d5f2c2441b5bf6a9740d609637b6cc844300c3f Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 19 Oct 2023 14:50:09 -0700 Subject: [PATCH 06/44] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfdec8a8e..0edc346f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.7.2 (Oct 19, 2023). + +BUG FIX: + +* provider: Fix schema differences between SDKv2 and Framework providers. PR: [#834](https://github.com/jfrog/terraform-provider-artifactory/pull/834) Issue: [#833](https://github.com/jfrog/terraform-provider-artifactory/issues/833) + ## 9.7.1 (Oct 19, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.2 IMPROVEMENTS: From 7404b611440eedad49b5493fefe5cf4678c4076a Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Thu, 19 Oct 2023 23:02:20 +0000 Subject: [PATCH 07/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0edc346f1..a0821fd10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.2 (Oct 19, 2023). +## 9.7.2 (Oct 19, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.2 BUG FIX: From 7ce2b7638e1665ebf5584b8c953623e509bc7f43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 22:43:20 +0000 Subject: [PATCH 08/44] Bump google.golang.org/grpc from 1.56.1 to 1.56.3 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.1 to 1.56.3. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.56.1...v1.56.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 84219a42b..84da5a327 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( golang.org/x/sys v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.1 // indirect + google.golang.org/grpc v1.56.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect ) diff --git a/go.sum b/go.sum index ccd04d305..f730192c8 100644 --- a/go.sum +++ b/go.sum @@ -233,8 +233,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= From cafb6c30a182bed1272864645e3a354445ea2bce Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Wed, 25 Oct 2023 23:33:56 +0000 Subject: [PATCH 09/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0821fd10..cac066eb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.2 (Oct 19, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.2 +## 9.7.2 (Oct 19, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.2 BUG FIX: From d3ede7caef1f42e722fb76836ff3a7e6fc7eac46 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 13:26:47 -0700 Subject: [PATCH 10/44] Fix out-of-dated package path in goreleaser and makefile --- .goreleaser.yml | 2 +- GNUmakefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 356032c13..84c440023 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -14,7 +14,7 @@ builds: flags: - -trimpath ldflags: - - '-s -w -X github.com/jfrog/terraform-provider-artifactory/v6/pkg/artifactory/provider.Version={{.Version}}' + - '-s -w -X github.com/jfrog/terraform-provider-artifactory/v{{.Major}}/pkg/artifactory/provider.Version={{.Version}}' goos: - freebsd - windows diff --git a/GNUmakefile b/GNUmakefile index 7616841a8..a0bfe3ab7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,9 +9,10 @@ GORELEASER_ARCH=${TARGET_ARCH}_$(shell go env GOAMD64) endif PKG_NAME=pkg/artifactory # if this path ever changes, you need to also update the 'ldflags' value in .goreleaser.yml -PKG_VERSION_PATH=github.com/jfrog/terraform-provider-${PRODUCT}/${PKG_NAME} PROVIDER_VERSION?=$(shell git describe --tags --abbrev=0 | sed -n 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1.\2.\3/p') +PROVIDER_MAJOR_VERSION?=$(shell echo ${PROVIDER_VERSION}| awk -F '.' '{print $$1}' ) NEXT_PROVIDER_VERSION := $(shell echo ${PROVIDER_VERSION}| awk -F '.' '{print $$1 "." $$2 "." $$3 +1 }' ) +PKG_VERSION_PATH=github.com/jfrog/terraform-provider-${PRODUCT}/v${PROVIDER_MAJOR_VERSION}/${PKG_NAME} BUILD_PATH=terraform.d/plugins/registry.terraform.io/jfrog/${PRODUCT}/${NEXT_PROVIDER_VERSION}/${TARGET_ARCH} SONAR_SCANNER_VERSION?=4.7.0.2747 SONAR_SCANNER_HOME?=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx From 41a4ca083c4579724cf69ff48268befce8d808af Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 13:27:41 -0700 Subject: [PATCH 11/44] Update README and doc To add which Terraform CLI version we currently support and the deprecation of protocol v5. --- README.md | 15 ++++++++++++--- docs/index.md | 7 ++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 04d50a3b6..71600d32d 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,23 @@ ## Releases -Current provider major release: **7.x** +Current provider major release: **9.x** See [CHANGELOG.md](CHANGELOG.md) for full details ## Versions -We maintain two major versions of Terraform Provider - 6.x and 7.x. Version 6.x is compatible with the Artifactory versions 7.49.x and below, -version 7.x is only compatible with Artifactory 7.50.x and above due to changes in the projects functionality. +Version 6.x is compatible with the Artifactory versions 7.49.x and below. + +Version 7.x and 8.x is only compatible with Artifactory between 7.50.x and 7.67.x due to changes in the projects functionality. + +Version 9.x is the latest major version and is compatible with latest Artifactory versions (>=7.68.7 (self-hosted) and >=7.67.0 (cloud)). + +## Terraform CLI version support + +Current version support [Terraform Protocol v5](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-5) which mean Terraform CLI version 0.12 and later. + +~>We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. ## Quick Start diff --git a/docs/index.md b/docs/index.md index 211f4ee12..06d07be2e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,9 +15,14 @@ curl -sL ${host}/artifactory/api/system/licenses/ | jq . "validThrough" : "Jan 29, 2022", "licensedTo" : "JFrog Ltd" } - ``` +## Terraform CLI version support + +Current version support [Terraform Protocol v5](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-5) which mean Terraform CLI version 0.12 and later. + +~>We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. + ## Example Usage ```tf # Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html) From 6641c7a7386879a987de2746e804d21f8252d212 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 15:16:02 -0700 Subject: [PATCH 12/44] Add Terraform CLI deprecation warning to provider Update sample.tf to remove warnings --- pkg/acctest/test.go | 6 ------ pkg/artifactory/provider/framework.go | 14 ++++++++++++++ pkg/artifactory/provider/sdkv2.go | 24 ++++++++++++++++++++++-- sample.tf | 8 +++++--- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/pkg/acctest/test.go b/pkg/acctest/test.go index 1f67f96ba..ad825b1a0 100644 --- a/pkg/acctest/test.go +++ b/pkg/acctest/test.go @@ -17,7 +17,6 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - terraform2 "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -96,11 +95,6 @@ func PreCheck(t *testing.T) { if err != nil { t.Fatalf("Failed to set custom base URL: %v", err) } - - configErr := Provider.Configure(context.Background(), (*terraform2.ResourceConfig)(terraform.NewResourceConfigRaw(nil))) - if configErr != nil { - t.Fatalf("Failed to configure provider %v", configErr) - } }) } diff --git a/pkg/artifactory/provider/framework.go b/pkg/artifactory/provider/framework.go index d25b8c2b6..d33641d80 100644 --- a/pkg/artifactory/provider/framework.go +++ b/pkg/artifactory/provider/framework.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -73,6 +74,19 @@ func (p *ArtifactoryProvider) Schema(ctx context.Context, req provider.SchemaReq } func (p *ArtifactoryProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) { + // check if Terraform version is >=1.0.0, i.e. support protocol v6 + supportProtocolV6, err := utilsdk.CheckVersion(req.TerraformVersion, "1.0.0") + if err != nil { + resp.Diagnostics.Append(diag.NewWarningDiagnostic("failed to check Terraform version", err.Error())) + } + + if !supportProtocolV6 { + resp.Diagnostics.Append(diag.NewWarningDiagnostic( + "Terraform CLI version deprecation", + "Terraform version older than 1.0 will no longer be supported in Q1 2024. Please upgrade to latest Terraform CLI.", + )) + } + // Check environment variables, first available OS variable will be assigned to the var url := CheckEnvVars([]string{"JFROG_URL", "ARTIFACTORY_URL"}, "") accessToken := CheckEnvVars([]string{"JFROG_ACCESS_TOKEN", "ARTIFACTORY_ACCESS_TOKEN"}, "") diff --git a/pkg/artifactory/provider/sdkv2.go b/pkg/artifactory/provider/sdkv2.go index 98c88b8ef..531e8fcc0 100644 --- a/pkg/artifactory/provider/sdkv2.go +++ b/pkg/artifactory/provider/sdkv2.go @@ -50,12 +50,32 @@ func SdkV2() *schema.Provider { DataSourcesMap: datasourcesMap(), } - p.ConfigureContextFunc = func(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { + p.ConfigureContextFunc = func(ctx context.Context, data *schema.ResourceData) (interface{}, diag.Diagnostics) { terraformVersion := p.TerraformVersion if terraformVersion == "" { terraformVersion = "0.11+compatible" } - return providerConfigure(ctx, d, terraformVersion) + + var ds diag.Diagnostics + // check if Terraform version is >=1.0.0, i.e. support protocol v6 + supportProtocolV6, err := utilsdk.CheckVersion(terraformVersion, "1.0.0") + if err != nil { + ds = append(ds, diag.FromErr(err)...) + } + + if !supportProtocolV6 { + ds = append(ds, diag.Diagnostics{{ + Severity: diag.Warning, + Summary: "Terraform CLI version deprecation", + Detail: "Terraform version older than 1.0 will no longer be supported in Q1 2024. Please upgrade to latest Terraform CLI.", + }}...) + } + + meta, d := providerConfigure(ctx, data, terraformVersion) + if d != nil { + ds = append(ds, d...) + } + return meta, ds } return p diff --git a/sample.tf b/sample.tf index dafe02e7a..521922bc8 100644 --- a/sample.tf +++ b/sample.tf @@ -3,7 +3,7 @@ terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "9.7.2" + version = "9.7.3" } } } @@ -27,11 +27,13 @@ resource "artifactory_scoped_token" "admin" { } output "user-scoped-token" { - value = artifactory_scoped_token.user + value = artifactory_scoped_token.user + sensitive = true } output "admin-scoped-token" { - value = artifactory_scoped_token.admin + value = artifactory_scoped_token.admin + sensitive = true } resource "artifactory_local_bower_repository" "bower-local" { From bab3381db304baab3545911bbaafbc67f4abb0cf Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 11:26:08 -0700 Subject: [PATCH 13/44] Add manual sync of federated repo config on create and update --- .../repository/federated/federated.go | 64 ++++++++++- ...e_artifactory_federated_repository_test.go | 24 +++- .../resource/repository/repository.go | 108 ++++++++++-------- 3 files changed, 144 insertions(+), 52 deletions(-) diff --git a/pkg/artifactory/resource/repository/federated/federated.go b/pkg/artifactory/resource/repository/federated/federated.go index 95022b0f8..404313e3b 100644 --- a/pkg/artifactory/resource/repository/federated/federated.go +++ b/pkg/artifactory/resource/repository/federated/federated.go @@ -7,6 +7,7 @@ import ( "net/url" "strings" + "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -122,13 +123,70 @@ func PackMembers(members []Member, d *schema.ResourceData) error { } errors := setValue("member", federatedMembers) - if errors != nil && len(errors) > 0 { + if len(errors) > 0 { return fmt.Errorf("failed saving members to state %q", errors) } return nil } +func configSync(ctx context.Context, repoKey string, m interface{}) diag.Diagnostics { + var ds diag.Diagnostics + + tflog.Info(ctx, + "triggering synchronization of the federated member configuration", + map[string]interface{}{ + "repoKey": repoKey, + }, + ) + _, restErr := m.(utilsdk.ProvderMetadata).Client.R(). + SetPathParam("repositoryKey", repoKey). + Post("artifactory/api/federation/configSync/{repositoryKey}") + if restErr != nil { + ds = append(ds, diag.Diagnostic{ + Severity: diag.Warning, + Summary: "failed to trigger synchronization of the federated member configuration", + Detail: restErr.Error(), + }) + } + + return ds +} + +func createRepo(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.CreateContextFunc { + return func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var ds diag.Diagnostics + ds = append(ds, repository.Create(ctx, d, m, unpack)...) + if ds.HasError() { + return ds + } + + ds = append(ds, configSync(ctx, d.Id(), m)...) + if ds.HasError() { + return ds + } + + return append(ds, read(ctx, d, m)...) + } +} + +func updateRepo(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.UpdateContextFunc { + return func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var ds diag.Diagnostics + ds = append(ds, repository.Update(ctx, d, m, unpack)...) + if ds.HasError() { + return ds + } + + ds = append(ds, configSync(ctx, d.Id(), m)...) + if ds.HasError() { + return ds + } + + return append(ds, read(ctx, d, m)...) + } +} + func deleteRepo(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // For federated repositories we delete all the federated members (except the initial repo member), if the flag `cleanup_on_delete` is set to `true` s := &utilsdk.ResourceData{ResourceData: d} @@ -173,9 +231,9 @@ func deleteRepo(_ context.Context, d *schema.ResourceData, m interface{}) diag.D func mkResourceSchema(skeema map[string]*schema.Schema, packer packer.PackFunc, unpack unpacker.UnpackFunc, constructor repository.Constructor) *schema.Resource { var reader = repository.MkRepoRead(packer, constructor) return &schema.Resource{ - CreateContext: repository.MkRepoCreate(unpack, reader), + CreateContext: createRepo(unpack, reader), ReadContext: reader, - UpdateContext: repository.MkRepoUpdate(unpack, reader), + UpdateContext: updateRepo(unpack, reader), DeleteContext: deleteRepo, Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go index 9fde6c4c1..820681833 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go @@ -53,7 +53,19 @@ func TestAccFederatedRepoWithMembers(t *testing.T) { "member1Url": federatedMember1Url, "member2Url": federatedMember2Url, } - federatedRepositoryConfig := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfigWithMembers", ` + config := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfigWithMembers", ` + resource "{{ .resourceType }}" "{{ .name }}" { + key = "{{ .name }}" + description = "Test federated repo for {{ .name }}" + notes = "Test federated repo for {{ .name }}" + + member { + url = "{{ .member1Url }}" + enabled = true + } + } + `, params) + updatedConfig := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfigWithMembers", ` resource "{{ .resourceType }}" "{{ .name }}" { key = "{{ .name }}" description = "Test federated repo for {{ .name }}" @@ -77,7 +89,15 @@ func TestAccFederatedRepoWithMembers(t *testing.T) { CheckDestroy: acctest.VerifyDeleted(fqrn, acctest.CheckRepo), Steps: []resource.TestStep{ { - Config: federatedRepositoryConfig, + Config: config, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fqrn, "member.#", "1"), + resource.TestCheckResourceAttr(fqrn, "member.0.url", federatedMember1Url), + resource.TestCheckResourceAttr(fqrn, "member.0.enabled", "true"), + ), + }, + { + Config: updatedConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(fqrn, "member.#", "2"), resource.TestCheckResourceAttr(fqrn, "member.0.url", federatedMember2Url), diff --git a/pkg/artifactory/resource/repository/repository.go b/pkg/artifactory/resource/repository/repository.go index 7552f8cc9..a813469b3 100644 --- a/pkg/artifactory/resource/repository/repository.go +++ b/pkg/artifactory/resource/repository/repository.go @@ -8,7 +8,6 @@ import ( "github.com/go-resty/resty/v2" "github.com/hashicorp/go-cty/cty" - "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -123,24 +122,33 @@ type ReadFunc func(d *schema.ResourceData, m interface{}) error // Constructor Must return a pointer to a struct. When just returning a struct, resty gets confused and thinks it's a map type Constructor func() (interface{}, error) -func MkRepoCreate(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.CreateContextFunc { +func Create(ctx context.Context, d *schema.ResourceData, m interface{}, unpack unpacker.UnpackFunc) diag.Diagnostics { + repo, key, err := unpack(d) + if err != nil { + return diag.FromErr(err) + } + // repo must be a pointer + _, err = m.(utilsdk.ProvderMetadata).Client.R(). + AddRetryCondition(client.RetryOnMergeError). + SetBody(repo). + SetPathParam("key", key). + Put(RepositoriesEndpoint) + + if err != nil { + return diag.FromErr(err) + } + d.SetId(key) + return nil +} + +func MkRepoCreate(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.CreateContextFunc { return func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - repo, key, err := unpack(d) + err := Create(ctx, d, m, unpack) if err != nil { - return diag.FromErr(err) + return err } - // repo must be a pointer - _, err = m.(utilsdk.ProvderMetadata).Client.R(). - AddRetryCondition(client.RetryOnMergeError). - SetBody(repo). - SetPathParam("key", key). - Put(RepositoriesEndpoint) - if err != nil { - return diag.FromErr(err) - } - d.SetId(key) return read(ctx, d, m) } } @@ -169,46 +177,52 @@ func MkRepoRead(pack packer.PackFunc, construct Constructor) schema.ReadContextF } } -func MkRepoUpdate(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.UpdateContextFunc { - return func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { - repo, key, err := unpack(d) - if err != nil { - return diag.FromErr(err) +func Update(ctx context.Context, d *schema.ResourceData, m interface{}, unpack unpacker.UnpackFunc) diag.Diagnostics { + repo, key, err := unpack(d) + if err != nil { + return diag.FromErr(err) + } + + _, err = m.(utilsdk.ProvderMetadata).Client.R(). + AddRetryCondition(client.RetryOnMergeError). + SetBody(repo). + SetPathParam("key", d.Id()). + Post(RepositoriesEndpoint) + if err != nil { + return diag.FromErr(err) + } + + d.SetId(key) + + projectKeyChanged := d.HasChange("project_key") + if projectKeyChanged { + old, newProject := d.GetChange("project_key") + oldProjectKey := old.(string) + newProjectKey := newProject.(string) + + assignToProject := oldProjectKey == "" && len(newProjectKey) > 0 + unassignFromProject := len(oldProjectKey) > 0 && newProjectKey == "" + + var err error + if assignToProject { + err = assignRepoToProject(key, newProjectKey, m.(utilsdk.ProvderMetadata).Client) + } else if unassignFromProject { + err = unassignRepoFromProject(key, m.(utilsdk.ProvderMetadata).Client) } - _, err = m.(utilsdk.ProvderMetadata).Client.R(). - AddRetryCondition(client.RetryOnMergeError). - SetBody(repo). - SetPathParam("key", d.Id()). - Post(RepositoriesEndpoint) if err != nil { return diag.FromErr(err) } + } - d.SetId(key) - - projectKeyChanged := d.HasChange("project_key") - tflog.Debug(ctx, fmt.Sprintf("projectKeyChanged: %v", projectKeyChanged)) - if projectKeyChanged { - old, newProject := d.GetChange("project_key") - oldProjectKey := old.(string) - newProjectKey := newProject.(string) - tflog.Debug(ctx, fmt.Sprintf("oldProjectKey: %v, newProjectKey: %v", oldProjectKey, newProjectKey)) - - assignToProject := oldProjectKey == "" && len(newProjectKey) > 0 - unassignFromProject := len(oldProjectKey) > 0 && newProjectKey == "" - tflog.Debug(ctx, fmt.Sprintf("assignToProject: %v, unassignFromProject: %v", assignToProject, unassignFromProject)) - - var err error - if assignToProject { - err = assignRepoToProject(key, newProjectKey, m.(utilsdk.ProvderMetadata).Client) - } else if unassignFromProject { - err = unassignRepoFromProject(key, m.(utilsdk.ProvderMetadata).Client) - } + return nil +} - if err != nil { - return diag.FromErr(err) - } +func MkRepoUpdate(unpack unpacker.UnpackFunc, read schema.ReadContextFunc) schema.UpdateContextFunc { + return func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + err := Update(ctx, d, m, unpack) + if err != nil { + return err } return read(ctx, d, m) From 6faf677a3b05012eab36fad1c72d9fa6ccc8983c Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 16:14:05 -0700 Subject: [PATCH 14/44] Fix test provider configuration --- pkg/acctest/test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/acctest/test.go b/pkg/acctest/test.go index ad825b1a0..989187309 100644 --- a/pkg/acctest/test.go +++ b/pkg/acctest/test.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-mux/tf5muxserver" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + terraform2 "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/plancheck" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -93,7 +94,12 @@ func PreCheck(t *testing.T) { SetHeader("Content-Type", "text/plain"). Put("/artifactory/api/system/configuration/baseUrl") if err != nil { - t.Fatalf("Failed to set custom base URL: %v", err) + t.Fatalf("failed to set custom base URL: %v", err) + } + + configErr := Provider.Configure(context.Background(), (*terraform2.ResourceConfig)(terraform2.NewResourceConfigRaw(nil))) + if configErr != nil && configErr.HasError() { + t.Fatalf("failed to configure provider %v", configErr) } }) } From 072041f8835fc1b21b4c595a04f30ee688097487 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 1 Nov 2023 16:15:01 -0700 Subject: [PATCH 15/44] Update CHANGELOG --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cac066eb9..b3a1993a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## 9.7.3 (Nov 2, 2023) + +SECURITY: + +* provider: Bump google.golang.org/grpc from 1.56.1 to 1.56.3 PR: [#836](https://github.com/jfrog/terraform-provider-artifactory/pull/836) + +IMPROVEMENTS: + +* resource/artifactory_federated_*_repository: Add configuration synchronization when creating or updating resource. Issue: [#825](https://github.com/jfrog/terraform-provider-artifactory/issues/825) +* provider: Add warning message for Terraform CLI version <1.0.0 deprecation + +PR: [#840](https://github.com/jfrog/terraform-provider-artifactory/pull/840) + +NOTES: + +We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. + ## 9.7.2 (Oct 19, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.2 BUG FIX: From 83de1dec0092de45ebaf657e4a27c60f3d900548 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Wed, 1 Nov 2023 23:40:49 +0000 Subject: [PATCH 16/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3a1993a0..34d05f0ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.3 (Nov 2, 2023) +## 9.7.3 (Nov 2, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.3 SECURITY: From 68ff74028510ff7cf40bf645eeca31b5a8bd6e06 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 3 Nov 2023 09:36:16 -0700 Subject: [PATCH 17/44] Revert permission target resource back to SDKv2 version --- pkg/artifactory/provider/framework.go | 1 - pkg/artifactory/provider/resources.go | 1 + .../resource_artifactory_permission_target.go | 685 +++++++----------- ...urce_artifactory_permission_target_test.go | 20 +- 4 files changed, 287 insertions(+), 420 deletions(-) diff --git a/pkg/artifactory/provider/framework.go b/pkg/artifactory/provider/framework.go index d33641d80..9a9cb2ef4 100644 --- a/pkg/artifactory/provider/framework.go +++ b/pkg/artifactory/provider/framework.go @@ -186,7 +186,6 @@ func (p *ArtifactoryProvider) Resources(ctx context.Context) []func() resource.R user.NewAnonymousUserResource, security.NewGroupResource, security.NewScopedTokenResource, - security.NewPermissionTargetResource, security.NewGlobalEnvironmentResource, security.NewDistributionPublicKeyResource, security.NewCertificateResource, diff --git a/pkg/artifactory/provider/resources.go b/pkg/artifactory/provider/resources.go index 77970e6b0..9ae82b370 100644 --- a/pkg/artifactory/provider/resources.go +++ b/pkg/artifactory/provider/resources.go @@ -69,6 +69,7 @@ func resourcesMap() map[string]*schema.Resource { "artifactory_virtual_rpm_repository": virtual.ResourceArtifactoryVirtualRpmRepository(), "artifactory_virtual_helm_repository": virtual.ResourceArtifactoryVirtualHelmRepository(), "artifactory_unmanaged_user": user.ResourceArtifactoryUser(), // alias of artifactory_user + "artifactory_permission_target": security.ResourceArtifactoryPermissionTarget(), "artifactory_pull_replication": replication.ResourceArtifactoryPullReplication(), "artifactory_push_replication": replication.ResourceArtifactoryPushReplication(), "artifactory_local_repository_single_replication": replication.ResourceArtifactoryLocalRepositorySingleReplication(), diff --git a/pkg/artifactory/resource/security/resource_artifactory_permission_target.go b/pkg/artifactory/resource/security/resource_artifactory_permission_target.go index d164e58e1..e2e32dbaf 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_permission_target.go +++ b/pkg/artifactory/resource/security/resource_artifactory_permission_target.go @@ -3,238 +3,33 @@ package security import ( "context" "net/http" + "strings" - "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" - "github.com/hashicorp/terraform-plugin-framework/attr" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/path" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/setdefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - utilfw "github.com/jfrog/terraform-provider-shared/util/fw" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" - validatorfw "github.com/jfrog/terraform-provider-shared/validator/fw" + + "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository" ) const PermissionsEndPoint = "artifactory/api/v2/security/permissions/" +const ( + PermRead = "read" + PermWrite = "write" + PermAnnotate = "annotate" + PermDelete = "delete" + PermManage = "manage" + PermManagedXrayMeta = "managedXrayMeta" + PermDistribute = "distribute" +) -func NewPermissionTargetResource() resource.Resource { - return &PermissionTargetResource{} -} - -type PermissionTargetResource struct { - ProviderData utilsdk.ProvderMetadata -} - -// PermissionTargetResourceModel describes the Terraform resource data model to match the -// resource schema. -type PermissionTargetResourceModel struct { - Id types.String `tfsdk:"id"` - Name types.String `tfsdk:"name"` - Repo types.Set `tfsdk:"repo"` - Build types.Set `tfsdk:"build"` - ReleaseBundle types.Set `tfsdk:"release_bundle"` -} - -func (r *PermissionTargetResourceModel) toActionsAPIModel(ctx context.Context, resourceActions types.Set) Actions { - setToMap := func(sourceSet types.Set, mapToUpdate *map[string][]string) { - for _, setElement := range sourceSet.Elements() { - attrs := setElement.(types.Object).Attributes() - permissions := utilfw.StringSetToStrings(attrs["permissions"].(types.Set)) - (*mapToUpdate)[attrs["name"].(types.String).ValueString()] = permissions - } - } - - actions := Actions{ - Users: map[string][]string{}, - Groups: map[string][]string{}, - } - - if len(resourceActions.Elements()) > 0 { - actionsElm := resourceActions.Elements()[0].(types.Object) - actionsAttrs := actionsElm.Attributes() - setToMap(actionsAttrs["users"].(types.Set), &actions.Users) - setToMap(actionsAttrs["groups"].(types.Set), &actions.Groups) - } - - return actions -} - -func (r *PermissionTargetResourceModel) toSectionAPIModel(ctx context.Context, resourceSection types.Set) *PermissionTargetSection { - if resourceSection.IsUnknown() || resourceSection.IsNull() { - return nil - } - sectionElms := resourceSection.Elements() - sectionAttrs := sectionElms[0].(types.Object).Attributes() - repoActions := r.toActionsAPIModel(ctx, sectionAttrs["actions"].(types.Set)) - - return &PermissionTargetSection{ - IncludePatterns: utilfw.StringSetToStrings(sectionAttrs["includes_pattern"].(types.Set)), - ExcludePatterns: utilfw.StringSetToStrings(sectionAttrs["excludes_pattern"].(types.Set)), - Repositories: utilfw.StringSetToStrings(sectionAttrs["repositories"].(types.Set)), - Actions: &repoActions, - } -} - -func (r *PermissionTargetResourceModel) toAPIModel(ctx context.Context) PermissionTargetResourceAPIModel { - // convert section - repo := r.toSectionAPIModel(ctx, r.Repo) - build := r.toSectionAPIModel(ctx, r.Build) - releaseBundle := r.toSectionAPIModel(ctx, r.ReleaseBundle) - - // Convert from Terraform data model into API data model - return PermissionTargetResourceAPIModel{ - Name: r.Name.ValueString(), - Repo: repo, - Build: build, - ReleaseBundle: releaseBundle, - } -} - -func (r *PermissionTargetResourceModel) ToState(ctx context.Context, diags diag.Diagnostics, permissionTarget *PermissionTargetResourceAPIModel) { - r.Id = types.StringValue(permissionTarget.Name) - r.Name = types.StringValue(permissionTarget.Name) - - var ds diag.Diagnostics - - if permissionTarget.Repo != nil { - r.Repo, ds = r.sectionFromAPIModel(ctx, permissionTarget.Repo) - if ds != nil { - diags.Append(ds...) - return - } - } - - if permissionTarget.Build != nil { - r.Build, ds = r.sectionFromAPIModel(ctx, permissionTarget.Build) - if ds != nil { - diags.Append(ds...) - return - } - } - - if permissionTarget.ReleaseBundle != nil { - r.ReleaseBundle, ds = r.sectionFromAPIModel(ctx, permissionTarget.ReleaseBundle) - if ds != nil { - diags.Append(ds...) - return - } - } -} - -func (r *PermissionTargetResourceModel) sectionFromAPIModel(ctx context.Context, section *PermissionTargetSection) (types.Set, diag.Diagnostics) { - includesPatterns, diags := types.SetValueFrom(ctx, types.StringType, section.IncludePatterns) - if diags != nil { - return types.Set{}, diags - } - - excludesPatterns, diags := types.SetValueFrom(ctx, types.StringType, section.ExcludePatterns) - if diags != nil { - return types.Set{}, diags - } - - repos, diags := types.SetValueFrom(ctx, types.StringType, section.Repositories) - if diags != nil { - return types.Set{}, diags - } - - var namePermissionAttrTypes = map[string]attr.Type{ - "name": types.StringType, - "permissions": types.SetType{ElemType: types.StringType}, - } - - var actionsAttrTypes = map[string]attr.Type{ - "users": types.SetType{ - ElemType: types.ObjectType{ - AttrTypes: namePermissionAttrTypes, - }, - }, - "groups": types.SetType{ - ElemType: types.ObjectType{ - AttrTypes: namePermissionAttrTypes, - }, - }, - } - - actionFromAPIModel := func(action map[string][]string) (types.Set, diag.Diagnostics) { - objectValues := []attr.Value{} - for name, permissions := range action { - permissionsSet, diags := types.SetValueFrom(ctx, types.StringType, permissions) - if diags != nil { - return types.Set{}, diags - } - - objectValue := types.ObjectValueMust( - namePermissionAttrTypes, - map[string]attr.Value{ - "name": types.StringValue(name), - "permissions": permissionsSet, - }, - ) - objectValues = append(objectValues, objectValue) - } - return types.SetValueMust(types.ObjectType{ - AttrTypes: namePermissionAttrTypes, - }, objectValues), nil - } - - actionsUsers, diags := actionFromAPIModel(section.Actions.Users) - if diags != nil { - return types.Set{}, diags - } - - actionsGroups, diags := actionFromAPIModel(section.Actions.Groups) - if diags != nil { - return types.Set{}, diags - } - - sectionAttrType := map[string]attr.Type{ - "includes_pattern": types.SetType{ElemType: types.StringType}, - "excludes_pattern": types.SetType{ElemType: types.StringType}, - "repositories": types.SetType{ElemType: types.StringType}, - "actions": types.SetType{ElemType: types.ObjectType{ - AttrTypes: actionsAttrTypes}, - }, - } - - actionsObjs := types.ObjectValueMust( - actionsAttrTypes, - map[string]attr.Value{ - "users": actionsUsers, - "groups": actionsGroups, - }, - ) - - sectionObj := types.ObjectValueMust( - sectionAttrType, - map[string]attr.Value{ - "includes_pattern": includesPatterns, - "excludes_pattern": excludesPatterns, - "repositories": repos, - "actions": types.SetValueMust( - types.ObjectType{AttrTypes: actionsAttrTypes}, - []attr.Value{actionsObjs}, - ), - }, - ) - - return types.SetValueMust( - types.ObjectType{AttrTypes: sectionAttrType}, - []attr.Value{sectionObj}, - ), nil - -} - -// PermissionTargetResourceAPIModel describes the API data model. Copy from https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/permissiontarget.go#L116 +// PermissionTargetParams Copy from https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/permissiontarget.go#L116 // // Using struct pointers to keep the fields null if they are empty. // Artifactory evaluates inner struct typed fields if they are not null, which can lead to failures in the request. -type PermissionTargetResourceAPIModel struct { +type PermissionTargetParams struct { Name string `json:"name"` Repo *PermissionTargetSection `json:"repo,omitempty"` Build *PermissionTargetSection `json:"build,omitempty"` @@ -253,254 +48,332 @@ type Actions struct { Groups map[string][]string `json:"groups,omitempty"` } -const ( - PermRead = "read" - PermWrite = "write" - PermAnnotate = "annotate" - PermDelete = "delete" - PermManage = "manage" - PermManagedXrayMeta = "managedXrayMeta" - PermDistribute = "distribute" -) - -func (r *PermissionTargetResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = "artifactory_permission_target" +func ResourceArtifactoryPermissionTargets() *schema.Resource { + target := ResourceArtifactoryPermissionTarget() + target.DeprecationMessage = "This resource has been deprecated in favour of artifactory_permission_target resource." + return target } -var actionsAttributeBlock = schema.SetNestedBlock{ - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Required: true, - }, - "permissions": schema.SetAttribute{ - ElementType: types.StringType, - Required: true, - Validators: []validator.Set{ - validatorfw.StringInSlice([]string{ - PermRead, - PermAnnotate, - PermWrite, - PermDelete, - PermManage, - PermManagedXrayMeta, - PermDistribute, - }), +func BuildPermissionTargetSchema() map[string]*schema.Schema { + actionSchema := schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Set: hashPrincipal, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + "permissions": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + PermRead, + PermAnnotate, + PermWrite, + PermDelete, + PermManage, + PermManagedXrayMeta, + PermDistribute, + }, false), + }, + Set: schema.HashString, + Required: true, }, }, }, - }, -} + } -func (r *PermissionTargetResource) getPrincipalBlock(description, repoDescription string) schema.SetNestedBlock { - return schema.SetNestedBlock{ - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "includes_pattern": schema.SetAttribute{ - ElementType: types.StringType, - Optional: true, - Computed: true, - Default: setdefault.StaticValue(basetypes.NewSetValueMust(types.StringType, []attr.Value{types.StringValue("**")})), - MarkdownDescription: `The default value will be [""] if nothing is supplied`, + principalSchema := schema.Schema{ + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "includes_pattern": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Optional: true, + Description: `The default value will be [""] if nothing is supplied`, }, - "excludes_pattern": schema.SetAttribute{ - ElementType: types.StringType, - Optional: true, - Computed: true, - Default: setdefault.StaticValue(basetypes.NewSetValueMust(types.StringType, []attr.Value{})), - MarkdownDescription: "The default value will be [] if nothing is supplied", + "excludes_pattern": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Optional: true, + Description: `The default value will be [] if nothing is supplied`, }, - "repositories": schema.SetAttribute{ - ElementType: types.StringType, + "repositories": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "You can specify the name `ANY` in the repositories section in order to apply to all repositories, `ANY REMOTE` for all remote repositories and `ANY LOCAL` for all local repositories. The default value will be [] if nothing is specified.", Required: true, - // Optional: true, // this attribute can't be set to required as SingleNestedBlock doesn't support it. See https://github.com/hashicorp/terraform-plugin-framework/issues/740 - MarkdownDescription: repoDescription, }, - }, - Blocks: map[string]schema.Block{ - "actions": schema.SetNestedBlock{ - NestedObject: schema.NestedBlockObject{ - Blocks: map[string]schema.Block{ - "users": actionsAttributeBlock, - "groups": actionsAttributeBlock, + "actions": { + Type: schema.TypeList, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "users": &actionSchema, + "groups": &actionSchema, }, }, - Validators: []validator.Set{ - setvalidator.SizeBetween(1, 1), - }, + Optional: true, }, }, }, - Validators: []validator.Set{ - setvalidator.SizeBetween(1, 1), + } + buildSchema := principalSchema + buildSchema.Elem.(*schema.Resource).Schema["repositories"].Description = `This can only be 1 value: "artifactory-build-info", and currently, validation of sets/lists is not allowed. Artifactory will reject the request if you change this` + + return map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, - MarkdownDescription: description, + "repo": &principalSchema, + "build": &buildSchema, + "release_bundle": &principalSchema, } } -func (r *PermissionTargetResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ - MarkdownDescription: "Provides an Artifactory permission target resource. This can be used to create and manage Artifactory permission targets.", - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Computed: true, - }, - "name": schema.StringAttribute{ - MarkdownDescription: "Name of permission.", - Required: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, - }, - Blocks: map[string]schema.Block{ - "repo": r.getPrincipalBlock("Repository permission configuration.", "You can specify the name `ANY` in the repositories section in order to apply to all repositories, `ANY REMOTE` for all remote repositories and `ANY LOCAL` for all local repositories. The default value will be [] if nothing is specified."), - "build": r.getPrincipalBlock("As for repo but for artifactory-build-info permissions.", `This can only be 1 value: "artifactory-build-info", and currently, validation of sets/lists is not allowed. Artifactory will reject the request if you change this`), - "release_bundle": r.getPrincipalBlock("As for repo for for release-bundles permissions.", "You can specify the name `ANY` in the repositories section in order to apply to all repositories, `ANY REMOTE` for all remote repositories and `ANY LOCAL` for all local repositories. The default value will be [] if nothing is specified."), +func ResourceArtifactoryPermissionTarget() *schema.Resource { + return &schema.Resource{ + CreateContext: resourcePermissionTargetCreate, + ReadContext: resourcePermissionTargetRead, + UpdateContext: resourcePermissionTargetUpdate, + DeleteContext: resourcePermissionTargetDelete, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, }, + + Schema: BuildPermissionTargetSchema(), } } -func (r *PermissionTargetResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { - // Prevent panic if the provider has not been configured. - if req.ProviderData == nil { - return - } - r.ProviderData = req.ProviderData.(utilsdk.ProvderMetadata) +func hashPrincipal(o interface{}) int { + p := o.(map[string]interface{}) + part1 := schema.HashString(p["name"].(string)) + 31 + permissions := utilsdk.CastToStringArr(p["permissions"].(*schema.Set).List()) + part3 := schema.HashString(strings.Join(permissions, "")) + return part1 * part3 } -func (r *PermissionTargetResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var data *PermissionTargetResourceModel +func unpackPermissionTarget(ctx context.Context, s *schema.ResourceData) *PermissionTargetParams { + d := &utilsdk.ResourceData{ResourceData: s} + + unpackPermission := func(rawPermissionData interface{}) *PermissionTargetSection { + unpackEntity := func(rawEntityData interface{}) *Actions { + unpackPermMap := func(rawPermSet interface{}) map[string][]string { + permList := rawPermSet.(*schema.Set).List() + if len(permList) == 0 { + return nil + } + + permissions := make(map[string][]string) + for _, v := range permList { + id := v.(map[string]interface{}) + + permissions[id["name"].(string)] = utilsdk.CastToStringArr(id["permissions"].(*schema.Set).List()) + } + return permissions + } + + entityDataList := rawEntityData.([]interface{}) + if len(entityDataList) == 0 || entityDataList[0] == nil { + return nil + } + + entityData := entityDataList[0].(map[string]interface{}) + return &Actions{ + Users: unpackPermMap(entityData["users"]), + Groups: unpackPermMap(entityData["groups"]), + } + } + + if rawPermissionData == nil || rawPermissionData.([]interface{})[0] == nil { + return nil + } + + // It is safe to unpack the zeroth element immediately since permission targets have min size of 1 + permissionData := rawPermissionData.([]interface{})[0].(map[string]interface{}) + + permission := new(PermissionTargetSection) + + // This will always exist + tmp := utilsdk.CastToStringArr(permissionData["repositories"].(*schema.Set).List()) + permission.Repositories = tmp + + // Handle optionals + if v, ok := permissionData["includes_pattern"]; ok { + // It is not possible to set default values for sets. Because the data type between moving from + // atlassian to jfrog went from a *[]string to a []string, and both have json attributes of 'on empty omit' + // when the * version was used, this would have cause an [] array to be sent, which artifactory would accept + // now that the data type is changed, and [] is ommitted and so when artifactory see the key missing entirely + // it responds with "[**]" which messes us the testutil. This hack seems to line them up + tmp := utilsdk.CastToStringArr(v.(*schema.Set).List()) + if len(tmp) == 0 { + tmp = []string{""} + } + permission.IncludePatterns = tmp + } + + if v, ok := permissionData["excludes_pattern"]; ok { + tmp := utilsdk.CastToStringArr(v.(*schema.Set).List()) + permission.ExcludePatterns = tmp + } + + if v, ok := permissionData["actions"]; ok { + permission.Actions = unpackEntity(v) + } + + tflog.Debug(ctx, "unpackPermissionTarget", map[string]interface{}{ + "permission.Actions": permission.Actions, + }) - // Read Terraform plan data into the model - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) - if resp.Diagnostics.HasError() { - return + return permission } - permissionTarget := data.toAPIModel(ctx) + pTarget := new(PermissionTargetParams) - response, err := r.ProviderData.Client.R(). - SetBody(permissionTarget). - Put(PermissionsEndPoint + permissionTarget.Name) + pTarget.Name = d.GetString("name", false) - if err != nil { - utilfw.UnableToCreateResourceError(resp, err.Error()) - return + if v, ok := d.GetOk("repo"); ok { + pTarget.Repo = unpackPermission(v) } - // Return error if the HTTP status code is not 200 OK - if response.StatusCode() != http.StatusOK { - utilfw.UnableToCreateResourceError(resp, response.Status()) - return + if v, ok := d.GetOk("build"); ok { + pTarget.Build = unpackPermission(v) } - // Assign the resource ID for the resource in the state - data.Id = types.StringValue(permissionTarget.Name) + if v, ok := d.GetOk("release_bundle"); ok { + pTarget.ReleaseBundle = unpackPermission(v) + } - // Save data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + return pTarget } -func (r *PermissionTargetResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var data *PermissionTargetResourceModel - // Read Terraform prior state data into the model - resp.Diagnostics.Append(req.State.Get(ctx, &data)...) - if resp.Diagnostics.HasError() { - return - } +func PackPermissionTarget(permissionTarget *PermissionTargetParams, d *schema.ResourceData) diag.Diagnostics { + packPermission := func(p *PermissionTargetSection) []interface{} { + packPermMap := func(e map[string][]string) []interface{} { + perm := make([]interface{}, len(e)) + + count := 0 + for k, v := range e { + perm[count] = map[string]interface{}{ + "name": k, + "permissions": schema.NewSet(schema.HashString, utilsdk.CastToInterfaceArr(v)), + } + count++ + } - permissionTarget := &PermissionTargetResourceAPIModel{} + return perm + } - response, err := r.ProviderData.Client.R(). - SetResult(permissionTarget). - Get(PermissionsEndPoint + data.Id.ValueString()) + s := map[string]interface{}{} - // Treat HTTP 404 Not Found status as a signal to recreate resource - // and return early - if err != nil { - if response.StatusCode() == http.StatusBadRequest || response.StatusCode() == http.StatusNotFound { - resp.State.RemoveResource(ctx) - return - } - utilfw.UnableToRefreshResourceError(resp, response.String()) - return - } + if p != nil { + if p.IncludePatterns != nil { + s["includes_pattern"] = schema.NewSet(schema.HashString, utilsdk.CastToInterfaceArr(p.IncludePatterns)) + } - // Convert from the API data model to the Terraform data model - // and refresh any attribute values. - data.ToState(ctx, resp.Diagnostics, permissionTarget) + if p.ExcludePatterns != nil { + s["excludes_pattern"] = schema.NewSet(schema.HashString, utilsdk.CastToInterfaceArr(p.ExcludePatterns)) + } - // Save updated data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) -} + if p.Repositories != nil { + s["repositories"] = schema.NewSet(schema.HashString, utilsdk.CastToInterfaceArr(p.Repositories)) + } -func (r *PermissionTargetResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var data *PermissionTargetResourceModel + if p.Actions != nil { + perms := make(map[string]interface{}) - // Read Terraform plan data into the model - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + if p.Actions.Users != nil { + perms["users"] = schema.NewSet(hashPrincipal, packPermMap(p.Actions.Users)) + } - // Convert from Terraform data model into API data model - permissionTarget := data.toAPIModel(ctx) + if p.Actions.Groups != nil { + perms["groups"] = schema.NewSet(hashPrincipal, packPermMap(p.Actions.Groups)) + } - // Update call - response, err := r.ProviderData.Client.R(). - SetBody(permissionTarget). - Put(PermissionsEndPoint + permissionTarget.Name) - if err != nil { - utilfw.UnableToUpdateResourceError(resp, err.Error()) - return + if len(perms) > 0 { + s["actions"] = []interface{}{perms} + } + } + } + + return []interface{}{s} } - // Return error if the HTTP status code is not 200 OK - if response.StatusCode() != http.StatusOK { - utilfw.UnableToUpdateResourceError(resp, response.Status()) - return + setValue := utilsdk.MkLens(d) + + errors := setValue("name", permissionTarget.Name) + if permissionTarget.Repo != nil { + errors = setValue("repo", packPermission(permissionTarget.Repo)) + } + if permissionTarget.Build != nil { + errors = setValue("build", packPermission(permissionTarget.Build)) } - data.ToState(ctx, resp.Diagnostics, &permissionTarget) + if permissionTarget.ReleaseBundle != nil { + errors = setValue("release_bundle", packPermission(permissionTarget.ReleaseBundle)) + } - // Save updated data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + if errors != nil && len(errors) > 0 { + return diag.Errorf("failed to marshal permission target %q", errors) + } + return nil } -func (r *PermissionTargetResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var data PermissionTargetResourceModel +func resourcePermissionTargetCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + permissionTarget := unpackPermissionTarget(ctx, d) - // Read Terraform prior state data into the model - resp.Diagnostics.Append(req.State.Get(ctx, &data)...) - if resp.Diagnostics.HasError() { - return + if _, err := m.(utilsdk.ProvderMetadata).Client.R().AddRetryCondition(repository.Retry400).SetBody(permissionTarget).Post(PermissionsEndPoint + permissionTarget.Name); err != nil { + return diag.FromErr(err) } - response, err := r.ProviderData.Client.R(). - Delete(PermissionsEndPoint + data.Id.ValueString()) + d.SetId(permissionTarget.Name) + return nil +} +func resourcePermissionTargetRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + permissionTarget := new(PermissionTargetParams) + resp, err := m.(utilsdk.ProvderMetadata).Client.R().SetResult(permissionTarget).Get(PermissionsEndPoint + d.Id()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, err.Error()) - return + if resp != nil && resp.StatusCode() == http.StatusNotFound { + d.SetId("") + return nil + } + return diag.FromErr(err) } - // Return error if the HTTP status code is not 200 OK or 404 Not Found - if response.StatusCode() != http.StatusNotFound && response.StatusCode() != http.StatusOK { - utilfw.UnableToDeleteResourceError(resp, response.Status()) - return + return PackPermissionTarget(permissionTarget, d) +} + +func resourcePermissionTargetUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + permissionTarget := unpackPermissionTarget(ctx, d) + + if _, err := m.(utilsdk.ProvderMetadata).Client.R().SetBody(permissionTarget).Put(PermissionsEndPoint + d.Id()); err != nil { + return diag.FromErr(err) } - // If the logic reaches here, it implicitly succeeded and will remove - // the resource from state if there are no other errors. + d.SetId(permissionTarget.Name) + return resourcePermissionTargetRead(ctx, d, m) } -// ImportState imports the resource into the Terraform state. -func (r *PermissionTargetResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) -} +func resourcePermissionTargetDelete(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + _, err := m.(utilsdk.ProvderMetadata).Client.R().Delete(PermissionsEndPoint + d.Id()) -// PermissionTargetParams Copy from https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/permissiontarget.go#L116 -// -// Using struct pointers to keep the fields null if they are empty. -// Artifactory evaluates inner struct typed fields if they are not null, which can lead to failures in the request. + return diag.FromErr(err) +} func PermTargetExists(id string, m interface{}) (bool, error) { resp, err := m.(utilsdk.ProvderMetadata).Client.R().Head(PermissionsEndPoint + id) diff --git a/pkg/artifactory/resource/security/resource_artifactory_permission_target_test.go b/pkg/artifactory/resource/security/resource_artifactory_permission_target_test.go index 8e79452f0..e6802ad1c 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_permission_target_test.go +++ b/pkg/artifactory/resource/security/resource_artifactory_permission_target_test.go @@ -159,15 +159,12 @@ const testLength = ` repo { includes_pattern = ["foo/**"] repositories = ["{{ .repo_name }}"] - - actions { - } } depends_on = [artifactory_local_docker_v2_repository.{{ .repo_name }}] } ` -func TestAccPermissionTarget_emptyActions(t *testing.T) { +func TestAccPermissionTarget_noActions(t *testing.T) { rand.Seed(time.Now().UnixNano()) repoName := fmt.Sprintf("test-local-docker-%d", rand.Int()) _, permFqrn, permName := testutil.MkNames("test-perm", "artifactory_permission_target") @@ -186,8 +183,7 @@ func TestAccPermissionTarget_emptyActions(t *testing.T) { Config: utilsdk.ExecuteTemplate(permFqrn, testLength, tempStruct), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(permFqrn, "name", permName), - resource.TestCheckResourceAttr(permFqrn, "repo.0.actions.0.users.#", "0"), - resource.TestCheckResourceAttr(permFqrn, "repo.0.actions.0.groups.#", "0"), + resource.TestCheckResourceAttr(permFqrn, "repo.0.actions.#", "0"), ), }, { @@ -200,7 +196,7 @@ func TestAccPermissionTarget_emptyActions(t *testing.T) { }) } -func TestAccPermissionTarget_UpgradeFromSDKv2(t *testing.T) { +func TestAccPermissionTarget_MigrateFromFrameworkBackToSDKv2(t *testing.T) { _, fqrn, name := testutil.MkNames("test-perm", "artifactory_permission_target") rand.Seed(time.Now().UnixNano()) repoName := fmt.Sprintf("test-local-docker-%d", rand.Int()) @@ -217,12 +213,11 @@ func TestAccPermissionTarget_UpgradeFromSDKv2(t *testing.T) { { ExternalProviders: map[string]resource.ExternalProvider{ "artifactory": { - VersionConstraint: "7.7.0", // need to use 7.7.0 instead of 7.11.2 due to artifactory_managed_user changes after 7.7.0 + VersionConstraint: "9.7.3", Source: "registry.terraform.io/jfrog/artifactory", }, }, - Config: config, - ExpectNonEmptyPlan: true, + Config: config, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(fqrn, "name", name), resource.TestCheckResourceAttr(fqrn, "repo.#", "1"), @@ -439,8 +434,7 @@ func TestAccPermissionTarget_addBuild(t *testing.T) { resource.TestCheckResourceAttr(permFqrn, "repo.0.actions.0.users.#", "1"), resource.TestCheckResourceAttr(permFqrn, "repo.0.actions.0.groups.#", "0"), resource.TestCheckResourceAttr(permFqrn, "repo.0.repositories.#", "1"), - resource.TestCheckResourceAttr(permFqrn, "repo.0.includes_pattern.#", "1"), - resource.TestCheckResourceAttr(permFqrn, "repo.0.includes_pattern.0", "**"), + resource.TestCheckResourceAttr(permFqrn, "repo.0.includes_pattern.#", "0"), resource.TestCheckResourceAttr(permFqrn, "repo.0.excludes_pattern.#", "0"), ), }, @@ -536,7 +530,7 @@ func TestAccPermissionTarget_MissingRepositories(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ProtoV5ProviderFactories: acctest.ProtoV5MuxProviderFactories, CheckDestroy: testPermissionTargetCheckDestroy(permFqrn), Steps: []resource.TestStep{ { From 02ebe412748800759f6a9d95da7182b387836364 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 3 Nov 2023 10:35:43 -0700 Subject: [PATCH 18/44] Update CHANGELOG --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34d05f0ee..7f3619974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.7.4 (Nov 3, 2023) + +IMPROVEMENTS: + +* resource/artifactory_permission_target: Revert back to using Terraform SDKv2 due to unresolved performance issue from Terraform Framework. Issue: [#757](https://github.com/jfrog/terraform-provider-artifactory/issues/757) and [#805](https://github.com/jfrog/terraform-provider-artifactory/issues/805) PR: [#842](https://github.com/jfrog/terraform-provider-artifactory/pull/842) + ## 9.7.3 (Nov 2, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.3 SECURITY: @@ -258,7 +264,7 @@ IMPROVEMENTS: * resource/artifactory_permission_target is migrated to Plugin Framework, improved attribute validation. - PR: [#742](https://github.com/jfrog/terraform-provider-artifactory/pull/42) +PR: [#742](https://github.com/jfrog/terraform-provider-artifactory/pull/742) ## 7.11.2 (May 30, 2023). Tested on Artifactory 7.59.9 From 5027424e850fb045f6bcf1c766854581f88b905f Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 3 Nov 2023 10:46:29 -0700 Subject: [PATCH 19/44] Remove debug logging --- .../security/resource_artifactory_permission_target.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkg/artifactory/resource/security/resource_artifactory_permission_target.go b/pkg/artifactory/resource/security/resource_artifactory_permission_target.go index e2e32dbaf..d953c36ee 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_permission_target.go +++ b/pkg/artifactory/resource/security/resource_artifactory_permission_target.go @@ -5,7 +5,6 @@ import ( "net/http" "strings" - "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -235,10 +234,6 @@ func unpackPermissionTarget(ctx context.Context, s *schema.ResourceData) *Permis permission.Actions = unpackEntity(v) } - tflog.Debug(ctx, "unpackPermissionTarget", map[string]interface{}{ - "permission.Actions": permission.Actions, - }) - return permission } From 5906e26d00506c98f08ab2dd881278c0366cbb36 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Fri, 3 Nov 2023 18:12:38 +0000 Subject: [PATCH 20/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f3619974..565170603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.4 (Nov 3, 2023) +## 9.7.4 (Nov 3, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.3 IMPROVEMENTS: From 0fb14970e93222a0e301e4ed7b4f192b32734c0e Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 7 Nov 2023 08:43:40 -0800 Subject: [PATCH 21/44] Add deprecation message to pull replication documentation Use callouts in replication config documentations --- docs/resources/pull_replication.md | 7 ++++--- docs/resources/push_replication.md | 2 ++ docs/resources/replication_config.md | 2 +- docs/resources/single_replication_config.md | 6 +++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/resources/pull_replication.md b/docs/resources/pull_replication.md index 241bb73fe..d758f630e 100644 --- a/docs/resources/pull_replication.md +++ b/docs/resources/pull_replication.md @@ -3,9 +3,10 @@ subcategory: "Replication" --- # Artifactory Pull Replication Resource -Provides an Artifactory pull replication resource. This can be used to create and manage pull replication in Artifactory -for a local or remote repo. Pull replication provides a convenient way to proactively populate a remote cache, and is very useful -when waiting for new artifacts to arrive on demand (when first requested) is not desirable due to network latency. +~> This resource is deprecated and replaced by `artifactory_remote_repository_replication` for clarity. + +Provides an Artifactory pull replication resource. This can be used to create and manage pull replication in Artifactory for a local or remote repo. Pull replication provides a convenient way to proactively populate a remote cache, and is very useful when waiting for new artifacts to arrive on demand (when first requested) is not desirable due to network latency. + See the [Official Documentation](https://www.jfrog.com/confluence/display/JFROG/Repository+Replication#RepositoryReplication-PullReplication). ## Example Usage diff --git a/docs/resources/push_replication.md b/docs/resources/push_replication.md index 1db33ae1e..4497a3302 100644 --- a/docs/resources/push_replication.md +++ b/docs/resources/push_replication.md @@ -6,8 +6,10 @@ subcategory: "Replication" ~> This resource is deprecated and replaced by `artifactory_local_repository_multi_replication` for clarity. Provides an Artifactory push replication resource. This can be used to create and manage Artifactory push replications using [Multi-push Replication API](https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-CreateorReplaceLocalMulti-pushReplication). + Push replication is used to synchronize Local Repositories, and is implemented by the Artifactory server on the near end invoking a synchronization of artifacts to the far end. + See the [Official Documentation](https://www.jfrog.com/confluence/display/JFROG/Repository+Replication#RepositoryReplication-PushReplication). ~> This resource requires Artifactory Enterprise license. diff --git a/docs/resources/replication_config.md b/docs/resources/replication_config.md index f43fcc7f2..863b0999c 100644 --- a/docs/resources/replication_config.md +++ b/docs/resources/replication_config.md @@ -3,7 +3,7 @@ subcategory: "Replication" --- # Artifactory Replication Config Resource -Note: this resource is deprecated in favor of `artifactory_push_replication` resource. +~> This resource is deprecated in favor of `artifactory_push_replication` resource. Provides an Artifactory replication config resource. This can be used to create and manage Artifactory replications. diff --git a/docs/resources/single_replication_config.md b/docs/resources/single_replication_config.md index 1601679b8..763364966 100644 --- a/docs/resources/single_replication_config.md +++ b/docs/resources/single_replication_config.md @@ -3,13 +3,13 @@ subcategory: "Replication" --- # Artifactory Single Replication Config Resource -Note: this resource is deprecated in favor of `artifactory_pull_replication` resource. +~> This resource is deprecated in favor of `artifactory_pull_replication` resource. Provides an Artifactory single replication config resource. This can be used to create and manage a single Artifactory replication. Primarily used when pull replication is needed. -**WARNING: This should not be used on a repository with `artifactory_replication_config`. Using both together will cause -unexpected behaviour and will almost certainly cause your replications to break.** +!> This should not be used on a repository with `artifactory_replication_config`. Using both together will cause +unexpected behaviour and will almost certainly cause your replications to break. ### Passwords Passwords can only be used when encryption is turned off, see [Key Encryption documentation](https://www.jfrog.com/confluence/display/RTF/Artifactory+Key+Encryption). From 6b8709b0c1516f4362bdc0c006b8801824c1b19a Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 7 Nov 2023 13:58:32 -0800 Subject: [PATCH 22/44] Add 'curated' attribute to Curation supported repository resources --- docs/resources/remote_docker_repository.md | 1 + docs/resources/remote_maven_repository.md | 1 + docs/resources/remote_npm_repository.md | 1 + docs/resources/remote_pypi_repository.md | 1 + ...e_artifactory_federated_repository_test.go | 19 +++---- ...ource_artifactory_local_repository_test.go | 12 ++-- ...rce_artifactory_remote_maven_repository.go | 16 +++--- ...ource_artifactory_remote_npm_repository.go | 34 ++++++++++++ ...urce_artifactory_remote_repository_test.go | 10 +++- ...rce_artifactory_virtual_repository_test.go | 19 +------ pkg/artifactory/provider/datasources.go | 1 + pkg/artifactory/provider/resources.go | 1 + ...e_artifactory_federated_repository_test.go | 19 +++---- ...ource_artifactory_local_repository_test.go | 12 ++-- .../resource/repository/remote/curation.go | 16 ++++++ .../resource/repository/remote/remote.go | 1 - ...ce_artifactory_remote_docker_repository.go | 7 ++- ...rce_artifactory_remote_maven_repository.go | 37 ++++++++++--- ...ource_artifactory_remote_npm_repository.go | 55 +++++++++++++++++++ ...urce_artifactory_remote_pypi_repository.go | 9 ++- ...urce_artifactory_remote_repository_test.go | 19 ++++--- ...rce_artifactory_virtual_repository_test.go | 12 ++-- .../resource_artifactory_webhook_test.go | 21 +------ 23 files changed, 217 insertions(+), 107 deletions(-) create mode 100644 pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_npm_repository.go create mode 100644 pkg/artifactory/resource/repository/remote/curation.go create mode 100644 pkg/artifactory/resource/repository/remote/resource_artifactory_remote_npm_repository.go diff --git a/docs/resources/remote_docker_repository.md b/docs/resources/remote_docker_repository.md index ddc16e301..78be8f101 100644 --- a/docs/resources/remote_docker_repository.md +++ b/docs/resources/remote_docker_repository.md @@ -42,6 +42,7 @@ The following arguments are supported, along with the [common list of arguments This value `[**]` must be assigned to the attribute manually, if user don't specify any other non-default values. We don't want to make this attribute required, but it must be set to avoid the state drift on update. Note: Artifactory assigns `[**]` on update if HCL doesn't have the attribute set or the list is empty. +* `curated` - (Optional, Default: `false`) Enable repository to be protected by the Curation service. ## Import diff --git a/docs/resources/remote_maven_repository.md b/docs/resources/remote_maven_repository.md index 7c56a904f..715c6b584 100644 --- a/docs/resources/remote_maven_repository.md +++ b/docs/resources/remote_maven_repository.md @@ -38,6 +38,7 @@ The following arguments are supported, along with the [common list of arguments * `reject_invalid_jars` - (Optional, Default: `false`) Reject the caching of jar files that are found to be invalid. For example, pseudo jars retrieved behind a "captive portal". * `remote_repo_checksum_policy_type` - (Optional, Default: `generate-if-absent`) Checking the Checksum effectively verifies the integrity of a deployed resource. The Checksum Policy determines how the system behaves when a client checksum for a remote resource is missing or conflicts with the locally calculated checksum. Available policies are `generate-if-absent`, `fail`, `ignore-and-generate`, and `pass-thru`. * `metadata_retrieval_timeout_secs` - (Optional, Default: 60) This value refers to the number of seconds to cache metadata files before checking for newer versions on remote server. A value of 0 indicates no caching. Cannot be larger than `retrieval_cache_period_seconds` attribute. +* `curated` - (Optional, Default: `false`) Enable repository to be protected by the Curation service. ## Import diff --git a/docs/resources/remote_npm_repository.md b/docs/resources/remote_npm_repository.md index 5aaa4bb02..9528af367 100644 --- a/docs/resources/remote_npm_repository.md +++ b/docs/resources/remote_npm_repository.md @@ -28,6 +28,7 @@ The following arguments are supported, along with the [common list of arguments * `description` - (Optional) * `notes` - (Optional) * `url` - (Required) The remote repo URL. +* `curated` - (Optional, Default: `false`) Enable repository to be protected by the Curation service. ## Import diff --git a/docs/resources/remote_pypi_repository.md b/docs/resources/remote_pypi_repository.md index fb0eed9d8..b19599b31 100644 --- a/docs/resources/remote_pypi_repository.md +++ b/docs/resources/remote_pypi_repository.md @@ -29,6 +29,7 @@ The following arguments are supported, along with the [common list of arguments * `url` - (Required) The remote repo URL. * `pypi_registry_url` - (Optional) To configure the remote repo to proxy public external PyPI repository, or a PyPI repository hosted on another Artifactory server. See JFrog Pypi documentation [here](https://www.jfrog.com/confluence/display/JFROG/PyPI+Repositories) for the usage details. Default value is `https://pypi.org`. * `pypi_repository_suffix` - (Optional) Usually should be left as a default for `simple`, unless the remote is a PyPI server that has custom registry suffix, like +simple in DevPI. Default value is `simple`. +* `curated` - (Optional, Default: `false`) Enable repository to be protected by the Curation service. ## Import diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_repository_test.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_repository_test.go index a6cbed022..6c6ec947b 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_repository_test.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_repository_test.go @@ -15,8 +15,6 @@ import ( "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/security" "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) func skipFederatedRepo() (bool, string) { @@ -89,10 +87,9 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test } func TestAccDataSourceFederatedRepoGenericTypes(t *testing.T) { - for _, repo := range federated.PackageTypesLikeGeneric { - title := cases.Title(language.AmericanEnglish).String(repo) - t.Run(title, func(t *testing.T) { - resource.Test(federatedTestCase(repo, t)) + for _, packageType := range federated.PackageTypesLikeGeneric { + t.Run(packageType, func(t *testing.T) { + resource.Test(federatedTestCase(packageType, t)) }) } } @@ -827,10 +824,9 @@ func makeFederatedGradleLikeRepoTestCase(repoType string, t *testing.T) (*testin } func TestAccDataSourceFederatedAllGradleLikePackageTypes(t *testing.T) { - for _, repoType := range repository.GradleLikePackageTypes { - title := cases.Title(language.AmericanEnglish).String(repoType) - t.Run(title, func(t *testing.T) { - resource.Test(makeFederatedGradleLikeRepoTestCase(repoType, t)) + for _, packageType := range repository.GradleLikePackageTypes { + t.Run(packageType, func(t *testing.T) { + resource.Test(makeFederatedGradleLikeRepoTestCase(packageType, t)) }) } } @@ -1134,8 +1130,7 @@ func makeFederatedTerraformRepoTestCase(registryType string, t *testing.T) (*tes func TestAccDataSourceFederatedTerraformRepositories(t *testing.T) { for _, registryType := range []string{"module", "provider"} { - title := cases.Title(language.AmericanEnglish).String(registryType) - t.Run(title, func(t *testing.T) { + t.Run(registryType, func(t *testing.T) { resource.Test(makeFederatedTerraformRepoTestCase(registryType, t)) }) } diff --git a/pkg/artifactory/datasource/repository/local/datasource_artifactory_local_repository_test.go b/pkg/artifactory/datasource/repository/local/datasource_artifactory_local_repository_test.go index 0d15dbb83..33cc04659 100644 --- a/pkg/artifactory/datasource/repository/local/datasource_artifactory_local_repository_test.go +++ b/pkg/artifactory/datasource/repository/local/datasource_artifactory_local_repository_test.go @@ -2,7 +2,6 @@ package local_test import ( "fmt" - "strings" "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -12,14 +11,11 @@ import ( "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/security" "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) func TestAccDataSourceLocalAllPackageTypes(t *testing.T) { for _, packageType := range local.PackageTypesLikeGeneric { - title := fmt.Sprintf("%s", cases.Title(language.AmericanEnglish).String(strings.ToLower(packageType))) - t.Run(title, func(t *testing.T) { + t.Run(packageType, func(t *testing.T) { resource.Test(mkTestCase(packageType, t)) }) } @@ -521,9 +517,9 @@ func makeDataSourceLocalGradleLikeRepoTestCase(repoType string, t *testing.T) (* } func TestAccDataSourceLocalAllGradleLikePackageTypes(t *testing.T) { - for _, repoType := range repository.GradleLikePackageTypes { - t.Run(fmt.Sprintf("TestDataSourceLocal%sRepo", strings.Title(strings.ToLower(repoType))), func(t *testing.T) { - resource.Test(makeDataSourceLocalGradleLikeRepoTestCase(repoType, t)) + for _, packageType := range repository.GradleLikePackageTypes { + t.Run(packageType, func(t *testing.T) { + resource.Test(makeDataSourceLocalGradleLikeRepoTestCase(packageType, t)) }) } } diff --git a/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_maven_repository.go b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_maven_repository.go index 870c7eedf..43987bd1b 100644 --- a/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_maven_repository.go +++ b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_maven_repository.go @@ -15,17 +15,19 @@ func DataSourceArtifactoryRemoteMavenRepository() *schema.Resource { return nil, err } - return &remote.JavaRemoteRepo{ - RepositoryRemoteBaseParams: remote.RepositoryRemoteBaseParams{ - Rclass: rclass, - PackageType: remote.MavenPackageType, - RepoLayoutRef: repoLayout.(string), + return &remote.MavenRemoteRepo{ + JavaRemoteRepo: remote.JavaRemoteRepo{ + RepositoryRemoteBaseParams: remote.RepositoryRemoteBaseParams{ + Rclass: rclass, + PackageType: remote.MavenPackageType, + RepoLayoutRef: repoLayout.(string), + }, + SuppressPomConsistencyChecks: false, }, - SuppressPomConsistencyChecks: false, }, nil } - mavenSchema := remote.JavaRemoteSchema(false, remote.MavenPackageType, false) + mavenSchema := remote.MavenRemoteSchema(false) return &schema.Resource{ Schema: mavenSchema, diff --git a/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_npm_repository.go b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_npm_repository.go new file mode 100644 index 000000000..4da4ff0e9 --- /dev/null +++ b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_npm_repository.go @@ -0,0 +1,34 @@ +package remote + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/datasource/repository" + resource_repository "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository" + "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository/remote" + "github.com/jfrog/terraform-provider-shared/packer" +) + +func DataSourceArtifactoryRemoteNpmRepository() *schema.Resource { + constructor := func() (interface{}, error) { + repoLayout, err := resource_repository.GetDefaultRepoLayoutRef(rclass, remote.GenericPackageType)() + if err != nil { + return nil, err + } + + return &remote.NpmRemoteRepo{ + RepositoryRemoteBaseParams: remote.RepositoryRemoteBaseParams{ + Rclass: rclass, + PackageType: remote.NpmPackageType, + RepoLayoutRef: repoLayout.(string), + }, + }, nil + } + + npmSchema := remote.NpmRemoteSchema(false) + + return &schema.Resource{ + Schema: npmSchema, + ReadContext: repository.MkRepoReadDataSource(packer.Default(npmSchema), constructor), + Description: "Provides a data source for a remote NPM repository", + } +} diff --git a/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_repository_test.go b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_repository_test.go index f2eee9c35..406afda07 100644 --- a/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_repository_test.go +++ b/pkg/artifactory/datasource/repository/remote/datasource_artifactory_remote_repository_test.go @@ -268,6 +268,7 @@ func TestAccDataSourceRemoteDockerRepository(t *testing.T) { enable_token_authentication = true block_pushing_schema1 = true external_dependencies_patterns = ["*foo"] + curated = false } data "artifactory_remote_docker_repository" "{{ .name }}" { @@ -293,6 +294,7 @@ func TestAccDataSourceRemoteDockerRepository(t *testing.T) { resource.TestCheckResourceAttr(fqrn, "block_pushing_schema1", "true"), resource.TestCheckResourceAttr(fqrn, "external_dependencies_patterns.#", "1"), resource.TestCheckResourceAttr(fqrn, "external_dependencies_patterns.0", "*foo"), + resource.TestCheckResourceAttr(fqrn, "curated", "false"), ), }, }, @@ -497,6 +499,7 @@ func TestAccDataSourceRemoteMavenRepository(t *testing.T) { params["name"] = name params["resource_name"] = "artifactory_remote_maven_repository" params["suppress_pom_consistency_checks"] = false + params["curated"] = false resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -514,6 +517,7 @@ func TestAccDataSourceRemoteMavenRepository(t *testing.T) { resource.TestCheckResourceAttr(fqrn, "handle_snapshots", fmt.Sprintf("%t", params["handle_snapshots"])), resource.TestCheckResourceAttr(fqrn, "suppress_pom_consistency_checks", fmt.Sprintf("%t", params["suppress_pom_consistency_checks"])), resource.TestCheckResourceAttr(fqrn, "reject_invalid_jars", fmt.Sprintf("%t", params["reject_invalid_jars"])), + resource.TestCheckResourceAttr(fqrn, "curated", "false"), ), }, }, @@ -571,8 +575,9 @@ func TestAccDataSourceRemotePypiRepository(t *testing.T) { config := utilsdk.ExecuteTemplate( "TestAccDataSourceRemotePypiRepository", `resource "artifactory_remote_pypi_repository" "{{ .name }}" { - key = "{{ .name }}" - url = "http://tempurl.org" + key = "{{ .name }}" + url = "http://tempurl.org" + curated = false } data "artifactory_remote_pypi_repository" "{{ .name }}" { @@ -595,6 +600,7 @@ func TestAccDataSourceRemotePypiRepository(t *testing.T) { resource.TestCheckResourceAttr(fqrn, "url", "http://tempurl.org"), resource.TestCheckResourceAttr(fqrn, "pypi_registry_url", "https://pypi.org"), resource.TestCheckResourceAttr(fqrn, "pypi_repository_suffix", "simple"), + resource.TestCheckResourceAttr(fqrn, "curated", "false"), ), }, }, diff --git a/pkg/artifactory/datasource/repository/virtual/datasource_artifactory_virtual_repository_test.go b/pkg/artifactory/datasource/repository/virtual/datasource_artifactory_virtual_repository_test.go index f1f4aca5b..652365c3f 100644 --- a/pkg/artifactory/datasource/repository/virtual/datasource_artifactory_virtual_repository_test.go +++ b/pkg/artifactory/datasource/repository/virtual/datasource_artifactory_virtual_repository_test.go @@ -2,7 +2,6 @@ package virtual_test import ( "fmt" - "strings" "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -12,17 +11,11 @@ import ( "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/security" "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) func TestAccDataSourceVirtualAllGenericLikePackageTypes(t *testing.T) { for _, packageType := range virtual.PackageTypesLikeGeneric { - title := fmt.Sprintf( - "TestVirtual%sRepo", - cases.Title(language.AmericanEnglish).String(strings.ToLower(packageType)), - ) - t.Run(title, func(t *testing.T) { + t.Run(packageType, func(t *testing.T) { resource.Test(mkNewVirtualTestCase(packageType, t, map[string]interface{}{ "description": fmt.Sprintf("%s virtual repository public description testing.", packageType), })) @@ -32,11 +25,7 @@ func TestAccDataSourceVirtualAllGenericLikePackageTypes(t *testing.T) { func TestAccDataSourceVirtualAllGenericLikeRetrievalPackageTypes(t *testing.T) { for _, packageType := range virtual.PackageTypesLikeGenericWithRetrievalCachePeriodSecs { - title := fmt.Sprintf( - "TestVirtual%sRepo", - cases.Title(language.AmericanEnglish).String(strings.ToLower(packageType)), - ) - t.Run(title, func(t *testing.T) { + t.Run(packageType, func(t *testing.T) { resource.Test(mkNewVirtualTestCase(packageType, t, map[string]interface{}{ "description": fmt.Sprintf("%s virtual repository public description testing.", packageType), "retrieval_cache_period_seconds": 650, @@ -47,9 +36,7 @@ func TestAccDataSourceVirtualAllGenericLikeRetrievalPackageTypes(t *testing.T) { func TestAccDataSourceVirtualAllGradleLikePackageTypes(t *testing.T) { for _, packageType := range repository.GradleLikePackageTypes { - title := fmt.Sprintf("TestVirtual%sRepo", - cases.Title(language.AmericanEnglish).String(strings.ToLower(packageType))) - t.Run(title, func(t *testing.T) { + t.Run(packageType, func(t *testing.T) { resource.Test(mkNewVirtualTestCase(packageType, t, map[string]interface{}{ "description": fmt.Sprintf("%s virtual repository public description testing.", packageType), "force_maven_authentication": true, diff --git a/pkg/artifactory/provider/datasources.go b/pkg/artifactory/provider/datasources.go index cddfb2ffe..1e5649e94 100644 --- a/pkg/artifactory/provider/datasources.go +++ b/pkg/artifactory/provider/datasources.go @@ -47,6 +47,7 @@ func datasourcesMap() map[string]*schema.Resource { "artifactory_remote_go_repository": datasource_remote.DataSourceArtifactoryRemoteGoRepository(), "artifactory_remote_helm_repository": datasource_remote.DataSourceArtifactoryRemoteHelmRepository(), "artifactory_remote_maven_repository": datasource_remote.DataSourceArtifactoryRemoteMavenRepository(), + "artifactory_remote_npm_repository": datasource_remote.DataSourceArtifactoryRemoteNpmRepository(), "artifactory_remote_nuget_repository": datasource_remote.DataSourceArtifactoryRemoteNugetRepository(), "artifactory_remote_pypi_repository": datasource_remote.DataSourceArtifactoryRemotePypiRepository(), "artifactory_remote_terraform_repository": datasource_remote.DataSourceArtifactoryRemoteTerraformRepository(), diff --git a/pkg/artifactory/provider/resources.go b/pkg/artifactory/provider/resources.go index 9ae82b370..1021a84ee 100644 --- a/pkg/artifactory/provider/resources.go +++ b/pkg/artifactory/provider/resources.go @@ -53,6 +53,7 @@ func resourcesMap() map[string]*schema.Resource { "artifactory_remote_helm_repository": remote.ResourceArtifactoryRemoteHelmRepository(), "artifactory_remote_huggingfaceml_repository": remote.ResourceArtifactoryRemoteHuggingFaceRepository(), "artifactory_remote_maven_repository": remote.ResourceArtifactoryRemoteMavenRepository(), + "artifactory_remote_npm_repository": remote.ResourceArtifactoryRemoteNpmRepository(), "artifactory_remote_nuget_repository": remote.ResourceArtifactoryRemoteNugetRepository(), "artifactory_remote_pypi_repository": remote.ResourceArtifactoryRemotePypiRepository(), "artifactory_remote_terraform_repository": remote.ResourceArtifactoryRemoteTerraformRepository(), diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go index 820681833..c5124ac13 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go @@ -19,8 +19,6 @@ import ( "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" "github.com/jfrog/terraform-provider-shared/validator" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) // To make tests work add `ARTIFACTORY_URL_2=http://artifactory-2:8081` or `ARTIFACTORY_URL_2=http://host.docker.internal:9081` @@ -183,10 +181,9 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test } func TestAccFederatedRepoGenericTypes(t *testing.T) { - for _, repo := range federated.PackageTypesLikeGeneric { - title := cases.Title(language.AmericanEnglish).String(repo) - t.Run(title, func(t *testing.T) { - resource.Test(federatedTestCase(repo, t)) + for _, packageType := range federated.PackageTypesLikeGeneric { + t.Run(packageType, func(t *testing.T) { + resource.Test(federatedTestCase(packageType, t)) }) } } @@ -1122,10 +1119,9 @@ func makeFederatedGradleLikeRepoTestCase(repoType string, t *testing.T) (*testin } func TestAccFederatedAllGradleLikePackageTypes(t *testing.T) { - for _, repoType := range repository.GradleLikePackageTypes { - title := cases.Title(language.AmericanEnglish).String(repoType) - t.Run(title, func(t *testing.T) { - resource.Test(makeFederatedGradleLikeRepoTestCase(repoType, t)) + for _, packageType := range repository.GradleLikePackageTypes { + t.Run(packageType, func(t *testing.T) { + resource.Test(makeFederatedGradleLikeRepoTestCase(packageType, t)) }) } } @@ -1369,8 +1365,7 @@ func makeFederatedTerraformRepoTestCase(registryType string, t *testing.T) (*tes func TestAccFederatedTerraformRepositories(t *testing.T) { for _, registryType := range []string{"module", "provider"} { - title := cases.Title(language.AmericanEnglish).String(registryType) - t.Run(title, func(t *testing.T) { + t.Run(registryType, func(t *testing.T) { resource.Test(makeFederatedTerraformRepoTestCase(registryType, t)) }) } diff --git a/pkg/artifactory/resource/repository/local/resource_artifactory_local_repository_test.go b/pkg/artifactory/resource/repository/local/resource_artifactory_local_repository_test.go index 6a049d347..7d90e0b7c 100644 --- a/pkg/artifactory/resource/repository/local/resource_artifactory_local_repository_test.go +++ b/pkg/artifactory/resource/repository/local/resource_artifactory_local_repository_test.go @@ -1042,9 +1042,9 @@ func makeLocalRepoTestCase(repoType string, t *testing.T) (*testing.T, resource. // Test case to cover when repoLayoutRef not left as blank and set to some value other than default func TestAccAllLocalRepoTypes(t *testing.T) { - for _, repo := range local.PackageTypesLikeGeneric { - t.Run(repo, func(t *testing.T) { - resource.Test(makeLocalRepoTestCase(repo, t)) + for _, packageType := range local.PackageTypesLikeGeneric { + t.Run(packageType, func(t *testing.T) { + resource.Test(makeLocalRepoTestCase(packageType, t)) }) } } @@ -1087,9 +1087,9 @@ func makeLocalGradleLikeRepoTestCase(repoType string, t *testing.T) (*testing.T, } func TestAccAllGradleLikeLocalRepoTypes(t *testing.T) { - for _, repoType := range repository.GradleLikePackageTypes { - t.Run(fmt.Sprintf("TestLocal%sRepo", strings.Title(strings.ToLower(repoType))), func(t *testing.T) { - resource.Test(makeLocalGradleLikeRepoTestCase(repoType, t)) + for _, packageType := range repository.GradleLikePackageTypes { + t.Run(packageType, func(t *testing.T) { + resource.Test(makeLocalGradleLikeRepoTestCase(packageType, t)) }) } } diff --git a/pkg/artifactory/resource/repository/remote/curation.go b/pkg/artifactory/resource/repository/remote/curation.go new file mode 100644 index 000000000..cf3d4e1b8 --- /dev/null +++ b/pkg/artifactory/resource/repository/remote/curation.go @@ -0,0 +1,16 @@ +package remote + +import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + +type RepositoryCurationParams struct { + Curated bool `json:"curated"` +} + +var CurationRemoteRepoSchema = map[string]*schema.Schema{ + "curated": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enable repository to be protected by the Curation service.", + }, +} diff --git a/pkg/artifactory/resource/repository/remote/remote.go b/pkg/artifactory/resource/repository/remote/remote.go index 036a53f72..162424a5b 100644 --- a/pkg/artifactory/resource/repository/remote/remote.go +++ b/pkg/artifactory/resource/repository/remote/remote.go @@ -95,7 +95,6 @@ var PackageTypesLikeBasic = []string{ "debian", "gems", "gitlfs", - "npm", "opkg", "p2", "pub", diff --git a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_docker_repository.go b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_docker_repository.go index a4f5c4725..e8dcd3896 100644 --- a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_docker_repository.go +++ b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_docker_repository.go @@ -13,6 +13,7 @@ const DockerPackageType = "docker" var DockerRemoteSchema = func(isResource bool) map[string]*schema.Schema { return utilsdk.MergeMaps( BaseRemoteRepoSchema(isResource), + CurationRemoteRepoSchema, map[string]*schema.Schema{ "external_dependencies_enabled": { Type: schema.TypeBool, @@ -54,6 +55,7 @@ var DockerRemoteSchema = func(isResource bool) map[string]*schema.Schema { type DockerRemoteRepo struct { RepositoryRemoteBaseParams + RepositoryCurationParams ExternalDependenciesEnabled bool `json:"externalDependenciesEnabled"` ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"` EnableTokenAuthentication bool `json:"enableTokenAuthentication"` @@ -64,7 +66,10 @@ func ResourceArtifactoryRemoteDockerRepository() *schema.Resource { var unpackDockerRemoteRepo = func(s *schema.ResourceData) (interface{}, string, error) { d := &utilsdk.ResourceData{ResourceData: s} repo := DockerRemoteRepo{ - RepositoryRemoteBaseParams: UnpackBaseRemoteRepo(s, DockerPackageType), + RepositoryRemoteBaseParams: UnpackBaseRemoteRepo(s, DockerPackageType), + RepositoryCurationParams: RepositoryCurationParams{ + Curated: d.GetBool("curated", false), + }, EnableTokenAuthentication: d.GetBool("enable_token_authentication", false), ExternalDependenciesEnabled: d.GetBool("external_dependencies_enabled", false), BlockPushingSchema1: d.GetBool("block_pushing_schema1", false), diff --git a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_maven_repository.go b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_maven_repository.go index 6c49ead70..73f8f233b 100644 --- a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_maven_repository.go +++ b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_maven_repository.go @@ -13,21 +13,44 @@ import ( const MavenPackageType = "maven" +type MavenRemoteRepo struct { + JavaRemoteRepo + RepositoryCurationParams +} + +var MavenRemoteSchema = func(isResource bool) map[string]*schema.Schema { + return utilsdk.MergeMaps( + JavaRemoteSchema(isResource, MavenPackageType, false), + CurationRemoteRepoSchema, + ) +} + func ResourceArtifactoryRemoteMavenRepository() *schema.Resource { - mavenRemoteSchema := JavaRemoteSchema(true, MavenPackageType, false) + mavenRemoteSchema := MavenRemoteSchema(true) var unpackMavenRemoteRepo = func(data *schema.ResourceData) (interface{}, string, error) { - repo := UnpackJavaRemoteRepo(data, MavenPackageType) + d := &utilsdk.ResourceData{ResourceData: data} + repo := MavenRemoteRepo{ + JavaRemoteRepo: UnpackJavaRemoteRepo(data, MavenPackageType), + RepositoryCurationParams: RepositoryCurationParams{ + Curated: d.GetBool("curated", false), + }, + } return repo, repo.Id(), nil } constructor := func() (interface{}, error) { - return &JavaRemoteRepo{ - RepositoryRemoteBaseParams: RepositoryRemoteBaseParams{ - Rclass: rclass, - PackageType: MavenPackageType, + return &MavenRemoteRepo{ + JavaRemoteRepo{ + RepositoryRemoteBaseParams: RepositoryRemoteBaseParams{ + Rclass: rclass, + PackageType: MavenPackageType, + }, + SuppressPomConsistencyChecks: false, + }, + RepositoryCurationParams{ + Curated: false, }, - SuppressPomConsistencyChecks: false, }, nil } diff --git a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_npm_repository.go b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_npm_repository.go new file mode 100644 index 000000000..51d1ccdd8 --- /dev/null +++ b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_npm_repository.go @@ -0,0 +1,55 @@ +package remote + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository" + "github.com/jfrog/terraform-provider-shared/packer" + utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" +) + +type NpmRemoteRepo struct { + RepositoryRemoteBaseParams + RepositoryCurationParams +} + +const NpmPackageType = "npm" + +var NpmRemoteSchema = func(isResource bool) map[string]*schema.Schema { + return utilsdk.MergeMaps( + BaseRemoteRepoSchema(isResource), + CurationRemoteRepoSchema, + repository.RepoLayoutRefSchema(rclass, NpmPackageType), + ) +} + +func ResourceArtifactoryRemoteNpmRepository() *schema.Resource { + var unpack = func(s *schema.ResourceData) (interface{}, string, error) { + d := &utilsdk.ResourceData{ResourceData: s} + repo := NpmRemoteRepo{ + RepositoryRemoteBaseParams: UnpackBaseRemoteRepo(s, NpmPackageType), + RepositoryCurationParams: RepositoryCurationParams{ + Curated: d.GetBool("curated", false), + }, + } + return repo, repo.Id(), nil + } + + constructor := func() (interface{}, error) { + repoLayout, err := repository.GetDefaultRepoLayoutRef(rclass, NpmPackageType)() + if err != nil { + return nil, err + } + + return &NpmRemoteRepo{ + RepositoryRemoteBaseParams: RepositoryRemoteBaseParams{ + Rclass: rclass, + PackageType: NpmPackageType, + RepoLayoutRef: repoLayout.(string), + }, + }, nil + } + + npmSchema := NpmRemoteSchema(true) + + return mkResourceSchema(npmSchema, packer.Default(npmSchema), unpack, constructor) +} diff --git a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_pypi_repository.go b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_pypi_repository.go index 4fb085250..cb27ae20b 100644 --- a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_pypi_repository.go +++ b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_pypi_repository.go @@ -12,6 +12,7 @@ const PypiPackageType = "pypi" type PypiRemoteRepo struct { RepositoryRemoteBaseParams + RepositoryCurationParams PypiRegistryUrl string `json:"pyPIRegistryUrl"` PypiRepositorySuffix string `json:"pyPIRepositorySuffix"` } @@ -19,6 +20,7 @@ type PypiRemoteRepo struct { var PypiRemoteSchema = func(isResource bool) map[string]*schema.Schema { return utilsdk.MergeMaps( BaseRemoteRepoSchema(isResource), + CurationRemoteRepoSchema, map[string]*schema.Schema{ "pypi_registry_url": { Type: schema.TypeString, @@ -45,8 +47,11 @@ func ResourceArtifactoryRemotePypiRepository() *schema.Resource { d := &utilsdk.ResourceData{ResourceData: s} repo := PypiRemoteRepo{ RepositoryRemoteBaseParams: UnpackBaseRemoteRepo(s, PypiPackageType), - PypiRegistryUrl: d.GetString("pypi_registry_url", false), - PypiRepositorySuffix: d.GetString("pypi_repository_suffix", false), + RepositoryCurationParams: RepositoryCurationParams{ + Curated: d.GetBool("curated", false), + }, + PypiRegistryUrl: d.GetString("pypi_registry_url", false), + PypiRepositorySuffix: d.GetString("pypi_repository_suffix", false), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_repository_test.go b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_repository_test.go index d79ff000a..26e184aa4 100644 --- a/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_repository_test.go +++ b/pkg/artifactory/resource/repository/remote/resource_artifactory_remote_repository_test.go @@ -214,7 +214,7 @@ func TestAccRemoteDockerRepositoryDepListEmptyStringFails(t *testing.T) { }) } -func TestAccRemoteDockerRepoUpdate(t *testing.T) { +func TestAccRemoteDockerRepo_full(t *testing.T) { id, fqrn, name := testutil.MkNames("docker-remote-", "artifactory_remote_docker_repository") var testData = map[string]string{ "resource_name": name, @@ -326,6 +326,7 @@ func TestAccRemoteDockerRepositoryWithAdditionalCheckFunctions(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, }) resource.Test(t, testCase) } @@ -473,6 +474,7 @@ func TestAccRemoteNpmRepository(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, })) } @@ -489,6 +491,7 @@ func TestAccRemoteNpmRepositoryWithAdditionalCheckFunctions(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, })) } @@ -504,6 +507,7 @@ func TestAccRemotePypiRepository(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, })) } @@ -520,6 +524,7 @@ func TestAccRemotePypiRepositoryWithAdditionalCheckFunctions(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, })) } @@ -534,6 +539,7 @@ func TestAccRemoteMavenRepository(t *testing.T) { "properties_enabled": true, "source_origin_absence_detection": true, }, + "curated": false, })) } @@ -831,12 +837,11 @@ func mkNewRemoteTestCase(repoType string, t *testing.T, extraFields map[string]i certificateAlias := fmt.Sprintf("certificate-%d", testutil.RandomInt()) defaultFields := map[string]interface{}{ - "key": name, - "url": "https://registry.npmjs.org/", - "username": "user", - "password": "Passw0rd!", - "proxy": "", - + "key": name, + "url": "https://registry.npmjs.org/", + "username": "user", + "password": "Passw0rd!", + "proxy": "", "description": "description", "notes": "notes", "includes_pattern": "**/*.js", diff --git a/pkg/artifactory/resource/repository/virtual/resource_artifactory_virtual_repository_test.go b/pkg/artifactory/resource/repository/virtual/resource_artifactory_virtual_repository_test.go index f1d941659..4b2f9d41b 100644 --- a/pkg/artifactory/resource/repository/virtual/resource_artifactory_virtual_repository_test.go +++ b/pkg/artifactory/resource/repository/virtual/resource_artifactory_virtual_repository_test.go @@ -4,7 +4,6 @@ import ( "fmt" "math/rand" "regexp" - "strings" "testing" "time" @@ -17,8 +16,6 @@ import ( "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" "github.com/jfrog/terraform-provider-shared/validator" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) func TestAccVirtualRepository_basic(t *testing.T) { @@ -757,11 +754,10 @@ func TestAccVirtualRepository(t *testing.T) { } func TestAccAllVirtualGradleLikeRepository(t *testing.T) { - for _, repoType := range repository.GradleLikePackageTypes { - title := fmt.Sprintf("TestVirtual%sRepo", cases.Title(language.AmericanEnglish).String(strings.ToLower(repoType))) - t.Run(title, func(t *testing.T) { - resource.Test(mkNewVirtualTestCase(repoType, t, map[string]interface{}{ - "description": fmt.Sprintf("%s virtual repository public description testing.", repoType), + for _, packageType := range repository.GradleLikePackageTypes { + t.Run(packageType, func(t *testing.T) { + resource.Test(mkNewVirtualTestCase(packageType, t, map[string]interface{}{ + "description": fmt.Sprintf("%s virtual repository public description testing.", packageType), "pom_repository_references_cleanup_policy": "discard_active_reference", })) }) diff --git a/pkg/artifactory/resource/webhook/resource_artifactory_webhook_test.go b/pkg/artifactory/resource/webhook/resource_artifactory_webhook_test.go index 653b93cd1..cc7102165 100644 --- a/pkg/artifactory/resource/webhook/resource_artifactory_webhook_test.go +++ b/pkg/artifactory/resource/webhook/resource_artifactory_webhook_test.go @@ -5,7 +5,6 @@ import ( "fmt" "reflect" "regexp" - "strings" "testing" "github.com/go-resty/resty/v2" @@ -16,8 +15,6 @@ import ( "github.com/jfrog/terraform-provider-shared/testutil" utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" "github.com/jfrog/terraform-provider-shared/validator" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) var domainRepoTypeLookup = map[string]string{ @@ -84,11 +81,7 @@ var releaseBundleTemplate = ` func TestAccWebhookCriteriaValidation(t *testing.T) { for _, webhookType := range webhook.TypesSupported { - title := fmt.Sprintf( - "TestWebhook%sCriteriaValidation", - cases.Title(language.AmericanEnglish).String(strings.ToLower(webhookType)), - ) - t.Run(title, func(t *testing.T) { + t.Run(webhookType, func(t *testing.T) { resource.Test(webhookCriteriaValidationTestCase(webhookType, t)) }) } @@ -253,11 +246,7 @@ func TestAccWebhookAllTypes(t *testing.T) { // Can only realistically test these 3 types of webhook since creating // build, release_bundle, or distribution in test environment is almost impossible for _, webhookType := range []string{"artifact", "artifact_property", "docker"} { - title := fmt.Sprintf( - "TestWebhook%s", - cases.Title(language.AmericanEnglish).String(strings.ToLower(webhookType)), - ) - t.Run(title, func(t *testing.T) { + t.Run(webhookType, func(t *testing.T) { resource.Test(webhookTestCase(webhookType, t)) }) } @@ -267,11 +256,7 @@ func TestAccCustomWebhookAllTypes(t *testing.T) { // Can only realistically test these 3 types of webhook since creating // build, release_bundle, or distribution in test environment is almost impossible for _, webhookType := range []string{"artifact", "artifact_property", "docker"} { - title := fmt.Sprintf( - "TestWebhook%s", - cases.Title(language.AmericanEnglish).String(strings.ToLower(webhookType)), - ) - t.Run(title, func(t *testing.T) { + t.Run(webhookType, func(t *testing.T) { resource.Test(customWebhookTestCase(webhookType, t)) }) } From 74cb707c2d7fbda48b058088a1bfd804a0bdb4b3 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Tue, 7 Nov 2023 15:41:47 -0800 Subject: [PATCH 23/44] Update CHANGELOG --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 565170603..1b953156e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ -## 9.7.4 (Nov 3, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.3 +## 9.7.5 (Nov 8, 2023) + +IMPROVEMENTS: + +* resource/artifactory_remote_docker_repository, resource/artifactory_remote_maven_repository, resource/artifactory_npm_docker_repository,resource/artifactory_remote_pypi_repository: Add `curated` attribute to support enabling the repository resource for Curation Service. Issue: [#831](https://github.com/jfrog/terraform-provider-artifactory/issues/831) PR: [#844](https://github.com/jfrog/terraform-provider-artifactory/pull/844) +* resource/artifactory_pull_replication: Add missing deprecation message to documentation. PR: [#843](https://github.com/jfrog/terraform-provider-artifactory/pull/843) + +## 9.7.4 (Nov 6, 2023). Tested on Artifactory 7.71.3 with Terraform CLI v1.6.3 IMPROVEMENTS: From 7d454e232951685f5d8fdc1e3bb2d7251c675e7f Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Wed, 8 Nov 2023 00:06:09 +0000 Subject: [PATCH 24/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b953156e..d635c6a24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.5 (Nov 8, 2023) +## 9.7.5 (Nov 8, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.3 IMPROVEMENTS: From edba04c765ae36f642e0880a237ed3b557eab32e Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 8 Nov 2023 09:13:29 -0800 Subject: [PATCH 25/44] Bump minor version vs patch version go.mod and go.sum tidy up --- CHANGELOG.md | 2 +- go.mod | 2 +- go.sum | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d635c6a24..6065d9aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.7.5 (Nov 8, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.3 +## 9.8.0 (Nov 8, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.3 IMPROVEMENTS: diff --git a/go.mod b/go.mod index 84da5a327..7053d1d3e 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,6 @@ require ( github.com/stretchr/testify v1.7.2 golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 golang.org/x/net v0.17.0 - golang.org/x/text v0.13.0 gopkg.in/ldap.v2 v2.5.1 gopkg.in/yaml.v3 v3.0.1 ) @@ -80,6 +79,7 @@ require ( golang.org/x/crypto v0.14.0 // indirect golang.org/x/mod v0.11.0 // indirect golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.56.3 // indirect diff --git a/go.sum b/go.sum index f730192c8..b07a4f38b 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,7 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= @@ -116,6 +117,7 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH 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/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jfrog/terraform-provider-shared v1.20.0 h1:T5AFbn4Su3tlNZTIXwb8Bi4vq/LZMFH312V2z8d3IsI= github.com/jfrog/terraform-provider-shared v1.20.0/go.mod h1:KEYnVOggRuQT6qLR05ra0QfQa0SeYnkMnN0ZqIgQHqI= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= @@ -125,6 +127,7 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -141,6 +144,7 @@ github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2c github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= @@ -161,6 +165,7 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE= @@ -181,6 +186,7 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= 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/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -188,6 +194,7 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/zclconf/go-cty v1.13.3 h1:m+b9q3YDbg6Bec5rr+KGy1MzEVzY/jC2X+YX4yqKtHI= github.com/zclconf/go-cty v1.13.3/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -247,6 +254,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU= gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 2a2a87237beaea05a463b20b032a9e87e742bfc9 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 16 Nov 2023 15:52:55 -0800 Subject: [PATCH 26/44] Add `proxy` and `disable_proxy` attributes to all federated repos --- .../federated_alpine_repository.md | 2 + .../federated_bower_repository.md | 2 + .../federated_cargo_repository.md | 2 + .../data-sources/federated_chef_repository.md | 2 + .../federated_cocoapods_repository.md | 2 + .../federated_composer_repository.md | 2 + .../federated_conan_repository.md | 2 + .../federated_conda_repository.md | 2 + .../data-sources/federated_cran_repository.md | 2 + .../federated_debian_repository.md | 2 + .../federated_docker_v1_repository.md | 2 + .../federated_docker_v2_repository.md | 2 + .../data-sources/federated_gems_repository.md | 2 + .../federated_generic_repository.md | 2 + .../federated_gitlfs_repository.md | 2 + docs/data-sources/federated_go_repository.md | 2 + .../federated_gradle_repository.md | 2 + .../data-sources/federated_helm_repository.md | 2 + docs/data-sources/federated_ivy_repository.md | 2 + .../federated_maven_repository.md | 2 + docs/data-sources/federated_npm_repository.md | 2 + .../federated_nuget_repository.md | 2 + .../data-sources/federated_opkg_repository.md | 2 + .../federated_puppet_repository.md | 2 + .../data-sources/federated_pypi_repository.md | 2 + docs/data-sources/federated_rpm_repository.md | 2 + docs/data-sources/federated_sbt_repository.md | 2 + .../federated_swift_repository.md | 2 + .../federated_terraform_module_repository.md | 2 + ...federated_terraform_provider_repository.md | 2 + .../federated_vagrant_repository.md | 2 + docs/resources/federated_alpine_repository.md | 3 +- docs/resources/federated_bower_repository.md | 3 +- docs/resources/federated_cargo_repository.md | 3 +- docs/resources/federated_chef_repository.md | 3 +- .../federated_cocoapods_repository.md | 3 +- .../federated_composer_repository.md | 3 +- docs/resources/federated_conan_repository.md | 3 +- docs/resources/federated_conda_repository.md | 3 +- docs/resources/federated_cran_repository.md | 3 +- docs/resources/federated_debian_repository.md | 3 +- docs/resources/federated_docker_repository.md | 3 +- .../federated_docker_v1_repository.md | 3 +- .../federated_docker_v2_repository.md | 3 +- docs/resources/federated_gems_repository.md | 3 +- .../resources/federated_generic_repository.md | 3 +- docs/resources/federated_gitlfs_repository.md | 3 +- docs/resources/federated_go_repository.md | 3 +- docs/resources/federated_gradle_repository.md | 3 +- docs/resources/federated_helm_repository.md | 3 +- docs/resources/federated_ivy_repository.md | 3 +- docs/resources/federated_maven_repository.md | 3 +- docs/resources/federated_npm_repository.md | 3 +- docs/resources/federated_nuget_repository.md | 2 + docs/resources/federated_opkg_repository.md | 3 +- docs/resources/federated_puppet_repository.md | 3 +- docs/resources/federated_pypi_repository.md | 3 +- docs/resources/federated_rpm_repository.md | 3 +- docs/resources/federated_sbt_repository.md | 3 +- docs/resources/federated_swift_repository.md | 3 +- .../federated_terraform_module_repository.md | 3 +- ...federated_terraform_provider_repository.md | 3 +- .../resources/federated_vagrant_repository.md | 3 +- go.sum | 8 -- ...artifactory_federated_alpine_repository.go | 6 +- ..._artifactory_federated_cargo_repository.go | 2 +- ..._artifactory_federated_conan_repository.go | 2 +- ...artifactory_federated_debian_repository.go | 2 +- ...artifactory_federated_docker_repository.go | 4 +- ...rtifactory_federated_generic_repository.go | 14 ++- ...e_artifactory_federated_java_repository.go | 2 +- ..._artifactory_federated_nuget_repository.go | 2 +- ...ce_artifactory_federated_rpm_repository.go | 2 +- ...ifactory_federated_terraform_repository.go | 2 +- .../repository/federated/federated.go | 2 +- .../repository/federated/federated.go | 91 ++++++++------ ...artifactory_federated_alpine_repository.go | 12 +- ..._artifactory_federated_cargo_repository.go | 4 +- ..._artifactory_federated_conan_repository.go | 6 +- ...artifactory_federated_debian_repository.go | 4 +- ...artifactory_federated_docker_repository.go | 7 +- ...rtifactory_federated_generic_repository.go | 20 +-- ...e_artifactory_federated_java_repository.go | 4 +- ..._artifactory_federated_nuget_repository.go | 4 +- ...e_artifactory_federated_repository_test.go | 115 ++++++++++++++++-- ...ce_artifactory_federated_rpm_repository.go | 4 +- ...ifactory_federated_terraform_repository.go | 4 +- .../resource/repository/remote/remote.go | 25 +--- .../resource/repository/repository.go | 25 ++++ 89 files changed, 383 insertions(+), 147 deletions(-) diff --git a/docs/data-sources/federated_alpine_repository.md b/docs/data-sources/federated_alpine_repository.md index 11bf81a7b..5e6be8916 100644 --- a/docs/data-sources/federated_alpine_repository.md +++ b/docs/data-sources/federated_alpine_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_bower_repository.md b/docs/data-sources/federated_bower_repository.md index 34cf4b176..652658cee 100644 --- a/docs/data-sources/federated_bower_repository.md +++ b/docs/data-sources/federated_bower_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_cargo_repository.md b/docs/data-sources/federated_cargo_repository.md index b29e6d432..dea551cce 100644 --- a/docs/data-sources/federated_cargo_repository.md +++ b/docs/data-sources/federated_cargo_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_chef_repository.md b/docs/data-sources/federated_chef_repository.md index 0fd6a91d3..ae5da5bf3 100644 --- a/docs/data-sources/federated_chef_repository.md +++ b/docs/data-sources/federated_chef_repository.md @@ -29,3 +29,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_cocoapods_repository.md b/docs/data-sources/federated_cocoapods_repository.md index 0c8c431cf..a569ddead 100644 --- a/docs/data-sources/federated_cocoapods_repository.md +++ b/docs/data-sources/federated_cocoapods_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_composer_repository.md b/docs/data-sources/federated_composer_repository.md index 9725d2270..7801d04fb 100644 --- a/docs/data-sources/federated_composer_repository.md +++ b/docs/data-sources/federated_composer_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_conan_repository.md b/docs/data-sources/federated_conan_repository.md index b81d3430a..41b26f9dc 100644 --- a/docs/data-sources/federated_conan_repository.md +++ b/docs/data-sources/federated_conan_repository.md @@ -28,3 +28,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_conda_repository.md b/docs/data-sources/federated_conda_repository.md index 0f7645a73..67407a6b1 100644 --- a/docs/data-sources/federated_conda_repository.md +++ b/docs/data-sources/federated_conda_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_cran_repository.md b/docs/data-sources/federated_cran_repository.md index dd1227661..65096b378 100644 --- a/docs/data-sources/federated_cran_repository.md +++ b/docs/data-sources/federated_cran_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_debian_repository.md b/docs/data-sources/federated_debian_repository.md index 4e76ce1dd..9c3a284c0 100644 --- a/docs/data-sources/federated_debian_repository.md +++ b/docs/data-sources/federated_debian_repository.md @@ -28,3 +28,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_docker_v1_repository.md b/docs/data-sources/federated_docker_v1_repository.md index 6bc8f9c4f..379c3e03e 100644 --- a/docs/data-sources/federated_docker_v1_repository.md +++ b/docs/data-sources/federated_docker_v1_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_docker_v2_repository.md b/docs/data-sources/federated_docker_v2_repository.md index e83fdf2cf..163a49747 100644 --- a/docs/data-sources/federated_docker_v2_repository.md +++ b/docs/data-sources/federated_docker_v2_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_gems_repository.md b/docs/data-sources/federated_gems_repository.md index 28527f712..c8be30c4f 100644 --- a/docs/data-sources/federated_gems_repository.md +++ b/docs/data-sources/federated_gems_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_generic_repository.md b/docs/data-sources/federated_generic_repository.md index fac4a26a5..092396c19 100644 --- a/docs/data-sources/federated_generic_repository.md +++ b/docs/data-sources/federated_generic_repository.md @@ -28,3 +28,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_gitlfs_repository.md b/docs/data-sources/federated_gitlfs_repository.md index 42a451a6a..a6a2d9529 100644 --- a/docs/data-sources/federated_gitlfs_repository.md +++ b/docs/data-sources/federated_gitlfs_repository.md @@ -28,3 +28,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_go_repository.md b/docs/data-sources/federated_go_repository.md index 3296f8e5c..d330f3b16 100644 --- a/docs/data-sources/federated_go_repository.md +++ b/docs/data-sources/federated_go_repository.md @@ -27,3 +27,5 @@ The following arguments are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_gradle_repository.md b/docs/data-sources/federated_gradle_repository.md index ae48019ee..aa2ca62ad 100644 --- a/docs/data-sources/federated_gradle_repository.md +++ b/docs/data-sources/federated_gradle_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_helm_repository.md b/docs/data-sources/federated_helm_repository.md index 115465def..ca9d13b8a 100644 --- a/docs/data-sources/federated_helm_repository.md +++ b/docs/data-sources/federated_helm_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_ivy_repository.md b/docs/data-sources/federated_ivy_repository.md index d408c1df8..6729a976f 100644 --- a/docs/data-sources/federated_ivy_repository.md +++ b/docs/data-sources/federated_ivy_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_maven_repository.md b/docs/data-sources/federated_maven_repository.md index 47c791bac..017ef9960 100644 --- a/docs/data-sources/federated_maven_repository.md +++ b/docs/data-sources/federated_maven_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_npm_repository.md b/docs/data-sources/federated_npm_repository.md index e2ece9f8b..0b4bf3c1c 100644 --- a/docs/data-sources/federated_npm_repository.md +++ b/docs/data-sources/federated_npm_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_nuget_repository.md b/docs/data-sources/federated_nuget_repository.md index f4f869cc4..b4d736ca0 100644 --- a/docs/data-sources/federated_nuget_repository.md +++ b/docs/data-sources/federated_nuget_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_opkg_repository.md b/docs/data-sources/federated_opkg_repository.md index 9d07640d2..6108caf7b 100644 --- a/docs/data-sources/federated_opkg_repository.md +++ b/docs/data-sources/federated_opkg_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_puppet_repository.md b/docs/data-sources/federated_puppet_repository.md index a52050651..0c63d121d 100644 --- a/docs/data-sources/federated_puppet_repository.md +++ b/docs/data-sources/federated_puppet_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_pypi_repository.md b/docs/data-sources/federated_pypi_repository.md index 9a8c99276..d731d7e72 100644 --- a/docs/data-sources/federated_pypi_repository.md +++ b/docs/data-sources/federated_pypi_repository.md @@ -27,3 +27,5 @@ The following attribute are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_rpm_repository.md b/docs/data-sources/federated_rpm_repository.md index a3833ce0c..9c2d61b4a 100644 --- a/docs/data-sources/federated_rpm_repository.md +++ b/docs/data-sources/federated_rpm_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_sbt_repository.md b/docs/data-sources/federated_sbt_repository.md index 812029adc..fdc1e0882 100644 --- a/docs/data-sources/federated_sbt_repository.md +++ b/docs/data-sources/federated_sbt_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_swift_repository.md b/docs/data-sources/federated_swift_repository.md index 46b868272..356945396 100644 --- a/docs/data-sources/federated_swift_repository.md +++ b/docs/data-sources/federated_swift_repository.md @@ -27,3 +27,5 @@ The following arguments are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_terraform_module_repository.md b/docs/data-sources/federated_terraform_module_repository.md index cfdf88fb7..d3baae982 100644 --- a/docs/data-sources/federated_terraform_module_repository.md +++ b/docs/data-sources/federated_terraform_module_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_terraform_provider_repository.md b/docs/data-sources/federated_terraform_provider_repository.md index 18da0b6cd..439873288 100644 --- a/docs/data-sources/federated_terraform_provider_repository.md +++ b/docs/data-sources/federated_terraform_provider_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [list of attributes from * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/data-sources/federated_vagrant_repository.md b/docs/data-sources/federated_vagrant_repository.md index 5c0082f5c..6579ee6e0 100644 --- a/docs/data-sources/federated_vagrant_repository.md +++ b/docs/data-sources/federated_vagrant_repository.md @@ -27,3 +27,5 @@ The following attributes are supported, along with the [common list of arguments * `url` - Full URL to ending with the repository name. * `enabled` - Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. +* `proxy` - Proxy key from Artifactory Proxies settings. +* `disable_proxy` - When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. diff --git a/docs/resources/federated_alpine_repository.md b/docs/resources/federated_alpine_repository.md index ffaafecf3..ae7e95609 100644 --- a/docs/resources/federated_alpine_repository.md +++ b/docs/resources/federated_alpine_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_bower_repository.md b/docs/resources/federated_bower_repository.md index 43849e948..73dbe6e80 100644 --- a/docs/resources/federated_bower_repository.md +++ b/docs/resources/federated_bower_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_cargo_repository.md b/docs/resources/federated_cargo_repository.md index 99c02327c..faf030032 100644 --- a/docs/resources/federated_cargo_repository.md +++ b/docs/resources/federated_cargo_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_chef_repository.md b/docs/resources/federated_chef_repository.md index 8e3dcec82..f80833c99 100644 --- a/docs/resources/federated_chef_repository.md +++ b/docs/resources/federated_chef_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_cocoapods_repository.md b/docs/resources/federated_cocoapods_repository.md index b41b633dd..6e47adff3 100644 --- a/docs/resources/federated_cocoapods_repository.md +++ b/docs/resources/federated_cocoapods_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_composer_repository.md b/docs/resources/federated_composer_repository.md index 86df6fb1f..42034ed83 100644 --- a/docs/resources/federated_composer_repository.md +++ b/docs/resources/federated_composer_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_conan_repository.md b/docs/resources/federated_conan_repository.md index b0276263d..d4cbff19f 100644 --- a/docs/resources/federated_conan_repository.md +++ b/docs/resources/federated_conan_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_conda_repository.md b/docs/resources/federated_conda_repository.md index 62d67b0b6..134636bf1 100644 --- a/docs/resources/federated_conda_repository.md +++ b/docs/resources/federated_conda_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_cran_repository.md b/docs/resources/federated_cran_repository.md index 88bdaf9ba..ecacb54c7 100644 --- a/docs/resources/federated_cran_repository.md +++ b/docs/resources/federated_cran_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_debian_repository.md b/docs/resources/federated_debian_repository.md index 9204b31c4..b1aabeacb 100644 --- a/docs/resources/federated_debian_repository.md +++ b/docs/resources/federated_debian_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_docker_repository.md b/docs/resources/federated_docker_repository.md index f859481a8..668e59749 100644 --- a/docs/resources/federated_docker_repository.md +++ b/docs/resources/federated_docker_repository.md @@ -38,7 +38,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_docker_v1_repository.md b/docs/resources/federated_docker_v1_repository.md index bba57c2a7..127df67c9 100644 --- a/docs/resources/federated_docker_v1_repository.md +++ b/docs/resources/federated_docker_v1_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_docker_v2_repository.md b/docs/resources/federated_docker_v2_repository.md index e0b8337a4..9d7263d1d 100644 --- a/docs/resources/federated_docker_v2_repository.md +++ b/docs/resources/federated_docker_v2_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_gems_repository.md b/docs/resources/federated_gems_repository.md index fc83ac3d4..bd541e916 100644 --- a/docs/resources/federated_gems_repository.md +++ b/docs/resources/federated_gems_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_generic_repository.md b/docs/resources/federated_generic_repository.md index 7d5d0d355..c7f536b3e 100644 --- a/docs/resources/federated_generic_repository.md +++ b/docs/resources/federated_generic_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_gitlfs_repository.md b/docs/resources/federated_gitlfs_repository.md index 1639706cd..c211b91e4 100644 --- a/docs/resources/federated_gitlfs_repository.md +++ b/docs/resources/federated_gitlfs_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_go_repository.md b/docs/resources/federated_go_repository.md index 5c3fe1c6d..ddcfe503c 100644 --- a/docs/resources/federated_go_repository.md +++ b/docs/resources/federated_go_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_gradle_repository.md b/docs/resources/federated_gradle_repository.md index ba2ac93ff..6effbec60 100644 --- a/docs/resources/federated_gradle_repository.md +++ b/docs/resources/federated_gradle_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_helm_repository.md b/docs/resources/federated_helm_repository.md index 358de43a8..15bb3eeed 100644 --- a/docs/resources/federated_helm_repository.md +++ b/docs/resources/federated_helm_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_ivy_repository.md b/docs/resources/federated_ivy_repository.md index 14847a2ea..c6a86f3e0 100644 --- a/docs/resources/federated_ivy_repository.md +++ b/docs/resources/federated_ivy_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_maven_repository.md b/docs/resources/federated_maven_repository.md index 175d3c364..22bca88cc 100644 --- a/docs/resources/federated_maven_repository.md +++ b/docs/resources/federated_maven_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_npm_repository.md b/docs/resources/federated_npm_repository.md index caba33105..4f9f4076b 100644 --- a/docs/resources/federated_npm_repository.md +++ b/docs/resources/federated_npm_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_nuget_repository.md b/docs/resources/federated_nuget_repository.md index 2b547ab23..be5020d9e 100644 --- a/docs/resources/federated_nuget_repository.md +++ b/docs/resources/federated_nuget_repository.md @@ -36,6 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_opkg_repository.md b/docs/resources/federated_opkg_repository.md index dcefb6950..a9a1cecb9 100644 --- a/docs/resources/federated_opkg_repository.md +++ b/docs/resources/federated_opkg_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_puppet_repository.md b/docs/resources/federated_puppet_repository.md index 3a77e31a3..4f04aa152 100644 --- a/docs/resources/federated_puppet_repository.md +++ b/docs/resources/federated_puppet_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_pypi_repository.md b/docs/resources/federated_pypi_repository.md index 3916f930b..9b2859e23 100644 --- a/docs/resources/federated_pypi_repository.md +++ b/docs/resources/federated_pypi_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_rpm_repository.md b/docs/resources/federated_rpm_repository.md index 22636da44..fd8b51613 100644 --- a/docs/resources/federated_rpm_repository.md +++ b/docs/resources/federated_rpm_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_sbt_repository.md b/docs/resources/federated_sbt_repository.md index de3d84d4e..b66d4a6a7 100644 --- a/docs/resources/federated_sbt_repository.md +++ b/docs/resources/federated_sbt_repository.md @@ -36,7 +36,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_swift_repository.md b/docs/resources/federated_swift_repository.md index 1dccff152..a93b02150 100644 --- a/docs/resources/federated_swift_repository.md +++ b/docs/resources/federated_swift_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_terraform_module_repository.md b/docs/resources/federated_terraform_module_repository.md index 98a2c5908..dcd5c2691 100644 --- a/docs/resources/federated_terraform_module_repository.md +++ b/docs/resources/federated_terraform_module_repository.md @@ -35,7 +35,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_terraform_provider_repository.md b/docs/resources/federated_terraform_provider_repository.md index 5e5451acb..aad3d4903 100644 --- a/docs/resources/federated_terraform_provider_repository.md +++ b/docs/resources/federated_terraform_provider_repository.md @@ -35,7 +35,8 @@ The following attributes are supported, along with the [list of attributes from * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/docs/resources/federated_vagrant_repository.md b/docs/resources/federated_vagrant_repository.md index 59ceac49d..66c729394 100644 --- a/docs/resources/federated_vagrant_repository.md +++ b/docs/resources/federated_vagrant_repository.md @@ -38,7 +38,8 @@ The following arguments are supported, along with the [common list of arguments * `enabled` - (Required) Represents the active state of the federated member. It is supported to change the enabled status of my own member. The config will be updated on the other federated members automatically. * `cleanup_on_delete` - (Optional) Delete all federated members on `terraform destroy` if set to `true`. Default is `false`. This attribute is added to match Terrform logic, so all the resources, created by the provider, must be removed on cleanup. Artifactory's behavior for the federated repositories is different, all the federated repositories stay after the user deletes the initial federated repository. **Caution**: if set to `true` all the repositories in the federation will be deleted, including repositories on other Artifactory instances in the "Circle of trust". This operation can not be reversed. - +* `proxy` - (Optional) Proxy key from Artifactory Proxies settings. Default is empty field. Can't be set if `disable_proxy = true`. +* `disable_proxy` - (Optional, Default: `false`) When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. ## Import diff --git a/go.sum b/go.sum index b07a4f38b..f730192c8 100644 --- a/go.sum +++ b/go.sum @@ -32,7 +32,6 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= @@ -117,7 +116,6 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH 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/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jfrog/terraform-provider-shared v1.20.0 h1:T5AFbn4Su3tlNZTIXwb8Bi4vq/LZMFH312V2z8d3IsI= github.com/jfrog/terraform-provider-shared v1.20.0/go.mod h1:KEYnVOggRuQT6qLR05ra0QfQa0SeYnkMnN0ZqIgQHqI= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= @@ -127,7 +125,6 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -144,7 +141,6 @@ github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2c github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= @@ -165,7 +161,6 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE= @@ -186,7 +181,6 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= 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/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -194,7 +188,6 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/zclconf/go-cty v1.13.3 h1:m+b9q3YDbg6Bec5rr+KGy1MzEVzY/jC2X+YX4yqKtHI= github.com/zclconf/go-cty v1.13.3/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -254,7 +247,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU= gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_alpine_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_alpine_repository.go index ec124048e..f20eae0f5 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_alpine_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_alpine_repository.go @@ -16,12 +16,12 @@ func DataSourceArtifactoryFederatedAlpineRepository() *schema.Resource { alpineFederatedSchema := utilsdk.MergeMaps( local.AlpineLocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) var packAlpineMembers = func(repo interface{}, d *schema.ResourceData) error { - members := repo.(*federated.AlpineFederatedRepositoryParams).Members + members := repo.(*federated.AlpineRepositoryParams).Members return federated.PackMembers(members, d) } @@ -36,7 +36,7 @@ func DataSourceArtifactoryFederatedAlpineRepository() *schema.Resource { ) constructor := func() (interface{}, error) { - return &federated.AlpineFederatedRepositoryParams{ + return &federated.AlpineRepositoryParams{ AlpineLocalRepoParams: local.AlpineLocalRepoParams{ RepositoryBaseParams: local.RepositoryBaseParams{ PackageType: packageType, diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_cargo_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_cargo_repository.go index 1ca67e655..a7ab851b6 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_cargo_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_cargo_repository.go @@ -16,7 +16,7 @@ func DataSourceArtifactoryFederatedCargoRepository() *schema.Resource { cargoFederatedSchema := utilsdk.MergeMaps( local.CargoLocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_conan_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_conan_repository.go index 564f65811..90bf74199 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_conan_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_conan_repository.go @@ -14,7 +14,7 @@ import ( func DataSourceArtifactoryFederatedConanRepository() *schema.Resource { conanSchema := utilsdk.MergeMaps( local.ConanSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, resource_repository.ConanPackageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_debian_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_debian_repository.go index d20ac864b..27c3aebba 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_debian_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_debian_repository.go @@ -16,7 +16,7 @@ func DataSourceArtifactoryFederatedDebianRepository() *schema.Resource { debianFederatedSchema := utilsdk.MergeMaps( local.DebianLocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_docker_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_docker_repository.go index 974b577a3..b3c9e1f04 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_docker_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_docker_repository.go @@ -18,7 +18,7 @@ func DataSourceArtifactoryFederatedDockerV2Repository() *schema.Resource { dockerV2FederatedSchema := utilsdk.MergeMaps( local.DockerV2LocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -60,7 +60,7 @@ func DataSourceArtifactoryFederatedDockerV1Repository() *schema.Resource { dockerFederatedSchema := utilsdk.MergeMaps( local.DockerV1LocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_generic_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_generic_repository.go index c468c828b..e2b84e011 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_generic_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_generic_repository.go @@ -14,12 +14,14 @@ import ( ) func DataSourceArtifactoryFederatedGenericRepository(packageType string) *schema.Resource { - localRepoSchema := local.GetGenericRepoSchema(packageType) - - var federatedSchema = utilsdk.MergeMaps(localRepoSchema, memberSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType)) + var genericSchema = utilsdk.MergeMaps( + local.GetGenericRepoSchema(packageType), + federatedSchema, + resource_repository.RepoLayoutRefSchema(rclass, packageType), + ) var packGenericMembers = func(repo interface{}, d *schema.ResourceData) error { - members := repo.(*federated.FederatedRepositoryParams).Members + members := repo.(*federated.GenericRepositoryParams).Members return federated.PackMembers(members, d) } @@ -34,7 +36,7 @@ func DataSourceArtifactoryFederatedGenericRepository(packageType string) *schema ) constructor := func() (interface{}, error) { - return &federated.FederatedRepositoryParams{ + return &federated.GenericRepositoryParams{ RepositoryBaseParams: local.RepositoryBaseParams{ PackageType: local.GetPackageType(packageType), Rclass: rclass, @@ -43,7 +45,7 @@ func DataSourceArtifactoryFederatedGenericRepository(packageType string) *schema } return &schema.Resource{ - Schema: federatedSchema, + Schema: genericSchema, ReadContext: repository.MkRepoReadDataSource(pkr, constructor), Description: fmt.Sprintf("Provides a data source for a federated %s repository", packageType), } diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_java_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_java_repository.go index f872597e7..3e566df13 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_java_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_java_repository.go @@ -17,7 +17,7 @@ func DataSourceArtifactoryFederatedJavaRepository(packageType string, suppressPo javaFederatedSchema := utilsdk.MergeMaps( local.GetJavaRepoSchema(packageType, suppressPom), - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema("federated", packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_nuget_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_nuget_repository.go index 0b100dd8f..d71752a09 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_nuget_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_nuget_repository.go @@ -16,7 +16,7 @@ func DataSourceArtifactoryFederatedNugetRepository() *schema.Resource { nugetFederatedSchema := utilsdk.MergeMaps( local.NugetLocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_rpm_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_rpm_repository.go index 590cdf047..0f31fd7df 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_rpm_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_rpm_repository.go @@ -16,7 +16,7 @@ func DataSourceArtifactoryFederatedRpmRepository() *schema.Resource { rpmFederatedSchema := utilsdk.MergeMaps( local.RpmLocalSchema, - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_terraform_repository.go b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_terraform_repository.go index 8a77e4f45..eac8cc2b9 100644 --- a/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_terraform_repository.go +++ b/pkg/artifactory/datasource/repository/federated/datasource_artifactory_federated_terraform_repository.go @@ -18,7 +18,7 @@ func DataSourceArtifactoryFederatedTerraformRepository(registryType string) *sch terraformFederatedSchema := utilsdk.MergeMaps( local.GetTerraformLocalSchema(registryType), - memberSchema, + federatedSchema, resource_repository.RepoLayoutRefSchema(rclass, packageType), ) diff --git a/pkg/artifactory/datasource/repository/federated/federated.go b/pkg/artifactory/datasource/repository/federated/federated.go index 9a7b831a3..0f1a1aefa 100644 --- a/pkg/artifactory/datasource/repository/federated/federated.go +++ b/pkg/artifactory/datasource/repository/federated/federated.go @@ -4,4 +4,4 @@ import "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resou const rclass = "federated" -var memberSchema = federated.MemberSchemaGenerator(false) +var federatedSchema = federated.SchemaGenerator(false) diff --git a/pkg/artifactory/resource/repository/federated/federated.go b/pkg/artifactory/resource/repository/federated/federated.go index 404313e3b..a049faea3 100644 --- a/pkg/artifactory/resource/repository/federated/federated.go +++ b/pkg/artifactory/resource/repository/federated/federated.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/jfrog/terraform-provider-artifactory/v9/pkg/artifactory/resource/repository" @@ -41,49 +42,57 @@ var PackageTypesLikeGeneric = []string{ "vagrant", } +type RepoParams struct { + Proxy string `json:"proxy"` + DisableProxy bool `json:"disableProxy"` +} + type Member struct { - Url string `hcl:"url" json:"url"` - Enabled bool `hcl:"enabled" json:"enabled"` + Url string `json:"url"` + Enabled bool `json:"enabled"` } -var MemberSchemaGenerator = func(isRequired bool) map[string]*schema.Schema { - return map[string]*schema.Schema{ - "cleanup_on_delete": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Delete all federated members on `terraform destroy` if set to `true`. Caution: it will delete all the repositories in the federation on other Artifactory instances.", - }, - "member": { - Type: schema.TypeSet, - Required: isRequired, - Optional: !isRequired, - Description: "The list of Federated members. If a Federated member receives a request that does not include the repository URL, it will " + - "automatically be added with the combination of the configured base URL and `key` field value. " + - "Note that each of the federated members will need to have a base URL set. Please follow the [instruction](https://www.jfrog.com/confluence/display/JFROG/Working+with+Federated+Repositories#WorkingwithFederatedRepositories-SettingUpaFederatedRepository)" + - " to set up Federated repositories correctly.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "url": { - Type: schema.TypeString, - Required: true, - Description: "Full URL to ending with the repositoryName", - ValidateDiagFunc: validation.ToDiagFunc(validation.IsURLWithHTTPorHTTPS), - }, - "enabled": { - Type: schema.TypeBool, - Required: true, - Description: "Represents the active state of the federated member. It is supported to " + - "change the enabled status of my own member. The config will be updated on the other " + - "federated members automatically.", +var SchemaGenerator = func(isRequired bool) map[string]*schema.Schema { + return utilsdk.MergeMaps( + repository.ProxySchema, + map[string]*schema.Schema{ + "cleanup_on_delete": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Delete all federated members on `terraform destroy` if set to `true`. Caution: it will delete all the repositories in the federation on other Artifactory instances.", + }, + "member": { + Type: schema.TypeSet, + Required: isRequired, + Optional: !isRequired, + Description: "The list of Federated members. If a Federated member receives a request that does not include the repository URL, it will " + + "automatically be added with the combination of the configured base URL and `key` field value. " + + "Note that each of the federated members will need to have a base URL set. Please follow the [instruction](https://www.jfrog.com/confluence/display/JFROG/Working+with+Federated+Repositories#WorkingwithFederatedRepositories-SettingUpaFederatedRepository)" + + " to set up Federated repositories correctly.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "url": { + Type: schema.TypeString, + Required: true, + Description: "Full URL to ending with the repositoryName", + ValidateDiagFunc: validation.ToDiagFunc(validation.IsURLWithHTTPorHTTPS), + }, + "enabled": { + Type: schema.TypeBool, + Required: true, + Description: "Represents the active state of the federated member. It is supported to " + + "change the enabled status of my own member. The config will be updated on the other " + + "federated members automatically.", + }, }, }, }, }, - } + ) } -var memberSchema = MemberSchemaGenerator(true) +var federatedSchema = SchemaGenerator(true) func unpackMembers(data *schema.ResourceData) []Member { d := &utilsdk.ResourceData{ResourceData: data} @@ -108,6 +117,15 @@ func unpackMembers(data *schema.ResourceData) []Member { return members } +func unpackRepoParams(data *schema.ResourceData) RepoParams { + d := &utilsdk.ResourceData{ResourceData: data} + + return RepoParams{ + Proxy: d.GetString("proxy", false), + DisableProxy: d.GetBool("disable_proxy", false), + } +} + func PackMembers(members []Member, d *schema.ResourceData) error { setValue := utilsdk.MkLens(d) @@ -250,7 +268,10 @@ func mkResourceSchema(skeema map[string]*schema.Schema, packer packer.PackFunc, Version: 2, }, }, - CustomizeDiff: repository.ProjectEnvironmentsDiff, + CustomizeDiff: customdiff.All( + repository.ProjectEnvironmentsDiff, + repository.VerifyDisableProxy, + ), } } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_alpine_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_alpine_repository.go index 4c8ee854f..23c074294 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_alpine_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_alpine_repository.go @@ -9,9 +9,10 @@ import ( utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" ) -type AlpineFederatedRepositoryParams struct { +type AlpineRepositoryParams struct { local.AlpineLocalRepoParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedAlpineRepository() *schema.Resource { @@ -19,20 +20,21 @@ func ResourceArtifactoryFederatedAlpineRepository() *schema.Resource { alpineFederatedSchema := utilsdk.MergeMaps( local.AlpineLocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) var unpackFederatedAlpineRepository = func(data *schema.ResourceData) (interface{}, string, error) { - repo := AlpineFederatedRepositoryParams{ + repo := AlpineRepositoryParams{ AlpineLocalRepoParams: local.UnpackLocalAlpineRepository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } var packAlpineMembers = func(repo interface{}, d *schema.ResourceData) error { - members := repo.(*AlpineFederatedRepositoryParams).Members + members := repo.(*AlpineRepositoryParams).Members return PackMembers(members, d) } @@ -47,7 +49,7 @@ func ResourceArtifactoryFederatedAlpineRepository() *schema.Resource { ) constructor := func() (interface{}, error) { - return &AlpineFederatedRepositoryParams{ + return &AlpineRepositoryParams{ AlpineLocalRepoParams: local.AlpineLocalRepoParams{ RepositoryBaseParams: local.RepositoryBaseParams{ PackageType: packageType, diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_cargo_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_cargo_repository.go index 5ad97c7b0..e4e978355 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_cargo_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_cargo_repository.go @@ -12,6 +12,7 @@ import ( type CargoFederatedRepositoryParams struct { local.CargoLocalRepoParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedCargoRepository() *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedCargoRepository() *schema.Resource { cargoFederatedSchema := utilsdk.MergeMaps( local.CargoLocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedCargoRepository() *schema.Resource { repo := CargoFederatedRepositoryParams{ CargoLocalRepoParams: local.UnpackLocalCargoRepository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_conan_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_conan_repository.go index 63e80171c..c614f13f8 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_conan_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_conan_repository.go @@ -12,12 +12,13 @@ import ( type ConanRepositoryParams struct { local.ConanRepoParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedConanRepository() *schema.Resource { conanSchema := utilsdk.MergeMaps( local.ConanSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, repository.ConanPackageType), ) @@ -31,7 +32,8 @@ func ResourceArtifactoryFederatedConanRepository() *schema.Resource { ForceConanAuthentication: d.GetBool("force_conan_authentication", false), }, }, - Members: unpackMembers(data), + Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_debian_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_debian_repository.go index 29affb3cc..b2d5eeb60 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_debian_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_debian_repository.go @@ -12,6 +12,7 @@ import ( type DebianFederatedRepositoryParams struct { local.DebianLocalRepositoryParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedDebianRepository() *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedDebianRepository() *schema.Resource { debianFederatedSchema := utilsdk.MergeMaps( local.DebianLocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedDebianRepository() *schema.Resource { repo := DebianFederatedRepositoryParams{ DebianLocalRepositoryParams: local.UnpackLocalDebianRepository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_docker_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_docker_repository.go index 7cea94cc6..e74c2b8e8 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_docker_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_docker_repository.go @@ -12,6 +12,7 @@ import ( type DockerFederatedRepositoryParams struct { local.DockerLocalRepositoryParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedDockerV2Repository() *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedDockerV2Repository() *schema.Resource { dockerV2FederatedSchema := utilsdk.MergeMaps( local.DockerV2LocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedDockerV2Repository() *schema.Resource { repo := DockerFederatedRepositoryParams{ DockerLocalRepositoryParams: local.UnpackLocalDockerV2Repository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } @@ -65,7 +67,7 @@ func ResourceArtifactoryFederatedDockerV1Repository() *schema.Resource { dockerFederatedSchema := utilsdk.MergeMaps( local.DockerV1LocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -73,6 +75,7 @@ func ResourceArtifactoryFederatedDockerV1Repository() *schema.Resource { repo := DockerFederatedRepositoryParams{ DockerLocalRepositoryParams: local.UnpackLocalDockerV1Repository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_generic_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_generic_repository.go index 29bfe64e6..e0a99b87c 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_generic_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_generic_repository.go @@ -9,26 +9,30 @@ import ( utilsdk "github.com/jfrog/terraform-provider-shared/util/sdk" ) -type FederatedRepositoryParams struct { +type GenericRepositoryParams struct { local.RepositoryBaseParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedGenericRepository(repoType string) *schema.Resource { - localRepoSchema := local.GetGenericRepoSchema(repoType) - - var federatedSchema = utilsdk.MergeMaps(localRepoSchema, memberSchema, repository.RepoLayoutRefSchema(rclass, repoType)) + var genericSchema = utilsdk.MergeMaps( + local.GetGenericRepoSchema(repoType), + federatedSchema, + repository.RepoLayoutRefSchema(rclass, repoType), + ) var unpackFederatedRepository = func(data *schema.ResourceData) (interface{}, string, error) { - repo := FederatedRepositoryParams{ + repo := GenericRepositoryParams{ RepositoryBaseParams: local.UnpackBaseRepo(rclass, data, repoType), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } var packGenericMembers = func(repo interface{}, d *schema.ResourceData) error { - members := repo.(*FederatedRepositoryParams).Members + members := repo.(*GenericRepositoryParams).Members return PackMembers(members, d) } @@ -43,7 +47,7 @@ func ResourceArtifactoryFederatedGenericRepository(repoType string) *schema.Reso ) constructor := func() (interface{}, error) { - return &FederatedRepositoryParams{ + return &GenericRepositoryParams{ RepositoryBaseParams: local.RepositoryBaseParams{ PackageType: local.GetPackageType(repoType), Rclass: rclass, @@ -51,5 +55,5 @@ func ResourceArtifactoryFederatedGenericRepository(repoType string) *schema.Reso }, nil } - return mkResourceSchema(federatedSchema, pkr, unpackFederatedRepository, constructor) + return mkResourceSchema(genericSchema, pkr, unpackFederatedRepository, constructor) } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_java_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_java_repository.go index 7c7996398..4b108a41f 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_java_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_java_repository.go @@ -12,13 +12,14 @@ import ( type JavaFederatedRepositoryParams struct { local.JavaLocalRepositoryParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedJavaRepository(repoType string, suppressPom bool) *schema.Resource { javaFederatedSchema := utilsdk.MergeMaps( local.GetJavaRepoSchema(repoType, suppressPom), - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema("federated", repoType), ) @@ -26,6 +27,7 @@ func ResourceArtifactoryFederatedJavaRepository(repoType string, suppressPom boo repo := JavaFederatedRepositoryParams{ JavaLocalRepositoryParams: local.UnpackLocalJavaRepository(data, rclass, repoType), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_nuget_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_nuget_repository.go index 258ee5fad..2e91636cb 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_nuget_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_nuget_repository.go @@ -12,6 +12,7 @@ import ( type NugetFederatedRepositoryParams struct { local.NugetLocalRepositoryParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedNugetRepository() *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedNugetRepository() *schema.Resource { nugetFederatedSchema := utilsdk.MergeMaps( local.NugetLocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedNugetRepository() *schema.Resource { repo := NugetFederatedRepositoryParams{ NugetLocalRepositoryParams: local.UnpackLocalNugetRepository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go index c5124ac13..86fc0a4e8 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_repository_test.go @@ -115,7 +115,7 @@ func TestAccFederatedRepoWithMembers(t *testing.T) { }) } -func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.TestCase) { +func genericTestCase(repoType string, t *testing.T) (*testing.T, resource.TestCase) { if skip, reason := skipFederatedRepo(); skip { t.Skipf(reason) } @@ -124,6 +124,7 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test resourceType := fmt.Sprintf("artifactory_federated_%s_repository", repoType) fqrn := fmt.Sprintf("%s.%s", resourceType, name) xrayIndex := testutil.RandBool() + proxyKey := fmt.Sprintf("test-proxy-%d", testutil.RandomInt()) federatedMemberUrl := fmt.Sprintf("%s/artifactory/%s", acctest.GetArtifactoryUrl(t), name) params := map[string]interface{}{ @@ -131,16 +132,29 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test "name": name, "xrayIndex": xrayIndex, "memberUrl": federatedMemberUrl, + "proxyKey": proxyKey, + "disableProxy": false, } repoTypeAdjusted := local.GetPackageType(repoType) - federatedRepositoryConfig := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfig", ` + // Default proxy will be assigned to the repository no matter what, and it's impossible to remove it by submitting an empty string or + // removing the attribute. If `disable_proxy` is set to true, then both repo and default proxies are removed and not returned in the + // GET body. + config := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfig", ` + resource "artifactory_proxy" "{{ .proxyKey }}" { + key = "{{ .proxyKey }}" + host = "http://tempurl.org" + port = 8000 + } + resource "{{ .resourceType }}" "{{ .name }}" { - key = "{{ .name }}" - description = "Test federated repo for {{ .name }}" - notes = "Test federated repo for {{ .name }}" - xray_index = {{ .xrayIndex }} + key = "{{ .name }}" + description = "Test federated repo for {{ .name }}" + notes = "Test federated repo for {{ .name }}" + xray_index = {{ .xrayIndex }} + proxy = artifactory_proxy.{{ .proxyKey }}.key + disable_proxy = {{ .disableProxy }} member { url = "{{ .memberUrl }}" @@ -149,19 +163,68 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test } `, params) + updatedParams := map[string]interface{}{ + "resourceType": resourceType, + "name": name, + "xrayIndex": !xrayIndex, + "memberUrl": federatedMemberUrl, + "proxyKey": proxyKey, + "disableProxy": true, + } + + updatedConfig := utilsdk.ExecuteTemplate("TestAccFederatedRepositoryConfig", ` + resource "artifactory_proxy" "{{ .proxyKey }}" { + key = "{{ .proxyKey }}" + host = "http://tempurl.org" + port = 8000 + } + + resource "{{ .resourceType }}" "{{ .name }}" { + key = "{{ .name }}" + description = "Test federated repo for {{ .name }}" + notes = "Test federated repo for {{ .name }}" + xray_index = {{ .xrayIndex }} + disable_proxy = {{ .disableProxy }} + + member { + url = "{{ .memberUrl }}" + enabled = true + } + } + `, updatedParams) + return t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ProviderFactories: acctest.ProviderFactories, CheckDestroy: acctest.VerifyDeleted(fqrn, acctest.CheckRepo), Steps: []resource.TestStep{ { - Config: federatedRepositoryConfig, + Config: config, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(fqrn, "key", name), resource.TestCheckResourceAttr(fqrn, "package_type", repoTypeAdjusted), resource.TestCheckResourceAttr(fqrn, "description", fmt.Sprintf("Test federated repo for %s", name)), resource.TestCheckResourceAttr(fqrn, "notes", fmt.Sprintf("Test federated repo for %s", name)), resource.TestCheckResourceAttr(fqrn, "xray_index", fmt.Sprintf("%t", xrayIndex)), + resource.TestCheckResourceAttr(fqrn, "proxy", proxyKey), + resource.TestCheckResourceAttr(fqrn, "disable_proxy", fmt.Sprintf("%t", params["disableProxy"].(bool))), + + resource.TestCheckResourceAttr(fqrn, "member.#", "1"), + resource.TestCheckResourceAttr(fqrn, "member.0.url", federatedMemberUrl), + resource.TestCheckResourceAttr(fqrn, "member.0.enabled", "true"), + resource.TestCheckResourceAttr(fqrn, "repo_layout_ref", func() string { r, _ := repository.GetDefaultRepoLayoutRef("federated", repoType)(); return r.(string) }()), //Check to ensure repository layout is set as per default even when it is not passed. + ), + }, + { + Config: updatedConfig, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(fqrn, "key", name), + resource.TestCheckResourceAttr(fqrn, "package_type", repoTypeAdjusted), + resource.TestCheckResourceAttr(fqrn, "description", fmt.Sprintf("Test federated repo for %s", name)), + resource.TestCheckResourceAttr(fqrn, "notes", fmt.Sprintf("Test federated repo for %s", name)), + resource.TestCheckResourceAttr(fqrn, "xray_index", fmt.Sprintf("%t", !xrayIndex)), + resource.TestCheckResourceAttr(fqrn, "proxy", ""), + resource.TestCheckResourceAttr(fqrn, "disable_proxy", fmt.Sprintf("%t", updatedParams["disableProxy"].(bool))), resource.TestCheckResourceAttr(fqrn, "member.#", "1"), resource.TestCheckResourceAttr(fqrn, "member.0.url", federatedMemberUrl), @@ -183,11 +246,47 @@ func federatedTestCase(repoType string, t *testing.T) (*testing.T, resource.Test func TestAccFederatedRepoGenericTypes(t *testing.T) { for _, packageType := range federated.PackageTypesLikeGeneric { t.Run(packageType, func(t *testing.T) { - resource.Test(federatedTestCase(packageType, t)) + resource.Test(genericTestCase(packageType, t)) }) } } +func TestAccFederatedRepo_DisableDefaultProxyConflictAttr(t *testing.T) { + _, fqrn, name := testutil.MkNames("test-go-remote-", "artifactory_federated_go_repository") + memberUrl := fmt.Sprintf("%s/artifactory/%s", acctest.GetArtifactoryUrl(t), name) + + params := map[string]string{ + "name": name, + "memberUrl": memberUrl, + } + config := utilsdk.ExecuteTemplate("TestAccFederatedGoRepository", ` + resource "artifactory_federated_go_repository" "{{ .name }}" { + key = "{{ .name }}" + repo_layout_ref = "go-default" + proxy = "my-proxy" + disable_proxy = true + + member { + url = "{{ .memberUrl }}" + enabled = true + } + } + + `, params) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: acctest.ProviderFactories, + CheckDestroy: acctest.VerifyDeleted(fqrn, acctest.CheckRepo), + Steps: []resource.TestStep{ + { + Config: config, + ExpectError: regexp.MustCompile(".*if `disable_proxy` is set to `true`, `proxy` can't be set"), + }, + }, + }) +} + func TestAccFederatedRepoWithProjectAttributesGH318(t *testing.T) { rand.Seed(time.Now().UnixNano()) projectKey := fmt.Sprintf("t%d", testutil.RandomInt()) diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_rpm_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_rpm_repository.go index c12ca3cad..b2d366b87 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_rpm_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_rpm_repository.go @@ -12,6 +12,7 @@ import ( type RpmFederatedRepositoryParams struct { local.RpmLocalRepositoryParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedRpmRepository() *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedRpmRepository() *schema.Resource { rpmFederatedSchema := utilsdk.MergeMaps( local.RpmLocalSchema, - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedRpmRepository() *schema.Resource { repo := RpmFederatedRepositoryParams{ RpmLocalRepositoryParams: local.UnpackLocalRpmRepository(data, rclass), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_terraform_repository.go b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_terraform_repository.go index b19028ad2..f17985560 100644 --- a/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_terraform_repository.go +++ b/pkg/artifactory/resource/repository/federated/resource_artifactory_federated_terraform_repository.go @@ -12,6 +12,7 @@ import ( type TerraformFederatedRepositoryParams struct { local.RepositoryBaseParams Members []Member `hcl:"member" json:"members"` + RepoParams } func ResourceArtifactoryFederatedTerraformRepository(registryType string) *schema.Resource { @@ -19,7 +20,7 @@ func ResourceArtifactoryFederatedTerraformRepository(registryType string) *schem terraformFederatedSchema := utilsdk.MergeMaps( local.GetTerraformLocalSchema(registryType), - memberSchema, + federatedSchema, repository.RepoLayoutRefSchema(rclass, packageType), ) @@ -27,6 +28,7 @@ func ResourceArtifactoryFederatedTerraformRepository(registryType string) *schem repo := TerraformFederatedRepositoryParams{ RepositoryBaseParams: local.UnpackLocalTerraformRepository(data, rclass, registryType), Members: unpackMembers(data), + RepoParams: unpackRepoParams(data), } return repo, repo.Id(), nil } diff --git a/pkg/artifactory/resource/repository/remote/remote.go b/pkg/artifactory/resource/repository/remote/remote.go index 162424a5b..1e6dcfd8c 100644 --- a/pkg/artifactory/resource/repository/remote/remote.go +++ b/pkg/artifactory/resource/repository/remote/remote.go @@ -106,6 +106,7 @@ var PackageTypesLikeBasic = []string{ var BaseRemoteRepoSchema = func(isResource bool) map[string]*schema.Schema { return utilsdk.MergeMaps( repository.BaseRepoSchema, + repository.ProxySchema, map[string]*schema.Schema{ "url": { Type: schema.TypeString, @@ -123,17 +124,6 @@ var BaseRemoteRepoSchema = func(isResource bool) map[string]*schema.Schema { Optional: true, Sensitive: true, }, - "proxy": { - Type: schema.TypeString, - Optional: true, - Description: "Proxy key from Artifactory Proxies settings. Can't be set if `disable_proxy = true`.", - }, - "disable_proxy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. Introduced since Artifactory 7.41.7.", - }, "description": { Type: schema.TypeString, Optional: true, @@ -597,7 +587,7 @@ func mkResourceSchema(skeema map[string]*schema.Schema, packer packer.PackFunc, CustomizeDiff: customdiff.All( repository.ProjectEnvironmentsDiff, verifyExternalDependenciesDockerAndHelm, - verifyDisableProxy, + repository.VerifyDisableProxy, verifyRemoteRepoLayoutRef, ), } @@ -623,17 +613,6 @@ func verifyExternalDependenciesDockerAndHelm(_ context.Context, diff *schema.Res return nil } -func verifyDisableProxy(_ context.Context, diff *schema.ResourceDiff, _ interface{}) error { - disableProxy := diff.Get("disable_proxy").(bool) - proxy := diff.Get("proxy").(string) - - if disableProxy && len(proxy) > 0 { - return fmt.Errorf("if `disable_proxy` is set to `true`, `proxy` can't be set") - } - - return nil -} - func ResourceStateUpgradeV1(_ context.Context, rawState map[string]interface{}, _ interface{}) (map[string]interface{}, error) { if rawState["package_type"] != "generic" { delete(rawState, "propagate_query_params") diff --git a/pkg/artifactory/resource/repository/repository.go b/pkg/artifactory/resource/repository/repository.go index a813469b3..1fa5c5fa0 100644 --- a/pkg/artifactory/resource/repository/repository.go +++ b/pkg/artifactory/resource/repository/repository.go @@ -87,6 +87,20 @@ var BaseRepoSchema = map[string]*schema.Schema{ }, } +var ProxySchema = map[string]*schema.Schema{ + "proxy": { + Type: schema.TypeString, + Optional: true, + Description: "Proxy key from Artifactory Proxies settings. Can't be set if `disable_proxy = true`.", + }, + "disable_proxy": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "When set to `true`, the proxy is disabled, and not returned in the API response body. If there is a default proxy set for the Artifactory instance, it will be ignored, too. Introduced since Artifactory 7.41.7.", + }, +} + var CompressionFormats = map[string]*schema.Schema{ "index_compression_formats": { Type: schema.TypeSet, @@ -333,6 +347,17 @@ func ProjectEnvironmentsDiff(ctx context.Context, diff *schema.ResourceDiff, met return nil } +func VerifyDisableProxy(_ context.Context, diff *schema.ResourceDiff, _ interface{}) error { + disableProxy := diff.Get("disable_proxy").(bool) + proxy := diff.Get("proxy").(string) + + if disableProxy && len(proxy) > 0 { + return fmt.Errorf("if `disable_proxy` is set to `true`, `proxy` can't be set") + } + + return nil +} + func MkResourceSchema(skeema map[string]*schema.Schema, packer packer.PackFunc, unpack unpacker.UnpackFunc, constructor Constructor) *schema.Resource { var reader = MkRepoRead(packer, constructor) return &schema.Resource{ From 403d6595756cb9d1faded3cb978bc14cc8b87dc6 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 16 Nov 2023 16:01:53 -0800 Subject: [PATCH 27/44] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6065d9aa7..9abb6f711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.9.0 (Nov 17, 2023) + +IMPROVEMENTS: + +* resource/artifactory_federated_*_repository: Add `proxy` and `disable_proxy` attributes. PR: [#848](https://github.com/jfrog/terraform-provider-artifactory/pull/848) Issue: [#838](https://github.com/jfrog/terraform-provider-artifactory/issues/838) + ## 9.8.0 (Nov 8, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.3 IMPROVEMENTS: From 081b1d42002c28fed4e776d9b411a07bcce22f42 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Fri, 17 Nov 2023 00:25:49 +0000 Subject: [PATCH 28/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9abb6f711..fd04bba14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.9.0 (Nov 17, 2023) +## 9.9.0 (Nov 17, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.4 IMPROVEMENTS: From 57508f2eeb27e516ab3e80efa3794f0df734de59 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 27 Nov 2023 11:54:41 -0800 Subject: [PATCH 29/44] Update README.md Use GitHub Markdown to set warning (instead of the incorrect TF formatting) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71600d32d..4704c457f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ Version 9.x is the latest major version and is compatible with latest Artifactor Current version support [Terraform Protocol v5](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-5) which mean Terraform CLI version 0.12 and later. -~>We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. +> [!WARNING] +> We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. ## Quick Start From daa3bbfa480b7758989720f46a56a3acc4f8c896 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 09:31:20 -0800 Subject: [PATCH 30/44] Update user.md Fix incorrect URL path for `user_group.md` --- docs/resources/user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/user.md b/docs/resources/user.md index da4e710de..49c531202 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -59,4 +59,4 @@ terraform import artifactory_user.test-user myusername ## Managing groups relationship -See [our recommendation](guides/user_group.md) on how to manage user-group relationship. +See [our recommendation](../guides/user_group.md) on how to manage user-group relationship. From 6764472d84b0a8e33188e1dcbb77110b856604fa Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 14:45:29 -0800 Subject: [PATCH 31/44] Upgrade to Go 1.21 and update to latest packages --- .github/workflows/release.yml | 2 +- go.mod | 46 +++++----- go.sum | 166 +++++++++++++++++++++++----------- 3 files changed, 136 insertions(+), 78 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a50818fc9..86578ab0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.21 - name: Import GPG key id: import_gpg diff --git a/go.mod b/go.mod index 7053d1d3e..42f646119 100644 --- a/go.mod +++ b/go.mod @@ -9,12 +9,12 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/terraform-plugin-docs v0.16.0 - github.com/hashicorp/terraform-plugin-framework v1.3.5 + github.com/hashicorp/terraform-plugin-framework v1.4.2 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.18.0 + github.com/hashicorp/terraform-plugin-go v0.19.1 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-mux v0.9.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0 + github.com/hashicorp/terraform-plugin-mux v0.12.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 github.com/hashicorp/terraform-plugin-testing v1.5.1 github.com/jfrog/terraform-provider-shared v1.20.0 github.com/sethvargo/go-password v0.2.0 @@ -29,35 +29,35 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/sprig/v3 v3.2.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/agext/levenshtein v1.2.2 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.13.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/google/go-cmp v0.6.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 // 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-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.5.2 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/hashicorp/hc-install v0.5.2 // indirect - github.com/hashicorp/hcl/v2 v2.17.0 // indirect + github.com/hashicorp/hc-install v0.6.1 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.18.1 // indirect + github.com/hashicorp/terraform-exec v0.19.0 // indirect github.com/hashicorp/terraform-json v0.17.1 // indirect - github.com/hashicorp/terraform-registry-address v0.2.1 // 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.0.0-20181012175058-2f1d1f20f75d // indirect github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/mitchellh/cli v1.1.5 // indirect @@ -73,18 +73,18 @@ 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.3 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + github.com/zclconf/go-cty v1.14.1 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect ) -go 1.19 +go 1.21 diff --git a/go.sum b/go.sum index f730192c8..822bcbffc 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= @@ -5,38 +7,51 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= +github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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= @@ -45,14 +60,14 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= 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.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -70,41 +85,41 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= 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.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= 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= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.5.2 h1:SfwMFnEXVVirpwkDuSF5kymUOhrUxrTq3udEseZdOD0= -github.com/hashicorp/hc-install v0.5.2/go.mod h1:9QISwe6newMWIfEiXpzuu1k9HAGtQYgnSH8H9T8wmoI= -github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= -github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= +github.com/hashicorp/hc-install v0.6.1 h1:IGxShH7AVhPaSuSJpKtVi/EFORNjO+OYVJJrAtGG2mY= +github.com/hashicorp/hc-install v0.6.1/go.mod h1:0fW3jpg+wraYSnFDJ6Rlie3RvLf1bIqVIkzoon4KoVE= +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/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.18.1 h1:LAbfDvNQU1l0NOQlTuudjczVhHj061fNX5H8XZxHlH4= -github.com/hashicorp/terraform-exec v0.18.1/go.mod h1:58wg4IeuAJ6LVsLUeD2DWZZoc/bYi6dzhLHzxM41980= +github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= +github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQHgyRwf3RkyA= github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o= github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI= github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA= -github.com/hashicorp/terraform-plugin-framework v1.3.5 h1:FJ6s3CVWVAxlhiF/jhy6hzs4AnPHiflsp9KgzTGl1wo= -github.com/hashicorp/terraform-plugin-framework v1.3.5/go.mod h1:2gGDpWiTI0irr9NSTLFAKlTi6KwGti3AoU19rFqU30o= +github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5OckzhoiO3ig6SGxwelD2sI= +github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.18.0 h1:IwTkOS9cOW1ehLd/rG0y+u/TGLK9y6fGoBjXVUquzpE= -github.com/hashicorp/terraform-plugin-go v0.18.0/go.mod h1:l7VK+2u5Kf2y+A+742GX0ouLut3gttudmvMgN0PA74Y= +github.com/hashicorp/terraform-plugin-go v0.19.1 h1:lf/jTGTeELcz5IIbn/94mJdmnTjRYm6S6ct/JqCSr50= +github.com/hashicorp/terraform-plugin-go v0.19.1/go.mod h1:5NMIS+DXkfacX6o5HCpswda5yjkSYfKzn1Nfl9l+qRs= 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-mux v0.9.0 h1:a2Xh63cunDB/1GZECrV02cGA74AhQGUjY9X8W3P/L7k= -github.com/hashicorp/terraform-plugin-mux v0.9.0/go.mod h1:8NUFbgeMigms7Tma/r2Vgi5Jv5mPv4xcJ05pJtIOhwc= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0 h1:gY4SG34ANc6ZSeWEKC9hDTChY0ZiN+Myon17fSA0Xgc= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0/go.mod h1:deXEw/iJXtJxNV9d1c/OVJrvL7Zh0a++v7rzokW6wVY= +github.com/hashicorp/terraform-plugin-mux v0.12.0 h1:TJlmeslQ11WlQtIFAfth0vXx+gSNgvMEng2Rn9z3WZY= +github.com/hashicorp/terraform-plugin-mux v0.12.0/go.mod h1:8MR0AgmV+Q03DIjyrAKxXyYlq2EUnYBQP8gxAAA0zeM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0 h1:X7vB6vn5tON2b49ILa4W7mFAsndeqJ7bZFOGbVO+0Cc= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.30.0/go.mod h1:ydFcxbdj6klCqYEPkPvdvFKiNGKZLUs+896ODUXCyao= github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c= github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0= -github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= -github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= +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.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.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -113,19 +128,25 @@ github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jfrog/terraform-provider-shared v1.20.0 h1:T5AFbn4Su3tlNZTIXwb8Bi4vq/LZMFH312V2z8d3IsI= github.com/jfrog/terraform-provider-shared v1.20.0/go.mod h1:KEYnVOggRuQT6qLR05ra0QfQa0SeYnkMnN0ZqIgQHqI= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -153,21 +174,25 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM= +github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= @@ -181,30 +206,44 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= 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/zclconf/go-cty v1.13.3 h1:m+b9q3YDbg6Bec5rr+KGy1MzEVzY/jC2X+YX4yqKtHI= -github.com/zclconf/go-cty v1.13.3/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= 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/sync v0.1.0/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= @@ -214,27 +253,46 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.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/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= 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.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.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/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +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/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= @@ -247,9 +305,9 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU= gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 590cc01cd16d9d6f3334352ea8c5f24346af8609 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 14:46:02 -0800 Subject: [PATCH 32/44] Fix incorrectly use of response.String() When it should be err.Error() --- .../resource_artifactory_ldap_group_setting_v2.go | 2 +- .../configuration/resource_artifactory_ldap_setting_v2.go | 2 +- .../resource/security/resource_artifactory_certificate.go | 2 +- .../resource_artifactory_distribution_public_key.go | 4 ++-- .../security/resource_artifactory_global_environment.go | 8 ++++---- .../resource/security/resource_artifactory_group.go | 4 ++-- .../resource/security/resource_artifactory_keypair.go | 6 +++--- .../security/resource_artifactory_scoped_token.go | 6 +++--- .../resource/user/resource_artifactory_anonymous_user.go | 6 +----- pkg/artifactory/resource/user/user.go | 2 +- pkg/artifactory/resource/user/user_fw.go | 8 ++++---- 11 files changed, 23 insertions(+), 27 deletions(-) diff --git a/pkg/artifactory/resource/configuration/resource_artifactory_ldap_group_setting_v2.go b/pkg/artifactory/resource/configuration/resource_artifactory_ldap_group_setting_v2.go index 00d535678..b2fced387 100644 --- a/pkg/artifactory/resource/configuration/resource_artifactory_ldap_group_setting_v2.go +++ b/pkg/artifactory/resource/configuration/resource_artifactory_ldap_group_setting_v2.go @@ -278,7 +278,7 @@ func (r *ArtifactoryLdapGroupSettingResource) Delete(ctx context.Context, req re Delete(LdapGroupEndpoint + data.Id.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/configuration/resource_artifactory_ldap_setting_v2.go b/pkg/artifactory/resource/configuration/resource_artifactory_ldap_setting_v2.go index 3b42bb420..724053639 100644 --- a/pkg/artifactory/resource/configuration/resource_artifactory_ldap_setting_v2.go +++ b/pkg/artifactory/resource/configuration/resource_artifactory_ldap_setting_v2.go @@ -382,7 +382,7 @@ func (r *ArtifactoryLdapSettingResource) Delete(ctx context.Context, req resourc Delete(LdapEndpoint + data.Id.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_certificate.go b/pkg/artifactory/resource/security/resource_artifactory_certificate.go index 4e46f2cd8..f43f87d9f 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_certificate.go +++ b/pkg/artifactory/resource/security/resource_artifactory_certificate.go @@ -305,7 +305,7 @@ func (r *CertificateResource) Delete(ctx context.Context, req resource.DeleteReq Delete(CertificateEndpoint + state.Alias.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_distribution_public_key.go b/pkg/artifactory/resource/security/resource_artifactory_distribution_public_key.go index 2b18d174d..e5a38535d 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_distribution_public_key.go +++ b/pkg/artifactory/resource/security/resource_artifactory_distribution_public_key.go @@ -202,7 +202,7 @@ func (r *DistributionPublicKeyResource) Read(ctx context.Context, req resource.R if response.StatusCode() == http.StatusNotFound { resp.State.RemoveResource(ctx) } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -236,7 +236,7 @@ func (r *DistributionPublicKeyResource) Delete(ctx context.Context, req resource Delete(fmt.Sprintf("%s/%s", DistributionPublicKeysAPIEndPoint, state.KeyId.ValueString())) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_global_environment.go b/pkg/artifactory/resource/security/resource_artifactory_global_environment.go index 03289c781..dc6389207 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_global_environment.go +++ b/pkg/artifactory/resource/security/resource_artifactory_global_environment.go @@ -94,7 +94,7 @@ func (r *GlobalEnvironmentResource) Create(ctx context.Context, req resource.Cre Post("access/api/v1/environments") if err != nil { - utilfw.UnableToCreateResourceError(resp, response.String()) + utilfw.UnableToCreateResourceError(resp, err.Error()) return } @@ -121,12 +121,12 @@ func (r *GlobalEnvironmentResource) Read(ctx context.Context, req resource.ReadR // Convert from Terraform data model into API data model environments := GlobalEnvironmentsAPIModel{} - response, err := r.ProviderData.Client.R(). + _, err := r.ProviderData.Client.R(). SetResult(&environments). Get("access/api/v1/environments") if err != nil { - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -192,7 +192,7 @@ func (r *GlobalEnvironmentResource) Delete(ctx context.Context, req resource.Del Delete("access/api/v1/environments/{environmentName}") if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_group.go b/pkg/artifactory/resource/security/resource_artifactory_group.go index 452150958..29f4582db 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_group.go +++ b/pkg/artifactory/resource/security/resource_artifactory_group.go @@ -267,7 +267,7 @@ func (r *ArtifactoryGroupResource) Read(ctx context.Context, req resource.ReadRe resp.State.RemoveResource(ctx) return } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -360,7 +360,7 @@ func (r *ArtifactoryGroupResource) Delete(ctx context.Context, req resource.Dele Delete(GroupsEndpoint + data.Id.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_keypair.go b/pkg/artifactory/resource/security/resource_artifactory_keypair.go index 9d6da5e3c..f327aba51 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_keypair.go +++ b/pkg/artifactory/resource/security/resource_artifactory_keypair.go @@ -169,7 +169,7 @@ func (r *KeyPairResource) Create(ctx context.Context, req resource.CreateRequest SetBody(keyPair). Post(KeypairEndPoint) if err != nil { - utilfw.UnableToCreateResourceError(resp, response.String()) + utilfw.UnableToCreateResourceError(resp, err.Error()) return } @@ -205,7 +205,7 @@ func (r *KeyPairResource) Read(ctx context.Context, req resource.ReadRequest, re resp.State.RemoveResource(ctx) return } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -234,7 +234,7 @@ func (r *KeyPairResource) Delete(ctx context.Context, req resource.DeleteRequest Delete(KeypairEndPoint + state.PairName.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/security/resource_artifactory_scoped_token.go b/pkg/artifactory/resource/security/resource_artifactory_scoped_token.go index 85b159c83..638155b86 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_scoped_token.go +++ b/pkg/artifactory/resource/security/resource_artifactory_scoped_token.go @@ -369,7 +369,7 @@ func (r *ScopedTokenResource) Create(ctx context.Context, req resource.CreateReq Post("access/api/v1/tokens") if err != nil { - utilfw.UnableToCreateResourceError(resp, response.String()) + utilfw.UnableToCreateResourceError(resp, err.Error()) return } @@ -388,7 +388,7 @@ func (r *ScopedTokenResource) Create(ctx context.Context, req resource.CreateReq Get("access/api/v1/tokens/{id}") if err != nil { - utilfw.UnableToCreateResourceError(resp, response.String()) + utilfw.UnableToCreateResourceError(resp, err.Error()) return } @@ -429,7 +429,7 @@ func (r *ScopedTokenResource) Read(ctx context.Context, req resource.ReadRequest resp.State.RemoveResource(ctx) return } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } diff --git a/pkg/artifactory/resource/user/resource_artifactory_anonymous_user.go b/pkg/artifactory/resource/user/resource_artifactory_anonymous_user.go index f0d5eec5f..f704280ea 100644 --- a/pkg/artifactory/resource/user/resource_artifactory_anonymous_user.go +++ b/pkg/artifactory/resource/user/resource_artifactory_anonymous_user.go @@ -66,7 +66,6 @@ func (r *ArtifactoryAnonymousUserResource) Create(ctx context.Context, req resou "Unable to Create Resource", "Anonymous Artifactory user cannot be created. Use `terraform import` instead.", ) - return } func (r *ArtifactoryAnonymousUserResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { @@ -90,7 +89,7 @@ func (r *ArtifactoryAnonymousUserResource) Read(ctx context.Context, req resourc resp.State.RemoveResource(ctx) return } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -112,7 +111,6 @@ func (r *ArtifactoryAnonymousUserResource) Update(ctx context.Context, req resou "Unable to Update Resource", "Anonymous Artifactory user cannot be updated. Use `terraform import` instead.", ) - return } func (r *ArtifactoryAnonymousUserResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { @@ -120,11 +118,9 @@ func (r *ArtifactoryAnonymousUserResource) Delete(ctx context.Context, req resou "Unable to Delete Resource", "Anonymous Artifactory user cannot be deleted. Use `terraform state rm` instead.", ) - return } // ImportState imports the resource into the Terraform state. func (r *ArtifactoryAnonymousUserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) - } diff --git a/pkg/artifactory/resource/user/user.go b/pkg/artifactory/resource/user/user.go index e8ebeb317..1fdaf3af3 100644 --- a/pkg/artifactory/resource/user/user.go +++ b/pkg/artifactory/resource/user/user.go @@ -117,7 +117,7 @@ func PackUser(user User, d *schema.ResourceData) diag.Diagnostics { errors = setValue("groups", schema.NewSet(schema.HashString, utilsdk.CastToInterfaceArr(user.Groups))) } - if errors != nil && len(errors) > 0 { + if len(errors) > 0 { return diag.Errorf("failed to pack user %q", errors) } diff --git a/pkg/artifactory/resource/user/user_fw.go b/pkg/artifactory/resource/user/user_fw.go index 2464b9f3c..c5f76ca18 100644 --- a/pkg/artifactory/resource/user/user_fw.go +++ b/pkg/artifactory/resource/user/user_fw.go @@ -197,7 +197,7 @@ func (r *ArtifactoryBaseUserResource) Create(ctx context.Context, req resource.C response, err := r.client.Client.R().SetBody(user).Put(UsersEndpointPath + user.Name) if err != nil { - utilfw.UnableToCreateResourceError(resp, response.String()) + utilfw.UnableToCreateResourceError(resp, err.Error()) return } @@ -254,7 +254,7 @@ func (r *ArtifactoryBaseUserResource) Read(ctx context.Context, req resource.Rea resp.State.RemoveResource(ctx) return } - utilfw.UnableToRefreshResourceError(resp, response.String()) + utilfw.UnableToRefreshResourceError(resp, err.Error()) return } @@ -296,7 +296,7 @@ func (r *ArtifactoryBaseUserResource) Update(ctx context.Context, req resource.U response, err := r.client.Client.R().SetBody(user).Post(UsersEndpointPath + user.Name) if err != nil { - utilfw.UnableToUpdateResourceError(resp, response.String()) + utilfw.UnableToUpdateResourceError(resp, err.Error()) return } @@ -321,7 +321,7 @@ func (r *ArtifactoryBaseUserResource) Delete(ctx context.Context, req resource.D response, err := r.client.Client.R().Delete(UsersEndpointPath + state.Id.ValueString()) if err != nil { - utilfw.UnableToDeleteResourceError(resp, response.String()) + utilfw.UnableToDeleteResourceError(resp, err.Error()) return } From ed7942e663c10146007a7a97faf53e23ef345c57 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 14:58:21 -0800 Subject: [PATCH 33/44] Update TFproviderTest.yml Upgrade Pipelines runtime time to Go 1.21 --- .jfrog-pipelines/TFproviderTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jfrog-pipelines/TFproviderTest.yml b/.jfrog-pipelines/TFproviderTest.yml index efc48a4aa..9bc4e5265 100644 --- a/.jfrog-pipelines/TFproviderTest.yml +++ b/.jfrog-pipelines/TFproviderTest.yml @@ -28,7 +28,7 @@ pipelines: auto: language: go versions: - - "1.19" + - "1.21" requiresApproval: approvers: - alexh From 413c47672f43bf18f00d7e605b4539043a6008fb Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 15:03:45 -0800 Subject: [PATCH 34/44] Upgrade Resty package --- go.mod | 2 +- go.sum | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 42f646119..4ffea6d05 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ module github.com/jfrog/terraform-provider-artifactory/v9 // replace github.com/jfrog/terraform-provider-shared => ../terraform-provider-shared require ( - github.com/go-resty/resty/v2 v2.7.0 + github.com/go-resty/resty/v2 v2.10.0 github.com/google/go-querystring v1.1.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 822bcbffc..95370dceb 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,8 @@ github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+ github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= +github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -221,6 +221,7 @@ 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.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= @@ -233,11 +234,11 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn 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.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -249,7 +250,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -261,6 +261,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -268,16 +270,21 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= From bf45a24c7b1f34ce0544b789391ff8e6731b03d9 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 15:05:44 -0800 Subject: [PATCH 35/44] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd04bba14..f1542c0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.9.1 (Dec 1, 2023) + +BUG FIX: + +* Fix incorrect use of empty error message when API fails PR: [#850](https://github.com/jfrog/terraform-provider-artifactory/pull/850) Issue: [#849](https://github.com/jfrog/terraform-provider-artifactory/issues/849) + ## 9.9.0 (Nov 17, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.4 IMPROVEMENTS: From 97fbd6a413622aced812b4cf143581749b6558dc Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Thu, 30 Nov 2023 23:22:48 +0000 Subject: [PATCH 36/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1542c0dc..aba4fd133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.9.1 (Dec 1, 2023) +## 9.9.1 (Dec 1, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 BUG FIX: From 5a012a2f733ff05b14f180b9f8605bfe51a383f7 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 15:58:50 -0800 Subject: [PATCH 37/44] Make test end time more resilient --- .../resource/security/resource_artifactory_access_token_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/artifactory/resource/security/resource_artifactory_access_token_test.go b/pkg/artifactory/resource/security/resource_artifactory_access_token_test.go index 3f2e86c1c..a87dbf176 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_access_token_test.go +++ b/pkg/artifactory/resource/security/resource_artifactory_access_token_test.go @@ -135,7 +135,7 @@ func TestAccAccessTokenExistingUser(t *testing.T) { func fixedDateGood() string { // Create a "fixed date" in the future - date := time.Now().Add(time.Second * time.Duration(10)).Format(time.RFC3339) + date := time.Now().Add(time.Minute * time.Duration(1)).Format(time.RFC3339) return fmt.Sprintf(` resource "artifactory_managed_user" "existinguser" { name = "existinguser" From 48fe4119dde011bf41546bc027df4e89b3a2efd1 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Thu, 30 Nov 2023 16:18:33 -0800 Subject: [PATCH 38/44] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd04bba14..b95b64783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.9.1 (Dec 1, 2023) + +BUG FIX: + +* resource/artifactory_global_environment: Fix incorrect environment from Artifactroy being matched and triggers a state drift. PR: [#851](https://github.com/jfrog/terraform-provider-artifactory/pull/851) + ## 9.9.0 (Nov 17, 2023). Tested on Artifactory 7.71.4 with Terraform CLI v1.6.4 IMPROVEMENTS: From a2a6c221f6a238edbebd70ec7f618b300c9756fd Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Fri, 1 Dec 2023 09:14:29 -0800 Subject: [PATCH 39/44] The actual fix! Lost this when I rebased --- .../resource/security/resource_artifactory_global_environment.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/artifactory/resource/security/resource_artifactory_global_environment.go b/pkg/artifactory/resource/security/resource_artifactory_global_environment.go index 03289c781..6e0c6fb2a 100644 --- a/pkg/artifactory/resource/security/resource_artifactory_global_environment.go +++ b/pkg/artifactory/resource/security/resource_artifactory_global_environment.go @@ -134,6 +134,7 @@ func (r *GlobalEnvironmentResource) Read(ctx context.Context, req resource.ReadR for _, env := range environments { if env.Name == state.Id.ValueString() { matchedEnvName = &env.Name + break } } From ccf2bfbb000a905d4a9baab6f635afe6032428c9 Mon Sep 17 00:00:00 2001 From: JFrog CI Date: Fri, 1 Dec 2023 17:53:55 +0000 Subject: [PATCH 40/44] JFrog Pipelines - Add Artifactory version to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b95b64783..1bb3c55b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.9.1 (Dec 1, 2023) +## 9.9.1 (Dec 1, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 BUG FIX: From 70e7c740b92be6d645055b6ecc38fb8650b848e6 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 4 Dec 2023 08:46:08 -0800 Subject: [PATCH 41/44] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bb3c55b2..46e02200c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.9.1 (Dec 1, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 +## 9.9.1 (Dec 4, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 BUG FIX: From 6c4136a3d606e4df401fc39cdbf66c313488e6b0 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 4 Dec 2023 08:47:35 -0800 Subject: [PATCH 42/44] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aba4fd133..3e0061769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 9.9.1 (Dec 1, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 +## 9.9.1 (Dec 4, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.5 BUG FIX: From bf81ca4d449a414b7b3c2ef6b07cb12f37735320 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 4 Dec 2023 09:23:27 -0800 Subject: [PATCH 43/44] Update bug_report.md Update assignees --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d280f4df3..33f952a54 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,7 +3,7 @@ name: Bug report about: Create a report to help us improve title: '' labels: bug -assignees: danielmkn +assignees: alexhung --- From 7f3d4c66112b4ff22ae4d9f950c2da7e1afcc615 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 4 Dec 2023 09:24:17 -0800 Subject: [PATCH 44/44] Update feature_request.md Update labels and assignees --- .github/ISSUE_TEMPLATE/feature_request.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d6..53b6bcf5f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,8 +2,8 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' -assignees: '' +labels: enhancement +assignees: alexhung ---