local

package
v10.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlpineLocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:     schema.TypeString,
			Optional: true,
			Description: "Used to sign index files in Alpine Linux repositories. " +
				"See: https://www.jfrog.com/confluence/display/JFROG/Alpine+Linux+Repositories#AlpineLinuxRepositories-SigningAlpineLinuxIndex",
		},
	},
	repository.RepoLayoutRefSchema(rclass, alpinePackageType),
	repository.CompressionFormats,
)
View Source
var BaseLocalRepoSchema = utilsdk.MergeMaps(
	repository.BaseRepoSchema,
	map[string]*schema.Schema{
		"blacked_out": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "When set, the repository does not participate in artifact resolution and new artifacts cannot be deployed.",
		},
		"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.",
		},
		"priority_resolution": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "Setting repositories with priority will cause metadata to be merged only from repositories set with this field",
		},
		"property_sets": {
			Type:        schema.TypeSet,
			Elem:        &schema.Schema{Type: schema.TypeString},
			Set:         schema.HashString,
			Optional:    true,
			Description: "List of property set name",
		},
		"archive_browsing_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Description: "When set, you may view content such as HTML or Javadoc files directly from Artifactory.\nThis may not be safe and therefore requires strict content moderation to prevent malicious users from uploading content that may compromise security (e.g., cross-site scripting attacks).",
		},
		"download_direct": {
			Type:        schema.TypeBool,
			Optional:    true,
			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.",
		},
		"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'",
		},
	},
)
View Source
var CargoLocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"anonymous_access": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "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. Default value is 'false'.",
		},
		"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),
	repository.CompressionFormats,
)
View Source
var DebianLocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:        schema.TypeString,
			Optional:    true,
			Description: "Used to sign index files in Debian artifacts. ",
		},
		"secondary_keypair_ref": {
			Type:        schema.TypeString,
			Optional:    true,
			Description: "Used to sign index files in Debian artifacts. ",
		},
		"trivial_layout": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "When set, the repository will use the deprecated trivial layout.",
			Deprecated:  "You shouldn't be using this",
		},
	},
	repository.RepoLayoutRefSchema(rclass, debianPackageType),
	repository.CompressionFormats,
)
View Source
var DockerV1LocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"max_unique_tags": {
			Type:     schema.TypeInt,
			Optional: true,
			Computed: true,
		},
		"tag_retention": {
			Type:     schema.TypeInt,
			Computed: true,
		},
		"block_pushing_schema1": {
			Type:     schema.TypeBool,
			Computed: true,
		},
		"api_version": {
			Type:     schema.TypeString,
			Computed: true,
		},
	},
	repository.RepoLayoutRefSchema(rclass, dockerPackageType),
)
View Source
var DockerV2LocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"max_unique_tags": {
			Type:     schema.TypeInt,
			Optional: true,
			Default:  0,
			Description: "The maximum number of unique tags of a single Docker image to store in this repository.\n" +
				"Once the number tags for an image exceeds this setting, older tags are removed. A value of 0 (default) indicates there is no limit.\n" +
				"This only applies to manifest v2",
			ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(0)),
		},
		"tag_retention": {
			Type:             schema.TypeInt,
			Optional:         true,
			Computed:         false,
			Description:      "If greater than 1, overwritten tags will be saved by their digest, up to the set up number. This only applies to manifest V2",
			ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(1)),
		},
		"block_pushing_schema1": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "When set, Artifactory will block the pushing of Docker images with manifest v2 schema 1 to this repository.",
		},
		"api_version": {
			Type:        schema.TypeString,
			Computed:    true,
			Description: "The Docker API version to use. This cannot be set",
		},
	},
	repository.RepoLayoutRefSchema(rclass, dockerPackageType),
)
View Source
var NugetLocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	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.\nOnce the number of " +
				"snapshots exceeds this setting, older versions are removed.\nA value of 0 (default) indicates there is no limit, and unique snapshots are not cleaned up.",
		},

		"force_nuget_authentication": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "Force basic authentication credentials in order to use this repository.",
		},
	},
	repository.RepoLayoutRefSchema(rclass, nugetPackageType),
)
View Source
var PackageTypesLikeGeneric = []string{
	"bower",
	"chef",
	"cocoapods",
	"composer",
	"conda",
	"cran",
	"gems",
	"generic",
	"gitlfs",
	"go",
	"helm",
	"huggingfaceml",
	"npm",
	"opkg",
	"pub",
	"puppet",
	"pypi",
	"swift",
	"terraformbackend",
	"vagrant",
}
View Source
var RpmLocalSchema = utilsdk.MergeMaps(
	BaseLocalRepoSchema,
	map[string]*schema.Schema{
		"yum_root_depth": {
			Type:             schema.TypeInt,
			Optional:         true,
			Default:          0,
			ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(0)),
			Description: "The depth, relative to the repository's root folder, where RPM metadata is created. " +
				"This is useful when your repository contains multiple RPM repositories under parallel hierarchies. " +
				"For example, if your RPMs are stored under 'fedora/linux/$releasever/$basearch', specify a depth of 4.",
		},
		"calculate_yum_metadata": {
			Type:     schema.TypeBool,
			Optional: true,
			Default:  false,
		},
		"enable_file_lists_indexing": {
			Type:     schema.TypeBool,
			Optional: true,
			Default:  false,
		},
		"yum_group_file_names": {
			Type:             schema.TypeString,
			Optional:         true,
			Default:          "",
			ValidateDiagFunc: validator.CommaSeperatedList,
			Description: "A comma separated list of XML file names containing RPM group component definitions. Artifactory includes " +
				"the group definitions as part of the calculated RPM metadata, as well as automatically generating a " +
				"gzipped version of the group files, if required.",
		},
		"primary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Primary keypair used to sign artifacts.",
		},
		"secondary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Secondary keypair used to sign artifacts.",
		},
	},
	repository.RepoLayoutRefSchema(rclass, rpmPackageType),
)
View Source
var UnpackLocalJavaRepository = func(data *schema.ResourceData, rclass string, packageType string) JavaLocalRepositoryParams {
	d := &utilsdk.ResourceData{ResourceData: data}
	return JavaLocalRepositoryParams{
		RepositoryBaseParams:         UnpackBaseRepo(rclass, data, packageType),
		ChecksumPolicyType:           d.GetString("checksum_policy_type", false),
		SnapshotVersionBehavior:      d.GetString("snapshot_version_behavior", false),
		MaxUniqueSnapshots:           d.GetInt("max_unique_snapshots", false),
		HandleReleases:               d.GetBool("handle_releases", false),
		HandleSnapshots:              d.GetBool("handle_snapshots", false),
		SuppressPomConsistencyChecks: d.GetBool("suppress_pom_consistency_checks", false),
	}
}

Functions

func GetGenericRepoSchema

func GetGenericRepoSchema(repoType string) map[string]*schema.Schema

func GetJavaRepoSchema

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

func GetPackageType

func GetPackageType(repoType string) string

GetPackageType `packageType` in the API call payload for Terraform repositories must be "terraform", but we use `terraform_module` and `terraform_provider` as a package types in the Provider. GetPackageType function corrects this discrepancy.

func GetTerraformLocalSchema

func GetTerraformLocalSchema(registryType string) map[string]*schema.Schema

func ResourceArtifactoryLocalAlpineRepository

func ResourceArtifactoryLocalAlpineRepository() *schema.Resource

func ResourceArtifactoryLocalCargoRepository

func ResourceArtifactoryLocalCargoRepository() *schema.Resource

func ResourceArtifactoryLocalConanRepository

func ResourceArtifactoryLocalConanRepository() *schema.Resource

func ResourceArtifactoryLocalDebianRepository

func ResourceArtifactoryLocalDebianRepository() *schema.Resource

func ResourceArtifactoryLocalDockerV1Repository

func ResourceArtifactoryLocalDockerV1Repository() *schema.Resource

func ResourceArtifactoryLocalDockerV2Repository

func ResourceArtifactoryLocalDockerV2Repository() *schema.Resource

func ResourceArtifactoryLocalGenericRepository

func ResourceArtifactoryLocalGenericRepository(repoType string) *schema.Resource

func ResourceArtifactoryLocalJavaRepository

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

func ResourceArtifactoryLocalNugetRepository

func ResourceArtifactoryLocalNugetRepository() *schema.Resource

func ResourceArtifactoryLocalRpmRepository

func ResourceArtifactoryLocalRpmRepository() *schema.Resource

func ResourceArtifactoryLocalTerraformRepository

func ResourceArtifactoryLocalTerraformRepository(registryType string) *schema.Resource

func UnpackConnanRepository

func UnpackConnanRepository(data *schema.ResourceData) (interface{}, string, error)

Types

type AlpineLocalRepoParams

type AlpineLocalRepoParams struct {
	RepositoryBaseParams
	PrimaryKeyPairRef string `hcl:"primary_keypair_ref" json:"primaryKeyPairRef"`
}

func UnpackLocalAlpineRepository

func UnpackLocalAlpineRepository(data *schema.ResourceData, rclass string) AlpineLocalRepoParams

type CargoLocalRepoParams

type CargoLocalRepoParams struct {
	RepositoryBaseParams
	AnonymousAccess   bool `json:"cargoAnonymousAccess"`
	EnableSparseIndex bool `json:"cargoInternalIndex"`
}

func UnpackLocalCargoRepository

func UnpackLocalCargoRepository(data *schema.ResourceData, rclass string) CargoLocalRepoParams

type ConanRepoParams

type ConanRepoParams struct {
	RepositoryBaseParams
	repository.ConanBaseParams
}

type DebianLocalRepositoryParams

type DebianLocalRepositoryParams struct {
	RepositoryBaseParams
	TrivialLayout           bool     `hcl:"trivial_layout" json:"debianTrivialLayout"`
	IndexCompressionFormats []string `hcl:"index_compression_formats" json:"optionalIndexCompressionFormats,omitempty"`
	PrimaryKeyPairRef       string   `hcl:"primary_keypair_ref" json:"primaryKeyPairRef,omitempty"`
	SecondaryKeyPairRef     string   `hcl:"secondary_keypair_ref" json:"secondaryKeyPairRef,omitempty"`
}

func UnpackLocalDebianRepository

func UnpackLocalDebianRepository(data *schema.ResourceData, rclass string) DebianLocalRepositoryParams

type DockerLocalRepositoryParams

type DockerLocalRepositoryParams struct {
	RepositoryBaseParams
	MaxUniqueTags       int    `hcl:"max_unique_tags" json:"maxUniqueTags"`
	DockerApiVersion    string `hcl:"api_version" json:"dockerApiVersion"`
	TagRetention        int    `hcl:"tag_retention" json:"dockerTagRetention"`
	BlockPushingSchema1 bool   `hcl:"block_pushing_schema1" json:"blockPushingSchema1"`
}

func UnpackLocalDockerV1Repository

func UnpackLocalDockerV1Repository(data *schema.ResourceData, rclass string) DockerLocalRepositoryParams

func UnpackLocalDockerV2Repository

func UnpackLocalDockerV2Repository(data *schema.ResourceData, rclass string) DockerLocalRepositoryParams

type JavaLocalRepositoryParams

type JavaLocalRepositoryParams struct {
	RepositoryBaseParams
	ChecksumPolicyType           string `hcl:"checksum_policy_type" json:"checksumPolicyType"`
	SnapshotVersionBehavior      string `hcl:"snapshot_version_behavior" json:"snapshotVersionBehavior"`
	MaxUniqueSnapshots           int    `hcl:"max_unique_snapshots" json:"maxUniqueSnapshots"`
	HandleReleases               bool   `hcl:"handle_releases" json:"handleReleases"`
	HandleSnapshots              bool   `hcl:"handle_snapshots" json:"handleSnapshots"`
	SuppressPomConsistencyChecks bool   `hcl:"suppress_pom_consistency_checks" json:"suppressPomConsistencyChecks"`
}

type NugetLocalRepositoryParams

type NugetLocalRepositoryParams struct {
	RepositoryBaseParams
	MaxUniqueSnapshots       int  `hcl:"max_unique_snapshots" json:"maxUniqueSnapshots"`
	ForceNugetAuthentication bool `hcl:"force_nuget_authentication" json:"forceNugetAuthentication"`
}

func UnpackLocalNugetRepository

func UnpackLocalNugetRepository(data *schema.ResourceData, rclass string) NugetLocalRepositoryParams

type RepositoryBaseParams

type RepositoryBaseParams struct {
	Key                    string   `hcl:"key" json:"key,omitempty"`
	ProjectKey             string   `json:"projectKey"`
	ProjectEnvironments    []string `json:"environments"`
	Rclass                 string   `json:"rclass"`
	PackageType            string   `hcl:"package_type" json:"packageType,omitempty"`
	Description            string   `json:"description"`
	Notes                  string   `json:"notes"`
	IncludesPattern        string   `hcl:"includes_pattern" json:"includesPattern,omitempty"`
	ExcludesPattern        string   `hcl:"excludes_pattern" json:"excludesPattern,omitempty"`
	RepoLayoutRef          string   `hcl:"repo_layout_ref" json:"repoLayoutRef,omitempty"`
	BlackedOut             *bool    `hcl:"blacked_out" json:"blackedOut,omitempty"`
	XrayIndex              bool     `json:"xrayIndex"`
	PropertySets           []string `hcl:"property_sets" json:"propertySets,omitempty"`
	ArchiveBrowsingEnabled *bool    `hcl:"archive_browsing_enabled" json:"archiveBrowsingEnabled,omitempty"`
	DownloadRedirect       *bool    `hcl:"download_direct" json:"downloadRedirect,omitempty"`
	CdnRedirect            *bool    `json:"cdnRedirect"`
	PriorityResolution     bool     `hcl:"priority_resolution" json:"priorityResolution"`
	TerraformType          string   `json:"terraformType"`
}

func UnpackBaseRepo

func UnpackBaseRepo(rclassType string, s *schema.ResourceData, packageType string) RepositoryBaseParams

func UnpackLocalTerraformRepository

func UnpackLocalTerraformRepository(data *schema.ResourceData, rclass string, registryType string) RepositoryBaseParams

func (RepositoryBaseParams) Id

func (bp RepositoryBaseParams) Id() string

type RpmLocalRepositoryParams

type RpmLocalRepositoryParams struct {
	RepositoryBaseParams
	RootDepth               int    `hcl:"yum_root_depth" json:"yumRootDepth"`
	CalculateYumMetadata    bool   `hcl:"calculate_yum_metadata" json:"calculateYumMetadata"`
	EnableFileListsIndexing bool   `hcl:"enable_file_lists_indexing" json:"enableFileListsIndexing"`
	GroupFileNames          string `hcl:"yum_group_file_names" json:"yumGroupFileNames"`
	PrimaryKeyPairRef       string `hcl:"primary_keypair_ref" json:"primaryKeyPairRef"`
	SecondaryKeyPairRef     string `hcl:"secondary_keypair_ref" json:"secondaryKeyPairRef"`
}

func UnpackLocalRpmRepository

func UnpackLocalRpmRepository(data *schema.ResourceData, rclass string) RpmLocalRepositoryParams

Jump to

Keyboard shortcuts

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