remote

package
v10.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BowerPackageType = "bower"
View Source
const CargoPackageType = "cargo"
View Source
const CocoapodsPackageType = "cocoapods"
View Source
const ComposerPackageType = "composer"
View Source
const DockerPackageType = "docker"
View Source
const GenericPackageType = "generic"
View Source
const GoPackageType = "go"
View Source
const HelmOciPackageType = "helmoci"
View Source
const HelmPackageType = "helm"
View Source
const HuggingFacePackageType = "huggingfaceml"
View Source
const MavenPackageType = "maven"
View Source
const NpmPackageType = "npm"
View Source
const NugetPackageType = "nuget"
View Source
const OciPackageType = "oci"
View Source
const PypiPackageType = "pypi"
View Source
const TerraformPackageType = "terraform"
View Source
const VcsPackageType = "vcs"

Variables

View Source
var BaseRemoteRepoSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		repository.BaseRepoSchema,
		repository.ProxySchema,
		map[string]*schema.Schema{
			"url": {
				Type:         schema.TypeString,
				Required:     isResource,
				Optional:     !isResource,
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Description:  "This is a URL to the remote registry. Consider using HTTPS to ensure a secure connection.",
			},
			"username": {
				Type:     schema.TypeString,
				Optional: true,
			},
			"password": {
				Type:      schema.TypeString,
				Optional:  true,
				Sensitive: true,
			},
			"description": {
				Type:     schema.TypeString,
				Optional: true,
				DiffSuppressFunc: func(_, old, new string, _ *schema.ResourceData) bool {

					return old == fmt.Sprintf("%s (local file cache)", new)
				},
				Description: "Public description.",
			},
			"remote_repo_layout_ref": {
				Type:        schema.TypeString,
				Optional:    true,
				Description: "Repository layout key for the remote layout mapping. Repository can be created without this attribute (or set to an empty string). Once it's set, it can't be removed by passing an empty string or removing the attribute, that will be ignored by the Artifactory API. UI shows an error message, if the user tries to remove the value.",
			},
			"hard_fail": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
				Description: "When set, Artifactory will return an error to the client that causes the build to fail if there " +
					"is a failure to communicate with this repository.",
			},
			"offline": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "If set, Artifactory does not try to fetch remote artifacts. Only locally-cached artifacts are retrieved.",
			},
			"blacked_out": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "(A.K.A 'Ignore Repository' on the UI) When set, the repository or its local cache do not participate in artifact resolution.",
			},
			"xray_index": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
				Description: "Enable Indexing In Xray. Repository will be indexed with the default retention period. " +
					"You will be able to change it via Xray settings.",
			},
			"store_artifacts_locally": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  true,
				Description: "When set, the repository should store cached artifacts locally. When not set, artifacts are not " +
					"stored locally, and direct repository-to-client streaming is used. This can be useful for multi-server " +
					"setups over a high-speed LAN, with one Artifactory caching certain data on central storage, and streaming " +
					"it directly to satellite pass-though Artifactory servers.",
			},
			"socket_timeout_millis": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      15000,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "Network timeout (in ms) to use when establishing a connection and for unanswered requests. " +
					"Timing out on a network operation is considered a retrieval failure.",
			},
			"local_address": {
				Type:     schema.TypeString,
				Optional: true,
				Description: "The local address to be used when creating connections. " +
					"Useful for specifying the interface to use on systems with multiple network interfaces.",
			},
			"retrieval_cache_period_seconds": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      7200,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "Metadata Retrieval Cache Period (Sec) in the UI. 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.",
			},
			"metadata_retrieval_timeout_secs": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      60,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "Metadata Retrieval Cache Timeout (Sec) in the UI.This value refers to the number of seconds to wait " +
					"for retrieval from the remote before serving locally cached artifact or fail the request.",
			},
			"missed_cache_period_seconds": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      1800,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "Missed Retrieval Cache Period (Sec) in the UI. The number of seconds to cache artifact retrieval " +
					"misses (artifact not found). A value of 0 indicates no caching.",
			},
			"unused_artifacts_cleanup_period_hours": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      0,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "Unused Artifacts Cleanup Period (Hr) in the UI. The number of hours to wait before an artifact is " +
					"deemed 'unused' and eligible for cleanup from the repository. A value of 0 means automatic cleanup of cached artifacts is disabled.",
			},
			"assumed_offline_period_secs": {
				Type:         schema.TypeInt,
				Optional:     true,
				Default:      300,
				ValidateFunc: validation.IntAtLeast(0),
				Description: "The number of seconds the repository stays in assumed offline state after a connection error. " +
					"At the end of this time, an online check is attempted in order to reset the offline status. " +
					"A value of 0 means the repository is never assumed offline.",
			},

			"share_configuration": {
				Type:     schema.TypeBool,
				Optional: true,
				Computed: true,
			},
			"synchronize_properties": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "When set, remote artifacts are fetched along with their properties.",
			},

			"block_mismatching_mime_types": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  true,
				Description: "If set, artifacts will fail to download if a mismatch is detected between requested and received " +
					"mimetype, according to the list specified in the system properties file under blockedMismatchingMimeTypes. " +
					"You can override by adding mimetypes to the override list 'mismatching_mime_types_override_list'.",
			},
			"property_sets": {
				Type:        schema.TypeSet,
				Elem:        &schema.Schema{Type: schema.TypeString},
				Set:         schema.HashString,
				Optional:    true,
				Description: "List of property set names",
			},
			"allow_any_host_auth": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "'Lenient Host Authentication' in the UI. Allow credentials of this repository to be used on requests redirected to any other host.",
			},
			"enable_cookie_management": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "Enables cookie management if the remote repository uses cookies to manage client state.",
			},
			"bypass_head_requests": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
				Description: "Before caching an artifact, Artifactory first sends a HEAD request to the remote resource. " +
					"In some remote resources, HEAD requests are disallowed and therefore rejected, even though downloading the " +
					"artifact is allowed. When checked, Artifactory will bypass the HEAD request and cache the artifact directly using a GET request.",
			},
			"priority_resolution": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
				Description: "Setting Priority Resolution takes precedence over the resolution order when resolving virtual " +
					"repositories. Setting repositories with priority will cause metadata to be merged only from repositories " +
					"set with a priority. If a package is not found in those repositories, Artifactory will merge from repositories marked as non-priority.",
			},
			"client_tls_certificate": {
				Type:        schema.TypeString,
				Optional:    true,
				Computed:    true,
				Description: "Client TLS certificate name.",
			},
			"content_synchronisation": {
				Type:     schema.TypeList,
				Optional: true,
				Computed: true,
				MaxItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"enabled": {
							Type:        schema.TypeBool,
							Optional:    true,
							Default:     false,
							Description: "If set, Remote repository proxies a local or remote repository from another instance of Artifactory. Default value is 'false'.",
						},
						"statistics_enabled": {
							Type:        schema.TypeBool,
							Optional:    true,
							Default:     false,
							Description: "If set, Artifactory will notify the remote instance whenever an artifact in the Smart Remote Repository is downloaded locally so that it can update its download counter. Note that if this option is not set, there may be a discrepancy between the number of artifacts reported to have been downloaded in the different Artifactory instances of the proxy chain. Default value is 'false'.",
						},
						"properties_enabled": {
							Type:        schema.TypeBool,
							Optional:    true,
							Default:     false,
							Description: "If set, properties for artifacts that have been cached in this repository will be updated if they are modified in the artifact hosted at the remote Artifactory instance. The trigger to synchronize the properties is download of the artifact from the remote repository cache of the local Artifactory instance. Default value is 'false'.",
						},
						"source_origin_absence_detection": {
							Type:        schema.TypeBool,
							Optional:    true,
							Default:     false,
							Description: "If set, Artifactory displays an indication on cached items if they have been deleted from the corresponding repository in the remote Artifactory instance. Default value is 'false'",
						},
					},
				},
			},
			"query_params": {
				Type:     schema.TypeString,
				Optional: true,
				Description: "Custom HTTP query parameters that will be automatically included in all remote resource requests. " +
					"For example: `param1=val1&param2=val2&param3=val3`",
			},
			"list_remote_folder_items": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  true,
				Description: "Lists the items of remote folders in simple and list browsing. The remote content is cached " +
					"according to the value of the 'Retrieval Cache Period'. Default value is 'true'.",
			},
			"mismatching_mime_types_override_list": {
				Type:             schema.TypeString,
				Optional:         true,
				ValidateDiagFunc: validator.CommaSeperatedList,
				StateFunc:        utilsdk.FormatCommaSeparatedString,
				Description: "The set of mime types that should override the block_mismatching_mime_types setting. " +
					"Eg: 'application/json,application/xml'. Default value is empty.",
			},
			"download_direct": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
				Description: "When set, download requests to this repository will redirect the client to download the artifact " +
					"directly from the cloud storage provider. Available in Enterprise+ and Edge licenses only. Default value is 'false'.",
			},
			"cdn_redirect": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "When set, download requests to this repository will redirect the client to download the artifact directly from AWS CloudFront. Available in Enterprise+ and Edge licenses only. Default value is 'false'",
			},
			"disable_url_normalization": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "Whether to disable URL normalization, default is `false`.",
			},
		},
	)
}
View Source
var BasicRepoSchema = func(packageType string, isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(BaseRemoteRepoSchema(isResource), repository.RepoLayoutRefSchema(rclass, packageType))
}
View Source
var BowerRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		VcsRemoteRepoSchema,
		map[string]*schema.Schema{
			"bower_registry_url": {
				Type:         schema.TypeString,
				Optional:     true,
				Default:      "https://registry.bower.io",
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Description:  `Proxy remote Bower repository. Default value is "https://registry.bower.io".`,
			},
		},
		repository.RepoLayoutRefSchema(rclass, BowerPackageType),
	)
}
View Source
var CargoRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	cargoSchema := utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"git_registry_url": {
				Type:         schema.TypeString,
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Description:  `This is the index url, expected to be a git repository. Default value in UI is "https://github.com/rust-lang/crates.io-index"`,
			},
			"anonymous_access": {
				Type:     schema.TypeBool,
				Optional: true,
				Description: "(On the UI: Anonymous download and search) Cargo client does not send credentials when performing download and search for crates. " +
					"Enable this to allow anonymous access to these resources (only), note that this will override the security anonymous access option.",
			},
			"enable_sparse_index": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "Enable internal index support based on Cargo sparse index specifications, instead of the default git index. Default value is 'false'.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, CargoPackageType),
	)

	if isResource {
		cargoSchema["git_registry_url"].Required = true
	} else {
		cargoSchema["git_registry_url"].Optional = true
	}

	return cargoSchema
}
View Source
var CocoapodsRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(BaseRemoteRepoSchema(isResource), VcsRemoteRepoSchema, map[string]*schema.Schema{
		"pods_specs_repo_url": {
			Type:         schema.TypeString,
			Optional:     true,
			Default:      "https://github.com/CocoaPods/Specs",
			ValidateFunc: validation.IsURLWithHTTPorHTTPS,
			Description:  `Proxy remote CocoaPods Specs repositories. Default value is "https://github.com/CocoaPods/Specs".`,
		},
	}, repository.RepoLayoutRefSchema(rclass, CocoapodsPackageType))
}
View Source
var ComposerRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		VcsRemoteRepoSchema,
		map[string]*schema.Schema{
			"composer_registry_url": {
				Type:         schema.TypeString,
				Optional:     true,
				Default:      "https://packagist.org",
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Description:  `Proxy remote Composer repository. Default value is "https://packagist.org".`,
			},
		},
		repository.RepoLayoutRefSchema(rclass, ComposerPackageType),
	)
}
View Source
var CurationRemoteRepoSchema = map[string]*schema.Schema{
	"curated": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Enable repository to be protected by the Curation service.",
	},
}
View Source
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,
				Optional:    true,
				Default:     false,
				Description: "Also known as 'Foreign Layers Caching' on the UI, default is `false`.",
			},
			"enable_token_authentication": {
				Type:        schema.TypeBool,
				Optional:    true,
				Computed:    true,
				Description: "Enable token (Bearer) based authentication.",
			},
			"block_pushing_schema1": {
				Type:        schema.TypeBool,
				Optional:    true,
				Computed:    true,
				Description: "When set, Artifactory will block the pulling of Docker images with manifest v2 schema 1 from the remote repository (i.e. the upstream). It will be possible to pull images with manifest v2 schema 1 that exist in the cache.",
			},

			"external_dependencies_patterns": {
				Type:     schema.TypeList,
				Optional: true,
				Elem: &schema.Schema{
					Type: schema.TypeString,
				},
				RequiredWith: []string{"external_dependencies_enabled"},
				Description: "An allow list of Ant-style path patterns that determine which remote VCS roots Artifactory will " +
					"follow to download remote modules from, when presented with 'go-import' meta tags in the remote repository response. " +
					"By default, this is set to '**' in the UI, which means that remote modules may be downloaded from any external VCS source." +
					"Due to SDKv2 limitations, we can't set the default value for the list." +
					"This value must be assigned to the attribute manually, if user don't specify any other non-default values." +
					"This attribute must be set together with `external_dependencies_enabled = true`",
			},
			"project_id": {
				Type:        schema.TypeString,
				Optional:    true,
				Description: "Use this attribute to enter your GCR, GAR Project Id to limit the scope of this remote repo to a specific project in your third-party registry. When leaving this field blank or unset, remote repositories that support project id will default to their default project as you have set up in your account.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, DockerPackageType),
	)
}
View Source
var GenericRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	genericSchema := utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"propagate_query_params": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "When set, if query params are included in the request to Artifactory, they will be passed on to the remote repository.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, GenericPackageType),
	)

	return genericSchema
}
View Source
var GoRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"vcs_git_provider": {
				Type:             schema.TypeString,
				Optional:         true,
				Default:          "ARTIFACTORY",
				ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"GITHUB", "ARTIFACTORY"}, false)),
				Description:      `Artifactory supports proxying the following Git providers out-of-the-box: GitHub or a remote Artifactory instance. Default value is "ARTIFACTORY".`,
			},
		},
		repository.RepoLayoutRefSchema(rclass, GoPackageType),
	)
}
View Source
var HelmOciRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"external_dependencies_enabled": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "Also known as 'Foreign Layers Caching' on the UI, default is `false`.",
			},
			"enable_token_authentication": {
				Type:        schema.TypeBool,
				Optional:    true,
				Computed:    true,
				Description: "Enable token (Bearer) based authentication.",
			},

			"external_dependencies_patterns": {
				Type:     schema.TypeList,
				Optional: true,
				Elem: &schema.Schema{
					Type: schema.TypeString,
				},
				RequiredWith: []string{"external_dependencies_enabled"},
				Description: "Optional include patterns to match external URLs. Ant-style path expressions are supported (*, **, ?). " +
					"For example, specifying `**/github.com/**` will only allow downloading foreign layers from github.com host." +
					"By default, this is set to '**' in the UI, which means that foreign layers may be downloaded from any external host." +
					"Due to Terraform SDKv2 limitations, we can't set the default value for the list." +
					"This value must be assigned to the attribute manually, if user don't specify any other non-default values." +
					"This attribute must be set together with `external_dependencies_enabled = true`",
			},
			"project_id": {
				Type:     schema.TypeString,
				Optional: true,
				Description: "Use this attribute to enter your GCR, GAR Project Id to limit the scope of this remote repo to a specific " +
					"project in your third-party registry. When leaving this field blank or unset, remote repositories that support project id " +
					"will default to their default project as you have set up in your account.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, HelmOciPackageType),
	)
}
View Source
var HelmRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"helm_charts_base_url": {
				Type:     schema.TypeString,
				Optional: true,
				Default:  "",
				ValidateDiagFunc: validation.ToDiagFunc(
					validation.Any(
						validation.IsURLWithScheme([]string{"http", "https", "oci"}),
						validation.StringIsEmpty,
					),
				),
				Description: "Base URL for the translation of chart source URLs in the index.yaml of virtual repos. " +
					"Artifactory will only translate URLs matching the index.yamls hostname or URLs starting with this base url. " +
					"Support http/https/oci protocol scheme.",
			},
			"external_dependencies_enabled": {
				Type:        schema.TypeBool,
				Default:     false,
				Optional:    true,
				Description: "When set, external dependencies are rewritten. External Dependency Rewrite in the UI.",
			},

			"external_dependencies_patterns": {
				Type:     schema.TypeList,
				Optional: true,
				ForceNew: true,
				Elem: &schema.Schema{
					Type: schema.TypeString,
				},
				RequiredWith: []string{"external_dependencies_enabled"},
				Description: "An allow list of Ant-style path patterns that determine which remote VCS roots Artifactory will " +
					"follow to download remote modules from, when presented with 'go-import' meta tags in the remote repository response." +
					"Default value in UI is empty. This attribute must be set together with `external_dependencies_enabled = true`",
			},
		},
		repository.RepoLayoutRefSchema(rclass, HelmPackageType),
	)
}
View Source
var HuggingFaceSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"url": {
				Type:        schema.TypeString,
				Optional:    true,
				Default:     "https://huggingface.co",
				Description: "The remote repo URL. Default to 'https://huggingface.co'",
			},
		},
		repository.RepoLayoutRefSchema(rclass, HuggingFacePackageType),
	)
}
View Source
var MavenRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		JavaRemoteSchema(isResource, MavenPackageType, false),
		CurationRemoteRepoSchema,
	)
}
View Source
var NpmRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		CurationRemoteRepoSchema,
		repository.RepoLayoutRefSchema(rclass, NpmPackageType),
	)
}
View Source
var NugetRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"feed_context_path": {
				Type:        schema.TypeString,
				Optional:    true,
				Default:     "api/v2",
				Description: `When proxying a remote NuGet repository, customize feed resource location using this attribute. Default value is 'api/v2'.`,
			},
			"download_context_path": {
				Type:             schema.TypeString,
				Optional:         true,
				Default:          "api/v2/package",
				ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
				Description:      `The context path prefix through which NuGet downloads are served. Default value is 'api/v2/package'.`,
			},
			"v3_feed_url": {
				Type:             schema.TypeString,
				Optional:         true,
				Default:          "https://api.nuget.org/v3/index.json",
				ValidateDiagFunc: validation.ToDiagFunc(validation.Any(validation.IsURLWithHTTPorHTTPS, validation.StringIsEmpty)),
				Description:      `The URL to the NuGet v3 feed. Default value is 'https://api.nuget.org/v3/index.json'.`,
			},
			"force_nuget_authentication": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: `Force basic authentication credentials in order to use this repository. Default value is 'false'.`,
			},
			"symbol_server_url": {
				Type:             schema.TypeString,
				Optional:         true,
				Default:          "https://symbols.nuget.org/download/symbols",
				ValidateDiagFunc: validation.ToDiagFunc(validation.Any(validation.IsURLWithHTTPorHTTPS, validation.StringIsEmpty)),
				Description:      `NuGet symbol server URL.`,
			},
		}, repository.RepoLayoutRefSchema(rclass, NugetPackageType),
	)
}
View Source
var OciRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"external_dependencies_enabled": {
				Type:        schema.TypeBool,
				Optional:    true,
				Default:     false,
				Description: "Also known as 'Foreign Layers Caching' on the UI, default is `false`.",
			},
			"enable_token_authentication": {
				Type:        schema.TypeBool,
				Optional:    true,
				Computed:    true,
				Description: "Enable token (Bearer) based authentication.",
			},

			"external_dependencies_patterns": {
				Type:     schema.TypeList,
				Optional: true,
				Elem: &schema.Schema{
					Type: schema.TypeString,
				},
				RequiredWith: []string{"external_dependencies_enabled"},
				Description: "Optional include patterns to match external URLs. Ant-style path expressions are supported (*, **, ?). " +
					"For example, specifying `**/github.com/**` will only allow downloading foreign layers from github.com host." +
					"By default, this is set to '**' in the UI, which means that foreign layers may be downloaded from any external host." +
					"Due to Terraform SDKv2 limitations, we can't set the default value for the list." +
					"This value must be assigned to the attribute manually, if user don't specify any other non-default values." +
					"This attribute must be set together with `external_dependencies_enabled = true`",
			},
			"project_id": {
				Type:     schema.TypeString,
				Optional: true,
				Description: "Use this attribute to enter your GCR, GAR Project Id to limit the scope of this remote repo to a specific " +
					"project in your third-party registry. When leaving this field blank or unset, remote repositories that support project id " +
					"will default to their default project as you have set up in your account.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, OciPackageType),
	)
}
View Source
var PackageTypesLikeBasic = []string{
	"alpine",
	"chef",
	"conda",
	"cran",
	"debian",
	"gems",
	"gitlfs",
	"opkg",
	"p2",
	"pub",
	"puppet",
	"rpm",
	"swift",
}
View Source
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,
				Optional:         true,
				Default:          "https://pypi.org",
				ValidateDiagFunc: validation.ToDiagFunc(validation.IsURLWithHTTPorHTTPS),
				Description:      "To configure the remote repo to proxy public external PyPI repository, or a PyPI repository hosted on another Artifactory server. See JFrog Pypi documentation for the usage details. Default value is 'https://pypi.org'.",
			},
			"pypi_repository_suffix": {
				Type:             schema.TypeString,
				Optional:         true,
				Default:          "simple",
				ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
				Description:      "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'.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, PypiPackageType),
	)
}
View Source
var TerraformRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		map[string]*schema.Schema{
			"terraform_registry_url": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Default:      "https://registry.terraform.io",
				Description: "The base URL of the registry API. When using Smart Remote Repositories, set the URL to" +
					" <base_Artifactory_URL>/api/terraform/repokey. Default value in UI is https://registry.terraform.io",
			},
			"terraform_providers_url": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validation.IsURLWithHTTPorHTTPS,
				Default:      "https://releases.hashicorp.com",
				Description: "The base URL of the Provider's storage API. When using Smart remote repositories, set " +
					"the URL to <base_Artifactory_URL>/api/terraform/repokey/providers. Default value in UI is https://releases.hashicorp.com",
			},
		},
		repository.RepoLayoutRefSchema(rclass, TerraformPackageType),
	)
}
View Source
var VcsRemoteRepoSchema = map[string]*schema.Schema{
	"vcs_git_provider": {
		Type:             schema.TypeString,
		Optional:         true,
		Default:          "GITHUB",
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"GITHUB", "BITBUCKET", "OLDSTASH", "STASH", "ARTIFACTORY", "CUSTOM"}, false)),
		Description:      `Artifactory supports proxying the following Git providers out-of-the-box: GitHub or a remote Artifactory instance. Default value is "GITHUB".`,
	},
	"vcs_git_download_url": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
		Description:      `This attribute is used when vcs_git_provider is set to 'CUSTOM'. Provided URL will be used as proxy.`,
	},
}
View Source
var VcsRemoteSchema = func(isResource bool) map[string]*schema.Schema {
	return utilsdk.MergeMaps(
		BaseRemoteRepoSchema(isResource),
		VcsRemoteRepoSchema,
		map[string]*schema.Schema{
			"max_unique_snapshots": {
				Type:     schema.TypeInt,
				Optional: true,
				Default:  0,
				Description: "The maximum number of unique snapshots of a single artifact to store. Once the number of " +
					"snapshots exceeds this setting, older versions are removed. A value of 0 (default) indicates there is " +
					"no limit, and unique snapshots are not cleaned up.",
			},
		},
		repository.RepoLayoutRefSchema(rclass, VcsPackageType),
	)
}

Functions

func JavaRemoteSchema

func JavaRemoteSchema(isResource bool, packageType string, suppressPom bool) map[string]*schema.Schema

func ResourceArtifactoryRemoteBasicRepository

func ResourceArtifactoryRemoteBasicRepository(packageType string) *schema.Resource

func ResourceArtifactoryRemoteBowerRepository

func ResourceArtifactoryRemoteBowerRepository() *schema.Resource

func ResourceArtifactoryRemoteCargoRepository

func ResourceArtifactoryRemoteCargoRepository() *schema.Resource

func ResourceArtifactoryRemoteCocoapodsRepository

func ResourceArtifactoryRemoteCocoapodsRepository() *schema.Resource

func ResourceArtifactoryRemoteComposerRepository

func ResourceArtifactoryRemoteComposerRepository() *schema.Resource

func ResourceArtifactoryRemoteConanRepository

func ResourceArtifactoryRemoteConanRepository() *schema.Resource

func ResourceArtifactoryRemoteDockerRepository

func ResourceArtifactoryRemoteDockerRepository() *schema.Resource

func ResourceArtifactoryRemoteGenericRepository

func ResourceArtifactoryRemoteGenericRepository() *schema.Resource

func ResourceArtifactoryRemoteGoRepository

func ResourceArtifactoryRemoteGoRepository() *schema.Resource

func ResourceArtifactoryRemoteHelmOciRepository added in v10.2.0

func ResourceArtifactoryRemoteHelmOciRepository() *schema.Resource

func ResourceArtifactoryRemoteHelmRepository

func ResourceArtifactoryRemoteHelmRepository() *schema.Resource

func ResourceArtifactoryRemoteHuggingFaceRepository

func ResourceArtifactoryRemoteHuggingFaceRepository() *schema.Resource

func ResourceArtifactoryRemoteJavaRepository

func ResourceArtifactoryRemoteJavaRepository(packageType string, suppressPom bool) *schema.Resource

func ResourceArtifactoryRemoteMavenRepository

func ResourceArtifactoryRemoteMavenRepository() *schema.Resource

func ResourceArtifactoryRemoteNpmRepository

func ResourceArtifactoryRemoteNpmRepository() *schema.Resource

func ResourceArtifactoryRemoteNugetRepository

func ResourceArtifactoryRemoteNugetRepository() *schema.Resource

func ResourceArtifactoryRemoteOciRepository added in v10.2.0

func ResourceArtifactoryRemoteOciRepository() *schema.Resource

func ResourceArtifactoryRemotePypiRepository

func ResourceArtifactoryRemotePypiRepository() *schema.Resource

func ResourceArtifactoryRemoteTerraformRepository

func ResourceArtifactoryRemoteTerraformRepository() *schema.Resource

func ResourceArtifactoryRemoteVcsRepository

func ResourceArtifactoryRemoteVcsRepository() *schema.Resource

func ResourceMavenStateUpgradeV1

func ResourceMavenStateUpgradeV1(_ context.Context, rawState map[string]interface{}, _ interface{}) (map[string]interface{}, error)

func ResourceStateUpgradeV1

func ResourceStateUpgradeV1(_ context.Context, rawState map[string]interface{}, _ interface{}) (map[string]interface{}, error)

Types

type BowerRemoteRepo

type BowerRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryVcsParams
	BowerRegistryUrl string `json:"bowerRegistryUrl"`
}

type CargoRemoteRepo

type CargoRemoteRepo struct {
	RepositoryRemoteBaseParams
	RegistryUrl       string `hcl:"git_registry_url" json:"gitRegistryUrl"`
	AnonymousAccess   bool   `json:"cargoAnonymousAccess"`
	EnableSparseIndex bool   `json:"cargoInternalIndex"`
}

type CocoapodsRemoteRepo

type CocoapodsRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryVcsParams
	PodsSpecsRepoUrl string `json:"podsSpecsRepoUrl"`
}

type ComposerRemoteRepo

type ComposerRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryVcsParams
	ComposerRegistryUrl string `json:"composerRegistryUrl"`
}

type DockerRemoteRepo

type DockerRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryCurationParams
	ExternalDependenciesEnabled  bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"`
	EnableTokenAuthentication    bool     `json:"enableTokenAuthentication"`
	BlockPushingSchema1          bool     `hcl:"block_pushing_schema1" json:"blockPushingSchema1"`
	ProjectId                    string   `json:"dockerProjectId"`
}

type GenericRemoteRepo

type GenericRemoteRepo struct {
	RepositoryRemoteBaseParams
	PropagateQueryParams bool `json:"propagateQueryParams"`
}

type GoRemoteRepo

type GoRemoteRepo struct {
	RepositoryRemoteBaseParams
	VcsGitProvider string `json:"vcsGitProvider"`
}

type HelmOciRemoteRepo added in v10.2.0

type HelmOciRemoteRepo struct {
	RepositoryRemoteBaseParams
	ExternalDependenciesEnabled  bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"`
	EnableTokenAuthentication    bool     `json:"enableTokenAuthentication"`
	ProjectId                    string   `json:"dockerProjectId"`
}

type HelmRemoteRepo

type HelmRemoteRepo struct {
	RepositoryRemoteBaseParams
	HelmChartsBaseURL            string   `hcl:"helm_charts_base_url" json:"chartsBaseUrl"`
	ExternalDependenciesEnabled  bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns"`
}

type HuggingFaceRepo

type HuggingFaceRepo struct {
	RepositoryRemoteBaseParams
}

type JavaRemoteRepo

type JavaRemoteRepo struct {
	RepositoryRemoteBaseParams
	FetchJarsEagerly             bool   `json:"fetchJarsEagerly"`
	FetchSourcesEagerly          bool   `json:"fetchSourcesEagerly"`
	RemoteRepoChecksumPolicyType string `json:"remoteRepoChecksumPolicyType"`
	HandleReleases               bool   `json:"handleReleases"`
	HandleSnapshots              bool   `json:"handleSnapshots"`
	SuppressPomConsistencyChecks bool   `json:"suppressPomConsistencyChecks"`
	RejectInvalidJars            bool   `json:"rejectInvalidJars"`
}

func UnpackJavaRemoteRepo

func UnpackJavaRemoteRepo(s *schema.ResourceData, repoType string) JavaRemoteRepo

type MavenRemoteRepo

type MavenRemoteRepo struct {
	JavaRemoteRepo
	RepositoryCurationParams
}

type NugetRemoteRepo

type NugetRemoteRepo struct {
	RepositoryRemoteBaseParams
	FeedContextPath          string `json:"feedContextPath"`
	DownloadContextPath      string `json:"downloadContextPath"`
	V3FeedUrl                string `hcl:"v3_feed_url" json:"v3FeedUrl"` // Forced to specify hcl tag because predicate is not parsed by packer.Universal function.
	ForceNugetAuthentication bool   `json:"forceNugetAuthentication"`
	SymbolServerUrl          string `json:"symbolServerUrl"`
}

type OciRemoteRepo added in v10.2.0

type OciRemoteRepo struct {
	RepositoryRemoteBaseParams
	ExternalDependenciesEnabled  bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"`
	EnableTokenAuthentication    bool     `json:"enableTokenAuthentication"`
	ProjectId                    string   `json:"dockerProjectId"`
}

type PypiRemoteRepo

type PypiRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryCurationParams
	PypiRegistryUrl      string `json:"pyPIRegistryUrl"`
	PypiRepositorySuffix string `json:"pyPIRepositorySuffix"`
}

type RepositoryCurationParams

type RepositoryCurationParams struct {
	Curated bool `json:"curated"`
}

type RepositoryRemoteBaseParams

type RepositoryRemoteBaseParams struct {
	Key                               string                             `json:"key,omitempty"`
	ProjectKey                        string                             `json:"projectKey"`
	ProjectEnvironments               []string                           `json:"environments"`
	Rclass                            string                             `json:"rclass"`
	PackageType                       string                             `json:"packageType,omitempty"`
	Url                               string                             `json:"url"`
	Username                          string                             `json:"username"`
	Password                          string                             `json:"password,omitempty"` // must have 'omitempty' to avoid sending an empty string on update, if attribute is ignored by the provider.
	Proxy                             string                             `json:"proxy"`
	DisableProxy                      bool                               `json:"disableProxy"`
	Description                       string                             `json:"description"`
	Notes                             string                             `json:"notes"`
	IncludesPattern                   string                             `json:"includesPattern"`
	ExcludesPattern                   string                             `json:"excludesPattern"`
	RepoLayoutRef                     string                             `json:"repoLayoutRef"`
	RemoteRepoLayoutRef               string                             `json:"remoteRepoLayoutRef"`
	HardFail                          *bool                              `json:"hardFail,omitempty"`
	Offline                           *bool                              `json:"offline,omitempty"`
	BlackedOut                        *bool                              `json:"blackedOut,omitempty"`
	XrayIndex                         bool                               `json:"xrayIndex"`
	QueryParams                       string                             `json:"queryParams,omitempty"`
	PriorityResolution                bool                               `json:"priorityResolution"`
	StoreArtifactsLocally             *bool                              `json:"storeArtifactsLocally,omitempty"`
	SocketTimeoutMillis               int                                `json:"socketTimeoutMillis"`
	LocalAddress                      string                             `json:"localAddress"`
	RetrievalCachePeriodSecs          int                                `hcl:"retrieval_cache_period_seconds" json:"retrievalCachePeriodSecs"`
	MissedRetrievalCachePeriodSecs    int                                `hcl:"missed_cache_period_seconds" json:"missedRetrievalCachePeriodSecs"`
	MetadataRetrievalTimeoutSecs      int                                `json:"metadataRetrievalTimeoutSecs"`
	UnusedArtifactsCleanupPeriodHours int                                `json:"unusedArtifactsCleanupPeriodHours"`
	AssumedOfflinePeriodSecs          int                                `hcl:"assumed_offline_period_secs" json:"assumedOfflinePeriodSecs"`
	ShareConfiguration                *bool                              `hcl:"share_configuration" json:"shareConfiguration,omitempty"`
	SynchronizeProperties             *bool                              `hcl:"synchronize_properties" json:"synchronizeProperties"`
	BlockMismatchingMimeTypes         *bool                              `hcl:"block_mismatching_mime_types" json:"blockMismatchingMimeTypes"`
	PropertySets                      []string                           `hcl:"property_sets" json:"propertySets,omitempty"`
	AllowAnyHostAuth                  *bool                              `hcl:"allow_any_host_auth" json:"allowAnyHostAuth,omitempty"`
	EnableCookieManagement            *bool                              `hcl:"enable_cookie_management" json:"enableCookieManagement,omitempty"`
	BypassHeadRequests                *bool                              `hcl:"bypass_head_requests" json:"bypassHeadRequests,omitempty"`
	ClientTlsCertificate              string                             `hcl:"client_tls_certificate" json:"clientTlsCertificate,omitempty"`
	ContentSynchronisation            *repository.ContentSynchronisation `hcl:"content_synchronisation" json:"contentSynchronisation,omitempty"`
	MismatchingMimeTypeOverrideList   string                             `hcl:"mismatching_mime_types_override_list" json:"mismatchingMimeTypesOverrideList"`
	ListRemoteFolderItems             bool                               `json:"listRemoteFolderItems"`
	DownloadRedirect                  bool                               `hcl:"download_direct" json:"downloadRedirect,omitempty"`
	CdnRedirect                       bool                               `json:"cdnRedirect"`
	DisableURLNormalization           bool                               `hcl:"disable_url_normalization" json:"disableUrlNormalization"`
}

func UnpackBaseRemoteRepo

func UnpackBaseRemoteRepo(s *schema.ResourceData, packageType string) RepositoryRemoteBaseParams

func (RepositoryRemoteBaseParams) GetRclass

func (r RepositoryRemoteBaseParams) GetRclass() string

func (RepositoryRemoteBaseParams) Id

type RepositoryVcsParams

type RepositoryVcsParams struct {
	VcsGitProvider    string `json:"vcsGitProvider"`
	VcsGitDownloadUrl string `json:"vcsGitDownloadUrl"`
}

func UnpackVcsRemoteRepo

func UnpackVcsRemoteRepo(s *schema.ResourceData) RepositoryVcsParams

type TerraformRemoteRepo

type TerraformRemoteRepo struct {
	RepositoryRemoteBaseParams
	TerraformRegistryUrl  string `json:"terraformRegistryUrl"`
	TerraformProvidersUrl string `json:"terraformProvidersUrl"`
}

type VcsRemoteRepo

type VcsRemoteRepo struct {
	RepositoryRemoteBaseParams
	RepositoryVcsParams
	MaxUniqueSnapshots int `json:"maxUniqueSnapshots"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL