Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -172,18 +172,18 @@ 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
golang.org/x/time v0.15.0 // indirect
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
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down
1 change: 1 addition & 0 deletions vendor/go.yaml.in/yaml/v3/resolve.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

181 changes: 181 additions & 0 deletions vendor/goa.design/goa/v3/pkg/uri_reference.go
Original file line number Diff line number Diff line change
@@ -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'
}
Loading
Loading