repository

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourceCleanup = &schema.Schema{
		Description: "Cleanup policies",
		Type:        schema.TypeList,
		Optional:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"policy_names": {
					Description: "List of policy names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Optional: true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeSet,
				},
			},
		},
	}
	DataSourceCleanup = &schema.Schema{
		Description: "Cleanup policies",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"policy_names": {
					Description: "List of policy names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Computed: true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeSet,
				},
			},
		},
	}
)
View Source
var (
	ResourceComponent = &schema.Schema{
		Description: "Component configuration for the hosted repository",
		Type:        schema.TypeList,
		Computed:    true,
		Optional:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"proprietary_components": {
					Description: "Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)",
					Type:        schema.TypeBool,
					Required:    true,
				},
			},
		},
	}

	DataSourceComponent = &schema.Schema{
		Description: "Component configuration for the hosted repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"proprietary_components": {
					Description: "Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)",
					Type:        schema.TypeBool,
					Computed:    true,
				},
			},
		},
	}
)
View Source
var (
	ResourceDocker = &schema.Schema{
		Description: "docker contains the configuration of the docker repository",
		Type:        schema.TypeList,
		Required:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"force_basic_auth": {
					Description: "Whether to force authentication (Docker Bearer Token Realm required if false)",
					Required:    true,
					Type:        schema.TypeBool,
				},
				"http_port": {
					Description: "Create an HTTP connector at specified port",
					Optional:    true,
					Type:        schema.TypeInt,
				},
				"https_port": {
					Description: "Create an HTTPS connector at specified port",
					Optional:    true,
					Type:        schema.TypeInt,
				},
				"v1_enabled": {
					Description: "Whether to allow clients to use the V1 API to interact with this repository",
					Required:    true,
					Type:        schema.TypeBool,
				},
			},
		},
	}
	DataSourceDocker = &schema.Schema{
		Description: "docker contains the configuration of the docker repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"force_basic_auth": {
					Description: "Whether to force authentication (Docker Bearer Token Realm required if false)",
					Computed:    true,
					Type:        schema.TypeBool,
				},
				"http_port": {
					Description: "Create an HTTP connector at specified port",
					Computed:    true,
					Type:        schema.TypeInt,
				},
				"https_port": {
					Description: "Create an HTTPS connector at specified port",
					Computed:    true,
					Type:        schema.TypeInt,
				},
				"v1_enabled": {
					Description: "Whether to allow clients to use the V1 API to interact with this repository",
					Computed:    true,
					Type:        schema.TypeBool,
				},
			},
		},
	}
)
View Source
var (
	ResourceGroup = &schema.Schema{
		Description: "Configuration for repository group",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"member_names": {
					Description: "Member repositories names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					MinItems: 1,
					Required: true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeSet,
				},
			},
		},
		MaxItems: 1,
		Required: true,
		Type:     schema.TypeList,
	}
	ResourceGroupDeploy = &schema.Schema{
		Description: "Configuration for repository group",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"member_names": {
					Description: "Member repositories names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					MinItems: 1,
					Required: true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeSet,
				},
				"writable_member": {
					Description: "Pro-only: This field is for the Group Deployment feature available in NXRM Pro.",
					Optional:    true,
					Type:        schema.TypeString,
				},
			},
		},
		MaxItems: 1,
		Required: true,
		Type:     schema.TypeList,
	}
	DataSourceGroup = &schema.Schema{
		Description: "Configuration for repository group",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"member_names": {
					Description: "Member repositories names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Computed: true,
					Type:     schema.TypeSet,
				},
			},
		},
		Computed: true,
		Type:     schema.TypeList,
	}
	DataSourceGroupDeploy = &schema.Schema{
		Description: "Configuration for repository group",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"member_names": {
					Description: "Member repositories names",
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Computed: true,
					Type:     schema.TypeSet,
				},
				"writable_member": {
					Description: "Pro-only: This field is for the Group Deployment feature available in NXRM Pro.",
					Computed:    true,
					Type:        schema.TypeString,
				},
			},
		},
		Computed: true,
		Type:     schema.TypeList,
	}
)
View Source
var (
	ResourceHTTPClient = &schema.Schema{
		Description: "HTTP Client configuration for proxy repositories. Required for docker proxy repositories",
		Optional:    true,
		MaxItems:    1,
		Type:        schema.TypeList,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"authentication": {
					Description: "Authentication configuration of the HTTP client",
					MaxItems:    1,
					Optional:    true,
					Type:        schema.TypeList,
					Elem: &schema.Resource{
						Schema: map[string]*schema.Schema{
							"type": {
								Description:  "Authentication type. Possible values: `ntlm` or `username`",
								Required:     true,
								Type:         schema.TypeString,
								ValidateFunc: validation.StringInSlice([]string{"ntlm", "username"}, false),
							},
							"username": {
								Description: "The username used by the proxy repository",
								Optional:    true,
								Type:        schema.TypeString,
							},
							"password": {
								Description: "The password used by the proxy repository",
								Optional:    true,
								Sensitive:   true,
								Type:        schema.TypeString,
							},
							"ntlm_domain": {
								Description: "The ntlm domain to connect",
								Optional:    true,
								Type:        schema.TypeString,
							},
							"ntlm_host": {
								Description: "The ntlm host to connect",
								Optional:    true,
								Type:        schema.TypeString,
							},
						},
					},
				},
				"auto_block": {
					Default:     true,
					Description: "Whether to auto-block outbound connections if remote peer is detected as unreachable/unresponsive",
					Optional:    true,
					Type:        schema.TypeBool,
				},
				"blocked": {
					Default:     false,
					Description: "Whether to block outbound connections on the repository",
					Optional:    true,
					Type:        schema.TypeBool,
				},
				"connection": {
					Description: "Connection configuration of the HTTP client",
					Computed:    true,
					Optional:    true,
					MaxItems:    1,
					Type:        schema.TypeList,
					Elem: &schema.Resource{
						Schema: map[string]*schema.Schema{
							"enable_circular_redirects": {
								Description: "Whether to enable redirects to the same location (may be required by some servers)",
								Optional:    true,
								Type:        schema.TypeBool,
								Default:     false,
							},
							"enable_cookies": {
								Description: "Whether to allow cookies to be stored and used",
								Optional:    true,
								Type:        schema.TypeBool,
								Default:     false,
							},
							"retries": {
								Description:  "Total retries if the initial connection attempt suffers a timeout",
								Optional:     true,
								Type:         schema.TypeInt,
								Default:      0,
								ValidateFunc: validation.IntBetween(0, 10),
							},
							"timeout": {
								Description:  "Seconds to wait for activity before stopping and retrying the connection",
								Optional:     true,
								Type:         schema.TypeInt,
								Default:      0,
								ValidateFunc: validation.IntBetween(0, 3600),
							},
							"user_agent_suffix": {
								Description: "Custom fragment to append to User-Agent header in HTTP requests",
								Optional:    true,
								Type:        schema.TypeString,
								Default:     false,
							},
							"use_trust_store": {
								Description: "Use certificates stored in the Nexus Repository Manager truststore to connect to external systems",
								Optional:    true,
								Type:        schema.TypeBool,
								Default:     false,
							},
						},
					},
				},
			},
		},
	}
	DataSourceHTTPClient = &schema.Schema{
		Description: "HTTP Client configuration for proxy repositories. Required for docker proxy repositories.",
		Computed:    true,
		Type:        schema.TypeList,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"authentication": {
					Description: "Authentication configuration of the HTTP client",
					Computed:    true,
					Type:        schema.TypeList,
					Elem: &schema.Resource{
						Schema: map[string]*schema.Schema{
							"type": {
								Description: "Authentication type. Possible values: `ntlm` or `username`",
								Computed:    true,
								Type:        schema.TypeString,
							},
							"username": {
								Description: "The username used by the proxy repository",
								Computed:    true,
								Type:        schema.TypeString,
							},
							"password": {
								Description: "The password used by the proxy repository",
								Computed:    true,
								Sensitive:   true,
								Type:        schema.TypeString,
							},
							"ntlm_domain": {
								Description: "The ntlm domain to connect",
								Computed:    true,
								Type:        schema.TypeString,
							},
							"ntlm_host": {
								Description: "The ntlm host to connect",
								Computed:    true,
								Type:        schema.TypeString,
							},
						},
					},
				},
				"auto_block": {
					Description: "Whether to auto-block outbound connections if remote peer is detected as unreachable/unresponsive",
					Computed:    true,
					Type:        schema.TypeBool,
				},
				"blocked": {
					Description: "Whether to block outbound connections on the repository",
					Computed:    true,
					Type:        schema.TypeBool,
				},
				"connection": {
					Description: "Connection configuration of the HTTP client",
					Computed:    true,
					Type:        schema.TypeList,
					Elem: &schema.Resource{
						Schema: map[string]*schema.Schema{
							"enable_circular_redirects": {
								Description: "Whether to enable redirects to the same location (may be required by some servers)",
								Computed:    true,
								Type:        schema.TypeBool,
							},
							"enable_cookies": {
								Description: "Whether to allow cookies to be stored and used",
								Computed:    true,
								Type:        schema.TypeBool,
							},
							"retries": {
								Description: "Total retries if the initial connection attempt suffers a timeout",
								Computed:    true,
								Type:        schema.TypeInt,
							},
							"timeout": {
								Description: "Seconds to wait for activity before stopping and retrying the connection",
								Computed:    true,
								Type:        schema.TypeInt,
							},
							"user_agent_suffix": {
								Description: "Custom fragment to append to User-Agent header in HTTP requests",
								Computed:    true,
								Type:        schema.TypeString,
							},
							"use_trust_store": {
								Description: "Use certificates stored in the Nexus Repository Manager truststore to connect to external systems",
								Computed:    true,
								Type:        schema.TypeBool,
							},
						},
					},
				},
			},
		},
	}
)
View Source
var (
	ResourceMaven = &schema.Schema{
		Description: "Maven contains additional data of maven repository",
		Type:        schema.TypeList,
		Required:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"version_policy": {
					Description: "What type of artifacts does this repository store? Possible Value: `RELEASE`, `SNAPSHOT` or `MIXED`",
					Optional:    true,
					Type:        schema.TypeString,
				},
				"layout_policy": {
					Description: "Validate that all paths are maven artifact or metadata paths. Possible Value: `STRICT` or `PERMISSIVE`",
					Optional:    true,
					Type:        schema.TypeString,
				},
				"content_disposition": {
					Description: "Add Content-Disposition header as 'Attachment' to disable some content from being inline in a browse. Possible Value: `INLINE` or `ATTACHMENT`",
					Optional:    true,
					Type:        schema.TypeString,
				},
			},
		},
	}
	DataSourceMaven = &schema.Schema{
		Description: "Maven contains additional data of maven repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"version_policy": {
					Description: "What type of artifacts does this repository store?",
					Computed:    true,
					Type:        schema.TypeString,
				},
				"layout_policy": {
					Description: "Validate that all paths are maven artifact or metadata paths",
					Computed:    true,
					Type:        schema.TypeString,
				},
				"content_disposition": {
					Description: "Add Content-Disposition header as 'Attachment' to disable some content from being inline in a browse",
					Computed:    true,
					Type:        schema.TypeString,
				},
			},
		},
	}
)
View Source
var (
	ResourceName = &schema.Schema{
		Description: "A unique identifier for this repository",
		Required:    true,
		Type:        schema.TypeString,
	}
	DataSourceName = ResourceName
)
View Source
var (
	ResourceNegativeCache = &schema.Schema{
		Description: "Configuration of the negative cache handling",
		Optional:    true,
		Type:        schema.TypeList,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"enabled": {
					Default:     false,
					Description: "Whether to cache responses for content not present in the proxied repository",
					Optional:    true,
					Type:        schema.TypeBool,
				},
				"ttl": {
					Default:     1440,
					Description: "How long to cache the fact that a file was not found in the repository (in minutes)",
					Optional:    true,
					Type:        schema.TypeInt,
				},
			},
		},
	}
	DataSourceNegativeCache = &schema.Schema{
		Description: "Configuration of the negative cache handling",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"enabled": {
					Description: "Whether to cache responses for content not present in the proxied repository",
					Type:        schema.TypeBool,
					Computed:    true,
				},
				"ttl": {
					Description: "How long to cache the fact that a file was not found in the repository (in minutes)",
					Type:        schema.TypeInt,
					Computed:    true,
				},
			},
		},
	}
)
View Source
var (
	ResourceOnline = &schema.Schema{
		Default:     true,
		Description: "Whether this repository accepts incoming requests",
		Optional:    true,
		Type:        schema.TypeBool,
	}
	DataSourceOnline = &schema.Schema{
		Description: "Whether this repository accepts incoming requests",
		Type:        schema.TypeBool,
		Computed:    true,
	}
)
View Source
var (
	ResourceProxy = &schema.Schema{
		Description: "Configuration for the proxy repository",
		Type:        schema.TypeList,
		Required:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"content_max_age": {
					Description: "How long (in minutes) to cache artifacts before rechecking the remote repository",
					Type:        schema.TypeInt,
					Optional:    true,
					Default:     1440,
				},
				"metadata_max_age": {
					Description: "How long (in minutes) to cache metadata before rechecking the remote repository.",
					Type:        schema.TypeInt,
					Optional:    true,
					Default:     1440,
				},
				"remote_url": {
					Description: "Location of the remote repository being proxied",
					Type:        schema.TypeString,
					Required:    true,
				},
			},
		},
	}
	DataSourceProxy = &schema.Schema{
		Description: "Configuration for the proxy repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"content_max_age": {
					Description: "How long (in minutes) to cache artifacts before rechecking the remote repository",
					Type:        schema.TypeInt,
					Computed:    true,
				},
				"metadata_max_age": {
					Description: "How long (in minutes) to cache metadata before rechecking the remote repository.",
					Type:        schema.TypeInt,
					Computed:    true,
				},
				"remote_url": {
					Description: "Location of the remote repository being proxied",
					Type:        schema.TypeString,
					Computed:    true,
				},
			},
		},
	}
)
View Source
var (
	ResourceRoutingRule = &schema.Schema{
		Description: "The name of the routing rule assigned to this repository",
		Optional:    true,
		Type:        schema.TypeString,
	}
	DataSourceRoutingRule = &schema.Schema{
		Description: "The name of the routing rule assigned to this repository",
		Computed:    true,
		Type:        schema.TypeString,
	}
)
View Source
var (
	ResourceStorage = &schema.Schema{
		Description: "The storage configuration of the repository",
		Type:        schema.TypeList,
		Required:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"blob_store_name": {
					Description: "Blob store used to store repository contents",
					Required:    true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeString,
				},
				"strict_content_type_validation": {
					Default:     true,
					Description: "Whether to validate uploaded content's MIME type appropriate for the repository format",
					Optional:    true,
					Type:        schema.TypeBool,
				},
			},
		},
	}
	DataSourceStorage = &schema.Schema{
		Description: "The storage configuration of the repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"blob_store_name": {
					Description: "Blob store used to store repository contents",
					Computed:    true,
					Type:        schema.TypeString,
				},
				"strict_content_type_validation": {
					Description: "Whether to validate uploaded content's MIME type appropriate for the repository format",
					Computed:    true,
					Type:        schema.TypeBool,
				},
			},
		},
	}

	ResourceHostedStorage = &schema.Schema{
		Description: "The storage configuration of the repository",
		Type:        schema.TypeList,
		Required:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"blob_store_name": {
					Description: "Blob store used to store repository contents",
					Required:    true,
					Set: func(v interface{}) int {
						return schema.HashString(strings.ToLower(v.(string)))
					},
					Type: schema.TypeString,
				},
				"strict_content_type_validation": {
					Description: "Whether to validate uploaded content's MIME type appropriate for the repository format",
					Required:    true,
					Type:        schema.TypeBool,
				},
				"write_policy": {
					Description: "Controls if deployments of and updates to assets are allowed",
					Default:     "ALLOW",
					Optional:    true,
					Type:        schema.TypeString,
					ValidateFunc: validation.StringInSlice([]string{
						"ALLOW",
						"ALLOW_ONCE",
						"DENY",
					}, false),
				},
			},
		},
	}
	DataSourceHostedStorage = &schema.Schema{
		Description: "The storage configuration of the repository",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"blob_store_name": {
					Description: "Blob store used to store repository contents",
					Computed:    true,
					Type:        schema.TypeString,
				},
				"strict_content_type_validation": {
					Description: "Whether to validate uploaded content's MIME type appropriate for the repository format",
					Computed:    true,
					Type:        schema.TypeBool,
				},
				"write_policy": {
					Description: "Controls if deployments of and updates to assets are allowed",
					Computed:    true,
					Type:        schema.TypeString,
				},
			},
		},
	}
)
View Source
var (
	ResourceYumSigning = &schema.Schema{
		Description: "Contains signing data of repositores",
		Type:        schema.TypeList,
		Optional:    true,
		MaxItems:    1,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"keypair": {
					Description: "PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor)",
					Type:        schema.TypeString,
					Required:    true,
					Sensitive:   true,
				},
				"passphrase": {
					Description: "Passphrase to access PGP signing key",
					Type:        schema.TypeString,
					Optional:    true,
					Sensitive:   true,
				},
			},
		},
	}
	DataSourceYumSigning = &schema.Schema{
		Description: "Contains signing data of repositores",
		Type:        schema.TypeList,
		Computed:    true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"keypair": {
					Description: "PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor)",
					Type:        schema.TypeString,
					Computed:    true,
					Sensitive:   true,
				},
				"passphrase": {
					Description: "Passphrase to access PGP signing key",
					Type:        schema.TypeString,
					Computed:    true,
					Sensitive:   true,
				},
			},
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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