diff --git a/go.mod b/go.mod index db7886f9..5581e3a1 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-plugin-go v0.14.3 // indirect github.com/hashicorp/terraform-registry-address v0.1.0 // indirect - github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/terraform-svchost v0.1.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/go.sum b/go.sum index 1de45dea..ef8237ee 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,9 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/ github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw= github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= -github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/terraform-svchost v0.1.0 h1:0+RcgZdZYNd81Vw7tu62g9JiLLvbOigp7QtyNh6CjXk= +github.com/hashicorp/terraform-svchost v0.1.0/go.mod h1:ut8JaH0vumgdCfJaihdcZULqkAwHdQNwNH7taIDdsZM= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= diff --git a/vendor/github.com/hashicorp/terraform-svchost/CHANGELOG.md b/vendor/github.com/hashicorp/terraform-svchost/CHANGELOG.md new file mode 100644 index 00000000..45ae2bc1 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/CHANGELOG.md @@ -0,0 +1,9 @@ +## v0.1.0 + +#### Features: + +- Adds hostname `Alias` method to service discovery, making it possible to interpret one hostname as another. + +## v0.0.1 + +Initial release diff --git a/vendor/github.com/hashicorp/terraform-svchost/CONTRIBUTING.md b/vendor/github.com/hashicorp/terraform-svchost/CONTRIBUTING.md new file mode 100644 index 00000000..c12e3bb4 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing to the svchost library + +If you find an issue or would like to add a feature, please add an issue in GitHub. We welcome your contributions - fork the repo and submit a pull request. diff --git a/vendor/github.com/hashicorp/terraform-svchost/LICENSE b/vendor/github.com/hashicorp/terraform-svchost/LICENSE index 82b4de97..342bbb5b 100644 --- a/vendor/github.com/hashicorp/terraform-svchost/LICENSE +++ b/vendor/github.com/hashicorp/terraform-svchost/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2019 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/terraform-svchost/README.md b/vendor/github.com/hashicorp/terraform-svchost/README.md new file mode 100644 index 00000000..3a12f013 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/README.md @@ -0,0 +1,9 @@ +# terraform-svchost + +[![CI Tests](https://github.com/hashicorp/terraform-svchost/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hashicorp/terraform-svchost/actions/workflows/ci.yml) +[![GitHub license](https://img.shields.io/github/license/hashicorp/terraform-svchost.svg)](https://github.com/hashicorp/terraform-svchost/blob/main/LICENSE) +[![GoDoc](https://godoc.org/github.com/hashicorp/terraform-svchost?status.svg)](https://godoc.org/github.com/hashicorp/terraform-svchost) +[![Go Report Card](https://goreportcard.com/badge/github.com/hashicorp/terraform-svchost)](https://goreportcard.com/report/github.com/hashicorp/terraform-svchost) +[![GitHub issues](https://img.shields.io/github/issues/hashicorp/terraform-svchost.svg)](https://github.com/hashicorp/terraform-svchost/issues) + +This package provides friendly hostnames, and is used by [terraform](https://github.com/hashicorp/terraform). diff --git a/vendor/github.com/hashicorp/terraform-svchost/svchost.go b/vendor/github.com/hashicorp/terraform-svchost/svchost.go index 4060b767..22f6338b 100644 --- a/vendor/github.com/hashicorp/terraform-svchost/svchost.go +++ b/vendor/github.com/hashicorp/terraform-svchost/svchost.go @@ -101,6 +101,18 @@ func ForComparison(given string) (Hostname, error) { var err error portPortion, err = normalizePortPortion(portPortion) if err != nil { + // We can get in here if someone has incorrectly specified a URL + // instead of a hostname, because normalizePortPortion will try to + // treat the colon after the scheme as the port number separator. + // We'll return a more specific error message for that situation. + given = strings.ToLower(given) + if given == "https" || given == "http" { + // Technically it's valid to have a host called "https" or "http" + // which would generate a false positive here with input like + // "http:foo", but we can only get here if the hostname exactly + // matches one of the schemes _and_ the port number is also invalid. + return Hostname(""), fmt.Errorf("need just a hostname and optional port number, not a full URL") + } return Hostname(""), err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 742cd485..2bed8d38 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -121,8 +121,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2/terraform # github.com/hashicorp/terraform-registry-address v0.1.0 ## explicit; go 1.14 github.com/hashicorp/terraform-registry-address -# github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 -## explicit; go 1.12 +# github.com/hashicorp/terraform-svchost v0.1.0 +## explicit; go 1.19 github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.1.1 ## explicit; go 1.15