diff --git a/go.mod b/go.mod index 721d6054de..56a5483291 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( go.opentelemetry.io/otel v1.47.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.28.0 - goa.design/goa/v3 v3.35.0 + goa.design/goa/v3 v3.36.0 golang.org/x/crypto v0.59.0 golang.org/x/term v0.48.0 golang.org/x/text v0.44.0 @@ -172,10 +172,10 @@ require ( go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect + go.yaml.in/yaml/v3 v3.0.6 // indirect golang.org/x/crypto/openpgp v0.1.0-deprecated // indirect golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect - golang.org/x/net v0.62.0 // indirect + golang.org/x/net v0.63.0 // indirect golang.org/x/oauth2 v0.37.0 // indirect golang.org/x/sync v0.25.0 // indirect golang.org/x/sys v0.50.0 // indirect @@ -183,7 +183,7 @@ require ( golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260817212433-ac3dfec99bb1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20261123191846-1e707ab9fbc2 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 0725e6cf1e..b2b7c7ce74 100644 --- a/go.sum +++ b/go.sum @@ -537,10 +537,10 @@ go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= -go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -goa.design/goa/v3 v3.35.0 h1:IADQAhQfboqIDlLA1JTwwLIeWJDnDf5I1wrSGkrY0Yc= -goa.design/goa/v3 v3.35.0/go.mod h1:PKFE4NGYknvCYA2hKzbTqJ9Xvd5FUY15pz9jjqHCwy4= +go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM= +go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +goa.design/goa/v3 v3.36.0 h1:RjusJeMAT/nfB6PwnPFaUuWr7DhhLB0kgBpHPZ/ZgDg= +goa.design/goa/v3 v3.36.0/go.mod h1:bbgAkS/u3NS9Cc4WsYPXvfebbvvVoa9sqhXHfRuA0xU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= @@ -555,8 +555,8 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -565,8 +565,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= -golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0= +golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= @@ -613,8 +613,8 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= +golang.org/x/tools v0.53.0 h1:T3bIVp3zjHG9/aEiFk6BXxFh5/Vcbk7JA5hRq1cG8IU= +golang.org/x/tools v0.53.0/go.mod h1:vg+Vrb7y5mTTtxZLTdbTK8G745wcaLcsCtgCWgQONCI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -635,8 +635,8 @@ google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d h1:C9v1o0/4quuhOAf google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d/go.mod h1:Wz2wFJntZFmLGo7pLDXZ3wYk5hyc0Mb+SkHhDDXT+lU= google.golang.org/genproto/googleapis/api v0.0.0-20260817212433-ac3dfec99bb1 h1:lrupDmKL3p5kEX1M92oan027eCKcouzjuPbH6YBK+Rs= google.golang.org/genproto/googleapis/api v0.0.0-20260817212433-ac3dfec99bb1/go.mod h1:q/3oV3jAi5vwelxsVAprMBC8BcM2zmNe+IjRGd+9/ks= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b h1:6WNWHZk91dp4gZ25642OALkuG1UVNZbwENJD19DnB8k= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261123191846-1e707ab9fbc2 h1:FCWn4wv5of/ooWpbWDIeOXqI3+h2MGnV7SvvcJ8f+bQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20261123191846-1e707ab9fbc2/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= diff --git a/vendor/go.yaml.in/yaml/v3/resolve.go b/vendor/go.yaml.in/yaml/v3/resolve.go index 64ae888057..d47f50e64f 100644 --- a/vendor/go.yaml.in/yaml/v3/resolve.go +++ b/vendor/go.yaml.in/yaml/v3/resolve.go @@ -42,6 +42,7 @@ func init() { for _, c := range "yYnNtTfFoO~" { t[int(c)] = 'M' // In map } + t[int('<')] = 'M' // In map (merge key "<<") t[int('.')] = '.' // Float (potentially in map) var resolveMapList = []struct { diff --git a/vendor/goa.design/goa/v3/pkg/uri_reference.go b/vendor/goa.design/goa/v3/pkg/uri_reference.go new file mode 100644 index 0000000000..4d476a7a90 --- /dev/null +++ b/vendor/goa.design/goa/v3/pkg/uri_reference.go @@ -0,0 +1,181 @@ +package goa + +import ( + "fmt" + "net/netip" + "strings" +) + +// validateURIReference returns an error if val is not an RFC 3986 +// URI-reference. It splits val into components as described in RFC 3986 +// Appendix B and checks each component against its ABNF rule, including +// pct-encoded triplets, IP-literal hosts, and the restriction that the first +// segment of a relative path reference may not contain a colon. The empty +// string is a valid (same-document) reference. +func validateURIReference(val string) error { + rest := val + if i := strings.IndexByte(rest, '#'); i >= 0 { + if err := validateURIComponent("fragment", rest[i+1:], ":@/?"); err != nil { + return err + } + rest = rest[:i] + } + if i := strings.IndexByte(rest, '?'); i >= 0 { + if err := validateURIComponent("query", rest[i+1:], ":@/?"); err != nil { + return err + } + rest = rest[:i] + } + // A colon before the first slash can only end a scheme: path-noscheme + // forbids colons in the first segment of a relative reference. + if i := strings.IndexByte(rest, ':'); i >= 0 && !strings.Contains(rest[:i], "/") { + if err := validateURIScheme(rest[:i]); err != nil { + return err + } + rest = rest[i+1:] + } + if authority, ok := strings.CutPrefix(rest, "//"); ok { + i := strings.IndexByte(authority, '/') + if i < 0 { + i = len(authority) + } + if err := validateURIAuthority(authority[:i]); err != nil { + return err + } + rest = authority[i:] + } + return validateURIComponent("path", rest, ":@/") +} + +// validateURIScheme checks scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ). +func validateURIScheme(scheme string) error { + if scheme == "" || !isURIAlpha(scheme[0]) { + return fmt.Errorf("invalid scheme %q: must start with a letter", scheme) + } + for i := 1; i < len(scheme); i++ { + c := scheme[i] + if !isURIAlpha(c) && !isURIDigit(c) && c != '+' && c != '-' && c != '.' { + return fmt.Errorf("invalid character %q in scheme", c) + } + } + return nil +} + +// validateURIAuthority checks authority = [ userinfo "@" ] host [ ":" port ]. +func validateURIAuthority(authority string) error { + hostport := authority + if userinfo, rest, ok := strings.Cut(authority, "@"); ok { + if err := validateURIComponent("userinfo", userinfo, ":"); err != nil { + return err + } + hostport = rest + } + var port string + if literal, ok := strings.CutPrefix(hostport, "["); ok { + host, rest, ok := strings.Cut(literal, "]") + if !ok { + return fmt.Errorf("missing ']' in host %q", hostport) + } + if err := validateURIIPLiteral(host); err != nil { + return err + } + if rest != "" { + p, ok := strings.CutPrefix(rest, ":") + if !ok { + return fmt.Errorf("unexpected %q after IP literal", rest) + } + port = p + } + } else { + host, p, _ := strings.Cut(hostport, ":") + if err := validateURIComponent("host", host, ""); err != nil { + return err + } + port = p + } + for i := 0; i < len(port); i++ { + if !isURIDigit(port[i]) { + return fmt.Errorf("invalid port %q", port) + } + } + return nil +} + +// validateURIIPLiteral checks the content of IP-literal = "[" ( IPv6address / +// IPvFuture ) "]" without the brackets. +func validateURIIPLiteral(host string) error { + if host != "" && (host[0] == 'v' || host[0] == 'V') { + version, address, ok := strings.Cut(host[1:], ".") + if !ok || version == "" || address == "" { + return fmt.Errorf("invalid IPvFuture host %q", host) + } + for i := 0; i < len(version); i++ { + if !isURIHex(version[i]) { + return fmt.Errorf("invalid IPvFuture version %q", version) + } + } + for i := 0; i < len(address); i++ { + c := address[i] + if !isURIUnreserved(c) && !isURISubDelim(c) && c != ':' { + return fmt.Errorf("invalid character %q in IPvFuture host", c) + } + } + return nil + } + // RFC 3986 has no zone identifiers, so reject what netip would accept. + if strings.IndexByte(host, '%') >= 0 { + return fmt.Errorf("invalid IPv6 host %q", host) + } + addr, err := netip.ParseAddr(host) + if err != nil { + return fmt.Errorf("invalid IPv6 host %q: %w", host, err) + } + if !addr.Is6() { + return fmt.Errorf("invalid IPv6 host %q", host) + } + return nil +} + +// validateURIComponent checks that every byte of s is an unreserved character, +// a sub-delim, a byte listed in extra, or the start of a pct-encoded triplet. +func validateURIComponent(component, s, extra string) error { + for i := 0; i < len(s); i++ { + c := s[i] + if c == '%' { + if i+2 >= len(s) || !isURIHex(s[i+1]) || !isURIHex(s[i+2]) { + return fmt.Errorf("invalid percent-encoding in %s %q", component, s) + } + i += 2 + continue + } + if !isURIUnreserved(c) && !isURISubDelim(c) && strings.IndexByte(extra, c) < 0 { + return fmt.Errorf("invalid character %q in %s", c, component) + } + } + return nil +} + +// isURIUnreserved reports whether c is an RFC 3986 unreserved character. +func isURIUnreserved(c byte) bool { + return isURIAlpha(c) || isURIDigit(c) || c == '-' || c == '.' || c == '_' || c == '~' +} + +// isURISubDelim reports whether c is an RFC 3986 sub-delims character. +func isURISubDelim(c byte) bool { + return strings.IndexByte("!$&'()*+,;=", c) >= 0 +} + +// isURIAlpha reports whether c is an ASCII letter. +func isURIAlpha(c byte) bool { + return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' +} + +// isURIDigit reports whether c is an ASCII digit. +func isURIDigit(c byte) bool { + return '0' <= c && c <= '9' +} + +// isURIHex reports whether c is an ASCII hexadecimal digit. +func isURIHex(c byte) bool { + return isURIDigit(c) || 'a' <= c && c <= 'f' || 'A' <= c && c <= 'F' +} diff --git a/vendor/goa.design/goa/v3/pkg/validation.go b/vendor/goa.design/goa/v3/pkg/validation.go index 36926827c6..3ccbf15c84 100644 --- a/vendor/goa.design/goa/v3/pkg/validation.go +++ b/vendor/goa.design/goa/v3/pkg/validation.go @@ -9,6 +9,7 @@ import ( "regexp" "sync" "time" + "unicode/utf8" googleuuid "github.com/google/uuid" ) @@ -29,7 +30,7 @@ const ( // FormatEmail describes RFC5322 email addresses. FormatEmail = "email" - // FormatHostname describes RFC1035 Internet hostnames. + // FormatHostname describes RFC1123 Internet hostnames. FormatHostname = "hostname" // FormatIPv4 describes RFC2373 IPv4 address values. @@ -44,6 +45,10 @@ const ( // FormatURI describes RFC3986 URI values. FormatURI = "uri" + // FormatURIReference describes RFC3986 URI-reference values: either a URI or + // a relative reference such as "/users/123", "../a", "?q=1" or "#frag". + FormatURIReference = "uri-reference" + // FormatMAC describes IEEE 802 MAC-48, EUI-48 or EUI-64 MAC address values. FormatMAC = "mac" @@ -58,13 +63,18 @@ const ( // FormatRFC1123 describes RFC1123 date time values. FormatRFC1123 = "rfc1123" -) -var ( - hostnameRegex = regexp.MustCompile(`^[[:alnum:]][[:alnum:]\-]{0,61}[[:alnum:]]|[[:alpha:]]$`) - ipv4Regex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) + // maxHostnameLength is the maximum presentation length of an Internet + // hostname without a trailing root dot (RFC 1035 section 2.3.4). + maxHostnameLength = 253 + + // maxHostnameLabelLength is the maximum length of a single dot-separated + // hostname label (RFC 1035 section 2.3.4). + maxHostnameLabelLength = 63 ) +var ipv4Regex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) + // ValidateFormat validates val against f. It returns nil if the string conforms // to the format, an error otherwise. name is the name of the variable used in // error messages. where in a data structure the error occurred if any. The @@ -75,9 +85,11 @@ var ( // - "date": RFC3339 date value // - "date-time": RFC3339 date time value // - "email": RFC5322 email address -// - "hostname": RFC1035 Internet host name +// - "hostname": RFC1123 Internet host name // - "ipv4", "ipv6", "ip": RFC2673 and RFC2373 IP address values // - "uri": RFC3986 URI value +// - "uri-reference": RFC3986 URI-reference value (URI or relative reference); +// the empty string is a valid reference // - "mac": IEEE 802 MAC-48, EUI-48 or EUI-64 MAC address value // - "cidr": RFC4632 and RFC4291 CIDR notation IP address value // - "regexp": Regular expression syntax accepted by RE2 @@ -94,10 +106,7 @@ func ValidateFormat(name string, val string, f Format) error { case FormatEmail: _, err = mail.ParseAddress(val) case FormatHostname: - if !hostnameRegex.MatchString(val) { - err = fmt.Errorf("hostname value '%s' does not match %s", - val, hostnameRegex.String()) - } + err = validateHostname(val) case FormatIPv4, FormatIPv6, FormatIP: ip := net.ParseIP(val) if ip == nil { @@ -115,6 +124,8 @@ func ValidateFormat(name string, val string, f Format) error { } case FormatURI: _, err = url.ParseRequestURI(val) + case FormatURIReference: + err = validateURIReference(val) case FormatMAC: _, err = net.ParseMAC(val) case FormatCIDR: @@ -180,3 +191,66 @@ func validateUUID(uuid string) error { return nil } + +// validateHostname enforces RFC 1123 section 2.1 syntax on presentation-form +// Internet hostnames (1..253 ASCII bytes, dot-separated 1..63-byte LDH labels +// with no leading or trailing dots or hyphens) and RFC 3696 section 2's rule +// that the rightmost label is not all-numeric. +func validateHostname(val string) error { + if len(val) == 0 { + return fmt.Errorf("hostname cannot be empty") + } + if len(val) > maxHostnameLength { + return fmt.Errorf("hostname exceeds %d characters", maxHostnameLength) + } + labelLen := 0 + labelNonNumeric := false + prev := byte('.') + for i := 0; i < len(val); i++ { + c := val[i] + switch { + case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': + labelLen++ + labelNonNumeric = true + case '0' <= c && c <= '9': + labelLen++ + case c == '-': + if prev == '.' { + return fmt.Errorf("hostname label cannot start with '-'") + } + labelLen++ + labelNonNumeric = true + case c == '.': + if prev == '.' { + return fmt.Errorf("hostname cannot contain empty label") + } + if prev == '-' { + return fmt.Errorf("hostname label cannot end with '-'") + } + labelLen = 0 + labelNonNumeric = false + prev = c + continue + default: + r, width := utf8.DecodeRuneInString(val[i:]) + if r == utf8.RuneError && width == 1 { + return fmt.Errorf("hostname contains non-ASCII byte 0x%02x", c) + } + return fmt.Errorf("hostname contains invalid character %q", r) + } + if labelLen > maxHostnameLabelLength { + return fmt.Errorf("hostname label exceeds %d characters", maxHostnameLabelLength) + } + prev = c + } + if prev == '.' { + return fmt.Errorf("hostname cannot end with '.'") + } + if prev == '-' { + return fmt.Errorf("hostname label cannot end with '-'") + } + if !labelNonNumeric { + return fmt.Errorf("hostname top-level label cannot be all-numeric") + } + return nil +} diff --git a/vendor/goa.design/goa/v3/pkg/version.go b/vendor/goa.design/goa/v3/pkg/version.go index 15dd656fd7..bd289389a2 100644 --- a/vendor/goa.design/goa/v3/pkg/version.go +++ b/vendor/goa.design/goa/v3/pkg/version.go @@ -10,7 +10,7 @@ const ( // Major version number Major = 3 // Minor version number - Minor = 35 + Minor = 36 // Build number Build = 0 // Suffix - set to empty string in release tag commits. diff --git a/vendor/golang.org/x/net/http2/transport_wrap.go b/vendor/golang.org/x/net/http2/transport_wrap.go index eeaa95f03c..002cb50564 100644 --- a/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/vendor/golang.org/x/net/http2/transport_wrap.go @@ -58,6 +58,12 @@ func (t transportConfig) Registered(t1 *http.Transport) { t.t.lazyt1 = t1 } +// GetClientConnStateFunc is called to provide us with a function +// which may be used to fetch additional state from a ClientConn. +func (t transportConfig) GetClientConnStateFunc(f func(*http.ClientConn) any) { + t.t.getCCState = f +} + func (t transportConfig) DisableCompression() bool { return t.t.DisableCompression } @@ -129,8 +135,9 @@ func (t transportConfig) DialFromContext(ctx context.Context, network, address s } type transportInternal struct { - initOnce sync.Once - lazyt1 *http.Transport + initOnce sync.Once + lazyt1 *http.Transport + getCCState func(*http.ClientConn) any dialMu sync.Mutex dials map[string]*transportDialState @@ -525,10 +532,32 @@ func (cc *ClientConn) state() ClientConnState { cc.mu.Lock() defer cc.mu.Unlock() cc.updateStateLocked() + var gotStats bool + var streamsActive int + if cc.tr.getCCState != nil { + stats, ok := cc.tr.getCCState(cc.cc).(interface { + StreamsActive() int + MaxConcurrentStreams() int + }) + if ok { + gotStats = true + streamsActive = stats.StreamsActive() + cc.maxConcurrent = stats.MaxConcurrentStreams() + } + } + if !gotStats { + streamsActive = cc.cc.InFlight() - cc.reserved + if !cc.closed { + // This is slightly racy (a request could start or finish in between + // the Available and InFlight calls), but the best we can do given that + // the net/http ClientConn API doesn't expose the conn's max concurrency. + cc.maxConcurrent = cc.cc.Available() + cc.cc.InFlight() + } + } return ClientConnState{ Closed: cc.closed, Closing: cc.closing, - StreamsActive: cc.cc.InFlight() - cc.reserved, + StreamsActive: streamsActive, StreamsReserved: cc.reserved, StreamsPending: cc.pending, MaxConcurrentStreams: uint32(min(int64(cc.maxConcurrent), math.MaxUint32)), @@ -556,12 +585,6 @@ func (cc *ClientConn) updateStateLocked() { if cc.cc.InFlight() == 0 && cc.roundTrips > 0 && cc.starting == 0 { cc.lastIdle = time.Now() } - if !cc.closed { - // This is slightly racy (a request could start or finish in between - // the Available and InFlight calls), but the best we can do given that - // the net/http ClientConn API doesn't expose the conn's max concurrency. - cc.maxConcurrent = cc.cc.Available() + cc.cc.InFlight() - } if cc.shutdownc != nil && cc.cc.InFlight()+cc.starting == 0 { close(cc.shutdownc) cc.shutdownc = nil diff --git a/vendor/modules.txt b/vendor/modules.txt index 035bbfca16..4969aa2ada 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -868,10 +868,10 @@ go.uber.org/zap/zaptest # go.yaml.in/yaml/v2 v2.4.4 ## explicit; go 1.15 go.yaml.in/yaml/v2 -# go.yaml.in/yaml/v3 v3.0.5 +# go.yaml.in/yaml/v3 v3.0.6 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# goa.design/goa/v3 v3.35.0 +# goa.design/goa/v3 v3.36.0 ## explicit; go 1.27.3 goa.design/goa/v3/http goa.design/goa/v3/pkg @@ -889,7 +889,7 @@ golang.org/x/crypto/scrypt # golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 ## explicit; go 1.25.0 golang.org/x/exp/slices -# golang.org/x/net v0.62.0 +# golang.org/x/net v0.63.0 ## explicit; go 1.26.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -960,7 +960,7 @@ google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b +# google.golang.org/genproto/googleapis/rpc v0.0.0-20261123191846-1e707ab9fbc2 ## explicit; go 1.26.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status