expErrStr:"Error parsing IP template on controller public cluster addr: unable to parse address template \"{{ somethingthatdoesntexist }}\": unable to parse template \"{{ somethingthatdoesntexist }}\": template: sockaddr.Parse:1: function \"somethingthatdoesntexist\" not defined",
Issuer:"https://2000:0005::0001]",// missing '[' after https://
Subject:"valid-account-ipv6-iss",
},
},
},
},
res:nil,
err:handlers.ApiErrorWithCodeAndMessage(codes.InvalidArgument,`Error: "Error in provided request.", Details: {{name:"attributes.issuer",desc:"Cannot be parsed as a url. parse \"https://2000:0005::0001]\": invalid port \":0001]\" after host"}}`),
badFields[globals.AttributesAddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
badFields[globals.AttributesAddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
badFields[globals.AddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
badFields[globals.AddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
badFields[globals.AddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
badFields[globals.AddressField]=fmt.Sprintf("Address length must be between %d and %d characters.",static.MinHostAddressLength,static.MaxHostAddressLength)
// Verify it is a set updated after it was created
// TODO: This is currently failing.
assert.True(gotUpdateTime.After(hCreated),"Updated target should have been updated after it's creation. Was updated %v, which is after %v",gotUpdateTime,hCreated)
// Clear all values which are hard to compare against.
// ErrInvalidAddressContainsPort is returned when an address input contains
// a port.
ErrInvalidAddressContainsPort=errors.New("address contains a port")
)
// This regular expression is used to find all instances of square brackets within a string.
// This regular expression is used to remove the square brackets from an IPv6 address.
varsquareBrackets=regexp.MustCompile("\\[|\\]")
@ -31,18 +66,69 @@ func JoinHostPort(host, port string) string {
returnnet.JoinHostPort(host,port)
}
// SplitHostPort splits a network address of the form "host:port", "host%zone:port", "[host]:port" or "[host%zone]:port" into host or host%zone and port.
// SplitHostPort splits a network address of the form "host:port",
// "host%zone:port", "[host]:port" or "[host%zone]:port" into separate "host" or
// "host%zone" and "port". It differs from its standard library counterpart in
// the following ways:
// - If the input is an IP address (with no port), this function will return
// that IP as the `host`, empty `port`, and ErrMissingPort.
// - If the input is just a host (with no port), this function will return
// that host as the `host`, empty `port`, and ErrMissingPort.
//
// A literal IPv6 address in hostport must be enclosed in square brackets, as in "[::1]:80", "[::1%lo0]:80".
// These changes enable inputs like "ip_address" or "host" and allows callers to
// detect whether any given `hostport` contains a port or is just a host/IP.