diff --git a/Makefile b/Makefile index 34b9bb750b..c84057b78b 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,8 @@ protobuf: cp -r bazel-bin/pkg/proto/*/*/go_default_library_/github.com/scionproto/scion/pkg/proto/* pkg/proto chmod 0644 pkg/proto/*/*.pb.go pkg/proto/*/*/*.pb.go + bazel run @buf//:buf -- generate --output $(PWD) --path proto + mocks: bazel run //tools:gomocks diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000000..a428ba999f --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,309 @@ +workspace( + name = "com_github_scionproto_scion", +) + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") + +# linter rules +http_archive( + name = "apple_rules_lint", + sha256 = "8feab4b08a958b10cb2abb7f516652cd770b582b36af6477884b3bba1f2f0726", + strip_prefix = "apple_rules_lint-0.1.1", + urls = [ + "https://github.com/apple/apple_rules_lint/archive/0.1.1.zip", + ], +) + +load("@apple_rules_lint//lint:repositories.bzl", "lint_deps") + +lint_deps() + +load("@apple_rules_lint//lint:setup.bzl", "lint_setup") + +# Add your linters here. +lint_setup({ + "go": "//:go_lint_config", + "flake8": "//:flake8_lint_config", +}) + +http_archive( + name = "aspect_bazel_lib", + sha256 = "a185ccff9c1b8589c63f66d7eb908de15c5d6bb05562be5f46336c53e7a7326a", + strip_prefix = "bazel-lib-2.0.0-rc1", + url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.0.0-rc1/bazel-lib-v2.0.0-rc1.tar.gz", +) + +load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "aspect_bazel_lib_register_toolchains") + +# Required bazel-lib dependencies + +aspect_bazel_lib_dependencies() + +# Register bazel-lib toolchains + +aspect_bazel_lib_register_toolchains() + +# Bazel rules for Golang +http_archive( + name = "io_bazel_rules_go", + sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip", + ], +) + +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_register_toolchains( + nogo = "@//:nogo", + version = "1.21.3", +) + +# Gazelle +http_archive( + name = "bazel_gazelle", + sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz", + ], +) + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") + +go_rules_dependencies() + +load("//:tool_deps.bzl", "tool_deps") + +tool_deps() + +# gazelle:repository_macro go_deps.bzl%go_deps +load("//:go_deps.bzl", "go_deps") + +go_deps() + +gazelle_dependencies() + +# XXX Needs to be before rules_docker +# Python rules +http_archive( + name = "rules_python", + sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", + strip_prefix = "rules_python-0.26.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", +) + +load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") + +py_repositories() + +python_register_toolchains( + name = "python3_10", + python_version = "3.10", +) + +load("@python3_10//:defs.bzl", "interpreter") +load("//tools/env/pip3:deps.bzl", "python_deps") + +python_deps(interpreter) + +load("@com_github_scionproto_scion_python_deps//:requirements.bzl", install_python_deps = "install_deps") + +install_python_deps() + +http_archive( + name = "rules_pkg", + sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", + ], +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +# Antlr rules +http_archive( + name = "rules_antlr", + # XXX(roosd): This hash is not guaranteed to be stable by GitHub. + # See: https://github.blog/changelog/2023-01-30-git-archive-checksums-may-change + sha256 = "8d7c457cc266965bdcf7e85aa349d2f851b772a55877354d9ae92ada7a62c857", + strip_prefix = "rules_antlr-0.6.0", + urls = ["https://github.com/bacek/rules_antlr/archive/refs/tags/0.6.0.tar.gz"], +) + +load("@rules_antlr//antlr:repositories.bzl", "rules_antlr_dependencies") + +rules_antlr_dependencies("4.9.3") + +http_archive( + name = "io_bazel_rules_docker", + sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", + urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"], +) + +load("@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories") + +container_repositories() + +load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") + +container_deps() + +load("@io_bazel_rules_docker//go:image.bzl", _go_image_repos = "repositories") + +_go_image_repos() + +http_archive( + name = "rules_deb_packages", + sha256 = "674ce7b66c345aaa9ab898608618a0a0db857cbed8e8d0794ca46e375fd5ff76", + urls = ["https://github.com/petermylemans/rules_deb_packages/releases/download/v0.4.0/rules_deb_packages.tar.gz"], +) + +load("@rules_deb_packages//:repositories.bzl", "deb_packages_dependencies") + +deb_packages_dependencies() + +load("@rules_deb_packages//:deb_packages.bzl", "deb_packages") + +deb_packages( + name = "debian_buster_amd64", + arch = "amd64", + packages = { + "libc6": "pool/main/g/glibc/libc6_2.28-10_amd64.deb", + "libcap2": "pool/main/libc/libcap2/libcap2_2.25-2_amd64.deb", + "libcap2-bin": "pool/main/libc/libcap2/libcap2-bin_2.25-2_amd64.deb", + }, + packages_sha256 = { + "libc6": "6f703e27185f594f8633159d00180ea1df12d84f152261b6e88af75667195a79", + "libcap2": "8f93459c99e9143dfb458353336c5171276860896fd3e10060a515cd3ea3987b", + "libcap2-bin": "3c8c5b1410447356125fd8f5af36d0c28853b97c072037af4a1250421008b781", + }, + sources = [ + "http://deb.debian.org/debian buster main", + "http://deb.debian.org/debian buster-updates main", + "http://deb.debian.org/debian-security buster/updates main", + ], + timestamp = "20210812T060609Z", + urls = [ + "http://deb.debian.org/debian/$(package_path)", + "http://deb.debian.org/debian-security/$(package_path)", + "https://snapshot.debian.org/archive/debian/$(timestamp)/$(package_path)", # Needed in case of supersed archive no more available on the mirrors + "https://snapshot.debian.org/archive/debian-security/$(timestamp)/$(package_path)", # Needed in case of supersed archive no more available on the mirrors + ], +) + +load("@io_bazel_rules_docker//container:container.bzl", "container_pull") + +container_pull( + name = "static_debian10", + digest = "sha256:4433370ec2b3b97b338674b4de5ffaef8ce5a38d1c9c0cb82403304b8718cde9", + registry = "gcr.io", + repository = "distroless/static-debian10", +) + +container_pull( + name = "debug_debian10", + digest = "sha256:72d496b69d121960b98ac7078cbacd7678f1941844b90b5e1cac337b91309d9d", + registry = "gcr.io", + repository = "distroless/base-debian10", +) + +container_pull( + name = "debian10", + digest = "sha256:60cb30babcd1740309903c37d3d408407d190cf73015aeddec9086ef3f393a5d", + registry = "index.docker.io", + repository = "library/debian", + tag = "10", +) + +# Buf CLI to generate connect-go +http_archive( + name = "buf", + build_file_content = "exports_files([\"buf\"])", + strip_prefix = "buf/bin", + urls = ["https://github.com/bufbuild/buf/releases/download/v1.28.1/buf-Linux-x86_64.tar.gz"], +) + +# protobuf/gRPC +http_archive( + name = "rules_proto_grpc", + sha256 = "9ba7299c5eb6ec45b6b9a0ceb9916d0ab96789ac8218269322f0124c0c0d24e2", + strip_prefix = "rules_proto_grpc-4.5.0", + urls = ["https://github.com/rules-proto-grpc/rules_proto_grpc/releases/download/4.5.0/rules_proto_grpc-4.5.0.tar.gz"], +) + +load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_repos", "rules_proto_grpc_toolchains") + +rules_proto_grpc_toolchains() + +rules_proto_grpc_repos() + +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +rules_proto_dependencies() + +rules_proto_toolchains() + +load("@rules_proto_grpc//buf:repositories.bzl", rules_proto_grpc_buf_repos = "buf_repos") + +rules_proto_grpc_buf_repos() + +http_archive( + name = "com_github_bazelbuild_buildtools", + strip_prefix = "buildtools-6.3.3", + urls = [ + "https://github.com/bazelbuild/buildtools/archive/refs/tags/6.3.3.tar.gz", + ], +) + +http_file( + name = "buf_bin", + downloaded_file_path = "buf", + executable = True, + sha256 = "5faf15ed0a3cd4bd0919ba5fcb95334c1fd2ba32770df289d615138fa188d36a", + urls = [ + "https://github.com/bufbuild/buf/releases/download/v0.20.5/buf-Linux-x86_64", + ], +) + +load("//tools/lint/python:deps.bzl", "python_lint_deps") + +python_lint_deps(interpreter) + +load("@com_github_scionproto_scion_python_lint_deps//:requirements.bzl", install_python_lint_deps = "install_deps") + +install_python_lint_deps() + +http_archive( + name = "aspect_rules_js", + sha256 = "a949d56fed8fa0a8dd82a0a660acc949253a05b2b0c52a07e4034e27f11218f6", + strip_prefix = "rules_js-1.33.1", + url = "https://github.com/aspect-build/rules_js/releases/download/v1.33.1/rules_js-v1.33.1.tar.gz", +) + +load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") + +rules_js_dependencies() + +load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") + +nodejs_register_toolchains( + name = "nodejs", + node_version = DEFAULT_NODE_VERSION, +) + +load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock") + +npm_translate_lock( + name = "npm", + pnpm_lock = "@com_github_scionproto_scion//private/mgmtapi/tools:pnpm-lock.yaml", + verify_node_modules_ignored = "@com_github_scionproto_scion//:.bazelignore", +) + +load("@npm//:repositories.bzl", "npm_repositories") + +npm_repositories() diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000000..6859c773b7 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - plugin: connect-go + out: pkg + opt: paths=source_relative diff --git a/control/beaconing/connect/BUILD.bazel b/control/beaconing/connect/BUILD.bazel new file mode 100644 index 0000000000..760103e6ff --- /dev/null +++ b/control/beaconing/connect/BUILD.bazel @@ -0,0 +1,24 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "sender.go", + "server.go", + ], + importpath = "github.com/scionproto/scion/control/beaconing/connect", + visibility = ["//visibility:public"], + deps = [ + "//control/beaconing:go_default_library", + "//control/beaconing/grpc:go_default_library", + "//control/onehop:go_default_library", + "//pkg/addr:go_default_library", + "//pkg/connect:go_default_library", + "//pkg/proto/control_plane:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", + "//pkg/segment:go_default_library", + "//pkg/snet/squic:go_default_library", + "@com_connectrpc_connect//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", + ], +) diff --git a/control/beaconing/connect/sender.go b/control/beaconing/connect/sender.go new file mode 100644 index 0000000000..73d7f8516d --- /dev/null +++ b/control/beaconing/connect/sender.go @@ -0,0 +1,92 @@ +package connect + +import ( + "context" + "net" + + "connectrpc.com/connect" + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/control/beaconing" + "github.com/scionproto/scion/control/onehop" + "github.com/scionproto/scion/pkg/addr" + libconnect "github.com/scionproto/scion/pkg/connect" + control_plane "github.com/scionproto/scion/pkg/proto/control_plane" + "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" + seg "github.com/scionproto/scion/pkg/segment" + "github.com/scionproto/scion/pkg/snet/squic" +) + +type BeaconSenderFactory struct { + Dialer libconnect.Dialer +} + +func (f *BeaconSenderFactory) NewSender( + ctx context.Context, + dstIA addr.IA, + egIfId uint16, + nextHop *net.UDPAddr, +) (beaconing.Sender, error) { + addr := &onehop.Addr{ + IA: dstIA, + Egress: egIfId, + SVC: addr.SvcCS, + NextHop: nextHop, + } + dialer := f.Dialer(addr) + return &BeaconSender{ + Addr: "https://" + addr.SVC.BaseString(), + Client: &libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + }, nil + +} + +type BeaconSender struct { + Addr string + Client *libconnect.HTTPClient +} + +func (s BeaconSender) Send(ctx context.Context, b *seg.PathSegment) error { + client := control_planeconnect.NewSegmentCreationServiceClient(s.Client, s.Addr) + _, err := client.Beacon(ctx, connect.NewRequest(&control_plane.BeaconRequest{ + Segment: seg.PathSegmentToPB(b), + })) + return err +} + +// Close closes the BeaconSender and releases all underlying resources. +func (s BeaconSender) Close() error { + return s.Client.RoundTripper.Close() +} + +// Registrar registers segments. +type Registrar struct { + Dialer libconnect.Dialer +} + +// RegisterSegment registers a segment with the remote. +func (r Registrar) RegisterSegment(ctx context.Context, meta seg.Meta, remote net.Addr) error { + peer := make(chan net.Addr, 1) + dialer := r.Dialer(remote, squic.WithPeerChannel(peer)) + client := control_planeconnect.NewSegmentRegistrationServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(remote), + ) + _, err := client.SegmentsRegistration(ctx, connect.NewRequest(&control_plane.SegmentsRegistrationRequest{ + Segments: map[int32]*control_plane.SegmentsRegistrationRequest_Segments{ + int32(meta.Type): { + Segments: []*control_plane.PathSegment{ + seg.PathSegmentToPB(meta.Segment), + }, + }, + }, + })) + return err +} diff --git a/control/beaconing/connect/server.go b/control/beaconing/connect/server.go new file mode 100644 index 0000000000..c0114fc652 --- /dev/null +++ b/control/beaconing/connect/server.go @@ -0,0 +1,21 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/scionproto/scion/control/beaconing/grpc" + "github.com/scionproto/scion/pkg/proto/control_plane" +) + +type SegmentCreationServer struct { + *grpc.SegmentCreationServer +} + +func (s SegmentCreationServer) Beacon(ctx context.Context, req *connect.Request[control_plane.BeaconRequest]) (*connect.Response[control_plane.BeaconResponse], error) { + rep, err := s.SegmentCreationServer.Beacon(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/control/beaconing/grpc/creation_server.go b/control/beaconing/grpc/creation_server.go index 0cf49e414f..70d7305f66 100644 --- a/control/beaconing/grpc/creation_server.go +++ b/control/beaconing/grpc/creation_server.go @@ -45,6 +45,8 @@ type SegmentCreationServer struct { func (s SegmentCreationServer) Beacon(ctx context.Context, req *cppb.BeaconRequest) (*cppb.BeaconResponse, error) { + // Need to patch https://github.com/quic-go/quic-go/blob/9414ea49100d5cf75a2044d85a6becf3985171db/http3/server.go#L578C19-L578C36 + // to get the peer address into the context. gPeer, ok := peer.FromContext(ctx) if !ok { return nil, serrors.New("peer must exist") diff --git a/control/beaconing/happy/BUILD.bazel b/control/beaconing/happy/BUILD.bazel new file mode 100644 index 0000000000..1794168482 --- /dev/null +++ b/control/beaconing/happy/BUILD.bazel @@ -0,0 +1,15 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["sender.go"], + importpath = "github.com/scionproto/scion/control/beaconing/happy", + visibility = ["//visibility:public"], + deps = [ + "//control/beaconing:go_default_library", + "//pkg/addr:go_default_library", + "//pkg/connect/happy:go_default_library", + "//pkg/private/serrors:go_default_library", + "//pkg/segment:go_default_library", + ], +) diff --git a/control/beaconing/happy/sender.go b/control/beaconing/happy/sender.go new file mode 100644 index 0000000000..f3906b9820 --- /dev/null +++ b/control/beaconing/happy/sender.go @@ -0,0 +1,96 @@ +package happy + +import ( + "context" + "net" + + "github.com/scionproto/scion/control/beaconing" + "github.com/scionproto/scion/pkg/addr" + "github.com/scionproto/scion/pkg/connect/happy" + "github.com/scionproto/scion/pkg/private/serrors" + seg "github.com/scionproto/scion/pkg/segment" +) + +// BeaconSenderFactory can be used to create beacon senders. +type BeaconSenderFactory struct { + Connect beaconing.SenderFactory + Grpc beaconing.SenderFactory +} + +// NewSender returns a beacon sender that can be used to send beacons to a remote CS. +func (f *BeaconSenderFactory) NewSender( + ctx context.Context, + dstIA addr.IA, + egIfId uint16, + nextHop *net.UDPAddr, +) (beaconing.Sender, error) { + connectSender, err := f.Connect.NewSender(ctx, dstIA, egIfId, nextHop) + if err != nil { + return nil, err + } + grpcSender, err := f.Grpc.NewSender(ctx, dstIA, egIfId, nextHop) + if err != nil { + return nil, err + } + return BeaconSender{ + Connect: connectSender, + Grpc: grpcSender, + }, nil +} + +type BeaconSender struct { + Connect beaconing.Sender + Grpc beaconing.Sender +} + +func (s BeaconSender) Send(ctx context.Context, b *seg.PathSegment) error { + _, err := happy.Happy( + ctx, + happy.Call1[*seg.PathSegment, struct{}]{ + Call: happy.NoReturn1[*seg.PathSegment](s.Connect.Send).Call, + Input1: b, + Typ: "control_plane.v1.SegmentCreationService.Beacon", + }, + happy.Call1[*seg.PathSegment, struct{}]{ + Call: happy.NoReturn1[*seg.PathSegment](s.Connect.Send).Call, + Input1: b, + Typ: "control_plane.v1.SegmentCreationService.Beacon", + }, + ) + return err +} + +func (s BeaconSender) Close() error { + var errs serrors.List + if err := s.Connect.Close(); err != nil { + errs = append(errs, err) + } + if err := s.Grpc.Close(); err != nil { + errs = append(errs, err) + } + return errs.ToError() +} + +type Registrar struct { + Connect beaconing.RPC + Grpc beaconing.RPC +} + +func (r *Registrar) RegisterSegment(ctx context.Context, meta seg.Meta, remote net.Addr) error { + _, err := happy.Happy( + ctx, + happy.Call2[seg.Meta, net.Addr, struct{}]{ + Call: happy.NoReturn2[seg.Meta, net.Addr](r.Connect.RegisterSegment).Call, + Input1: meta, + Input2: remote, + Typ: "control_plane.v1.SegmentRegistrationService.SegmentsRegistration", + }, + happy.Call2[seg.Meta, net.Addr, struct{}]{ + Call: happy.NoReturn2[seg.Meta, net.Addr](r.Connect.RegisterSegment).Call, + Input1: meta, + Input2: remote, + Typ: "control_plane.v1.SegmentRegistrationService.SegmentsRegistration", + }, + ) + return err +} diff --git a/control/cmd/control/BUILD.bazel b/control/cmd/control/BUILD.bazel index cedf57d3eb..281fefa23c 100644 --- a/control/cmd/control/BUILD.bazel +++ b/control/cmd/control/BUILD.bazel @@ -13,31 +13,40 @@ go_library( "//control:go_default_library", "//control/beacon:go_default_library", "//control/beaconing:go_default_library", + "//control/beaconing/connect:go_default_library", "//control/beaconing/grpc:go_default_library", + "//control/beaconing/happy:go_default_library", "//control/config:go_default_library", "//control/drkey:go_default_library", "//control/drkey/grpc:go_default_library", "//control/ifstate:go_default_library", "//control/mgmtapi:go_default_library", "//control/onehop:go_default_library", + "//control/segreg/connect:go_default_library", "//control/segreg/grpc:go_default_library", "//control/segreq:go_default_library", + "//control/segreq/connect:go_default_library", "//control/segreq/grpc:go_default_library", "//control/trust:go_default_library", + "//control/trust/connect:go_default_library", "//control/trust/grpc:go_default_library", "//control/trust/metrics:go_default_library", "//pkg/addr:go_default_library", + "//pkg/connect:go_default_library", "//pkg/grpc:go_default_library", "//pkg/log:go_default_library", "//pkg/metrics:go_default_library", "//pkg/private/prom:go_default_library", "//pkg/private/serrors:go_default_library", "//pkg/proto/control_plane:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", "//pkg/proto/discovery:go_default_library", + "//pkg/proto/discovery/v1/discoveryconnect:go_default_library", "//pkg/scrypto:go_default_library", "//pkg/scrypto/cppki:go_default_library", "//pkg/segment/iface:go_default_library", "//pkg/snet:go_default_library", + "//pkg/snet/squic:go_default_library", "//private/app:go_default_library", "//private/app/appnet:go_default_library", "//private/app/command:go_default_library", @@ -45,15 +54,19 @@ go_library( "//private/ca/api:go_default_library", "//private/ca/config:go_default_library", "//private/ca/renewal:go_default_library", + "//private/ca/renewal/connect:go_default_library", "//private/ca/renewal/grpc:go_default_library", "//private/discovery:go_default_library", + "//private/discovery/connect:go_default_library", "//private/drkey/drkeyutil:go_default_library", "//private/keyconf:go_default_library", "//private/mgmtapi/cppki/api:go_default_library", "//private/mgmtapi/jwtauth:go_default_library", "//private/mgmtapi/segments/api:go_default_library", "//private/periodic:go_default_library", + "//private/segment/segfetcher/connect:go_default_library", "//private/segment/segfetcher/grpc:go_default_library", + "//private/segment/segfetcher/happy:go_default_library", "//private/segment/seghandler:go_default_library", "//private/service:go_default_library", "//private/storage:go_default_library", @@ -66,16 +79,20 @@ go_library( "//private/topology:go_default_library", "//private/trust:go_default_library", "//private/trust/compat:go_default_library", + "//private/trust/connect:go_default_library", "//private/trust/grpc:go_default_library", + "//private/trust/happy:go_default_library", "//private/trust/metrics:go_default_library", "@com_github_go_chi_chi_v5//:go_default_library", "@com_github_go_chi_cors//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_prometheus//:go_default_library", + "@com_github_quic_go_quic_go//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", "@com_github_spf13_cobra//:go_default_library", "@in_gopkg_yaml_v2//:go_default_library", "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//health:go_default_library", - "@org_golang_google_grpc//health/grpc_health_v1:go_default_library", + "@org_golang_x_net//http2:go_default_library", + "@org_golang_x_net//http2/h2c:go_default_library", "@org_golang_x_sync//errgroup:go_default_library", ], ) diff --git a/control/cmd/control/main.go b/control/cmd/control/main.go index f228d829e7..a4a09f8f7b 100644 --- a/control/cmd/control/main.go +++ b/control/cmd/control/main.go @@ -16,6 +16,7 @@ package main import ( "context" + "crypto/tls" "crypto/x509" "encoding/json" "errors" @@ -27,43 +28,56 @@ import ( "sync" "time" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" + "github.com/go-chi/chi/v5" "github.com/go-chi/cors" promgrpc "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/quic-go/quic-go" + "github.com/quic-go/quic-go/http3" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" "google.golang.org/grpc" - "google.golang.org/grpc/health" - healthpb "google.golang.org/grpc/health/grpc_health_v1" cs "github.com/scionproto/scion/control" "github.com/scionproto/scion/control/beacon" "github.com/scionproto/scion/control/beaconing" + "github.com/scionproto/scion/control/beaconing/connect" + beaconingconnect "github.com/scionproto/scion/control/beaconing/connect" beaconinggrpc "github.com/scionproto/scion/control/beaconing/grpc" + "github.com/scionproto/scion/control/beaconing/happy" "github.com/scionproto/scion/control/config" "github.com/scionproto/scion/control/drkey" drkeygrpc "github.com/scionproto/scion/control/drkey/grpc" "github.com/scionproto/scion/control/ifstate" api "github.com/scionproto/scion/control/mgmtapi" "github.com/scionproto/scion/control/onehop" + segregconnect "github.com/scionproto/scion/control/segreg/connect" segreggrpc "github.com/scionproto/scion/control/segreg/grpc" "github.com/scionproto/scion/control/segreq" + segreqconnect "github.com/scionproto/scion/control/segreq/connect" segreqgrpc "github.com/scionproto/scion/control/segreq/grpc" cstrust "github.com/scionproto/scion/control/trust" + cstrustconnect "github.com/scionproto/scion/control/trust/connect" cstrustgrpc "github.com/scionproto/scion/control/trust/grpc" cstrustmetrics "github.com/scionproto/scion/control/trust/metrics" "github.com/scionproto/scion/pkg/addr" + libconnect "github.com/scionproto/scion/pkg/connect" libgrpc "github.com/scionproto/scion/pkg/grpc" "github.com/scionproto/scion/pkg/log" libmetrics "github.com/scionproto/scion/pkg/metrics" "github.com/scionproto/scion/pkg/private/prom" "github.com/scionproto/scion/pkg/private/serrors" cppb "github.com/scionproto/scion/pkg/proto/control_plane" + cpconnect "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" dpb "github.com/scionproto/scion/pkg/proto/discovery" + dconnect "github.com/scionproto/scion/pkg/proto/discovery/v1/discoveryconnect" "github.com/scionproto/scion/pkg/scrypto" "github.com/scionproto/scion/pkg/scrypto/cppki" "github.com/scionproto/scion/pkg/segment/iface" "github.com/scionproto/scion/pkg/snet" + "github.com/scionproto/scion/pkg/snet/squic" "github.com/scionproto/scion/private/app" infraenv "github.com/scionproto/scion/private/app/appnet" "github.com/scionproto/scion/private/app/command" @@ -71,15 +85,19 @@ import ( caapi "github.com/scionproto/scion/private/ca/api" caconfig "github.com/scionproto/scion/private/ca/config" "github.com/scionproto/scion/private/ca/renewal" + renewalconnect "github.com/scionproto/scion/private/ca/renewal/connect" renewalgrpc "github.com/scionproto/scion/private/ca/renewal/grpc" "github.com/scionproto/scion/private/discovery" + discoveryconnect "github.com/scionproto/scion/private/discovery/connect" "github.com/scionproto/scion/private/drkey/drkeyutil" "github.com/scionproto/scion/private/keyconf" cppkiapi "github.com/scionproto/scion/private/mgmtapi/cppki/api" "github.com/scionproto/scion/private/mgmtapi/jwtauth" segapi "github.com/scionproto/scion/private/mgmtapi/segments/api" "github.com/scionproto/scion/private/periodic" + segfetcherconnect "github.com/scionproto/scion/private/segment/segfetcher/connect" segfetchergrpc "github.com/scionproto/scion/private/segment/segfetcher/grpc" + segfetcherhappy "github.com/scionproto/scion/private/segment/segfetcher/happy" "github.com/scionproto/scion/private/segment/seghandler" "github.com/scionproto/scion/private/service" "github.com/scionproto/scion/private/storage" @@ -92,7 +110,9 @@ import ( "github.com/scionproto/scion/private/topology" "github.com/scionproto/scion/private/trust" "github.com/scionproto/scion/private/trust/compat" + trustconnect "github.com/scionproto/scion/private/trust/connect" trustgrpc "github.com/scionproto/scion/private/trust/grpc" + trusthappy "github.com/scionproto/scion/private/trust/happy" trustmetrics "github.com/scionproto/scion/private/trust/metrics" ) @@ -228,10 +248,14 @@ func realMain(ctx context.Context) error { if err != nil { return serrors.Wrap("initializing QUIC stack", err) } +<<<<<<< HEAD tcpStack, err := nc.TCPStack() if err != nil { return serrors.Wrap("initializing TCP stack", err) } +======= + defer quicStack.RedirectCloser() +>>>>>>> 244e9b483 (THE GRAND MERGE) dialer := &libgrpc.QUICDialer{ Rewriter: &onehop.AddressRewriter{ Rewriter: nc.AddressRewriter(), @@ -278,10 +302,20 @@ func realMain(ctx context.Context) error { } provider := trust.FetchingProvider{ DB: trustDB, - Fetcher: trustgrpc.Fetcher{ - IA: topo.IA(), - Dialer: dialer, - Requests: libmetrics.NewPromCounter(trustmetrics.RPC.Fetches), + Fetcher: trusthappy.Fetcher{ + Connect: trustconnect.Fetcher{ + IA: topo.IA(), + Dialer: (&squic.EarlyDialerFactory{ + Transport: quicStack.InsecureDialer.Transport, + TLSConfig: libconnect.AdaptTLS(quicStack.InsecureDialer.TLSConfig), + Rewriter: dialer.Rewriter, + }).NewDialer, + }, + Grpc: trustgrpc.Fetcher{ + IA: topo.IA(), + Dialer: dialer, + Requests: libmetrics.NewPromCounter(trustmetrics.RPC.Fetches), + }, }, Recurser: trust.ASLocalRecurser{IA: topo.IA()}, // XXX(roosd): cyclic dependency on router. It is set below. @@ -302,8 +336,21 @@ func realMain(ctx context.Context) error { PathDB: pathDB, RevCache: revCache, QueryInterval: globalCfg.PS.QueryInterval.Duration, - RPC: &segfetchergrpc.Requester{ - Dialer: dialer, + RPC: &segfetcherhappy.Requester{ + Connect: &segfetcherconnect.Requester{ + Dialer: (&squic.EarlyDialerFactory{ + Transport: quicStack.InsecureDialer.Transport, + TLSConfig: func() *tls.Config { + cfg := quicStack.InsecureDialer.TLSConfig.Clone() + cfg.NextProtos = []string{"h3", "SCION"} + return cfg + }(), + Rewriter: dialer.Rewriter, + }).NewDialer, + }, + Grpc: &segfetchergrpc.Requester{ + Dialer: dialer, + }, }, Inspector: inspector, Verifier: verifier, @@ -319,10 +366,8 @@ func realMain(ctx context.Context) error { libgrpc.UnaryServerInterceptor(), libgrpc.DefaultMaxConcurrentStreams(), ) - tcpServer := grpc.NewServer( - libgrpc.UnaryServerInterceptor(), - libgrpc.DefaultMaxConcurrentStreams(), - ) + connectInter := http.NewServeMux() + connectIntra := http.NewServeMux() // Register trust material related handlers. trustServer := &cstrustgrpc.MaterialServer{ @@ -331,10 +376,11 @@ func realMain(ctx context.Context) error { Requests: libmetrics.NewPromCounter(cstrustmetrics.Handler.Requests), } cppb.RegisterTrustMaterialServiceServer(quicServer, trustServer) - cppb.RegisterTrustMaterialServiceServer(tcpServer, trustServer) + connectInter.Handle(cpconnect.NewTrustMaterialServiceHandler(cstrustconnect.MaterialServer{MaterialServer: trustServer})) + connectIntra.Handle(cpconnect.NewTrustMaterialServiceHandler(cstrustconnect.MaterialServer{MaterialServer: trustServer})) // Handle beaconing. - cppb.RegisterSegmentCreationServiceServer(quicServer, &beaconinggrpc.SegmentCreationServer{ + segmentCreationServer := &beaconinggrpc.SegmentCreationServer{ Handler: &beaconing.Handler{ LocalIA: topo.IA(), Inserter: beaconStore, @@ -342,7 +388,13 @@ func realMain(ctx context.Context) error { Verifier: verifier, BeaconsHandled: libmetrics.NewPromCounter(metrics.BeaconingReceivedTotal), }, - }) + } + cppb.RegisterSegmentCreationServiceServer(quicServer, segmentCreationServer) + connectInter.Handle( + cpconnect.NewSegmentCreationServiceHandler(beaconingconnect.SegmentCreationServer{ + SegmentCreationServer: segmentCreationServer, + }), + ) // Handle segment lookup authLookupServer := &segreqgrpc.LookupServer{ @@ -373,14 +425,15 @@ func realMain(ctx context.Context) error { } // Always register a forwarding lookup for AS internal requests. - cppb.RegisterSegmentLookupServiceServer(tcpServer, forwardingLookupServer) + connectIntra.Handle(cpconnect.NewSegmentLookupServiceHandler(segreqconnect.LookupServer{LookupServer: forwardingLookupServer})) if topo.Core() { cppb.RegisterSegmentLookupServiceServer(quicServer, authLookupServer) + connectInter.Handle(cpconnect.NewSegmentLookupServiceHandler(segreqconnect.LookupServer{LookupServer: authLookupServer})) } // Handle segment registration. if topo.Core() { - cppb.RegisterSegmentRegistrationServiceServer(quicServer, &segreggrpc.RegistrationServer{ + registrationServer := &segreggrpc.RegistrationServer{ LocalIA: topo.IA(), SegHandler: seghandler.Handler{ Verifier: &seghandler.DefaultVerifier{ @@ -392,7 +445,13 @@ func realMain(ctx context.Context) error { }, }, Registrations: libmetrics.NewPromCounter(metrics.SegmentRegistrationsTotal), +<<<<<<< HEAD }) +======= + } + cppb.RegisterSegmentRegistrationServiceServer(quicServer, registrationServer) + connectInter.Handle(cpconnect.NewSegmentRegistrationServiceHandler(segregconnect.RegistrationServer{RegistrationServer: registrationServer})) +>>>>>>> 244e9b483 (THE GRAND MERGE) } ctxSigner, cancel := context.WithTimeout(ctx, time.Second) @@ -517,7 +576,8 @@ func realMain(ctx context.Context) error { } cppb.RegisterChainRenewalServiceServer(quicServer, renewalServer) - cppb.RegisterChainRenewalServiceServer(tcpServer, renewalServer) + connectInter.Handle(cpconnect.NewChainRenewalServiceHandler(renewalconnect.RenewalServer{RenewalServer: renewalServer})) + connectIntra.Handle(cpconnect.NewChainRenewalServiceHandler(renewalconnect.RenewalServer{RenewalServer: renewalServer})) } // Frequently regenerate signers to catch problems, and update the metrics. @@ -573,19 +633,22 @@ func realMain(ctx context.Context) error { Requests: libmetrics.NewPromCounter(metrics.DiscoveryRequestsTotal), } dpb.RegisterDiscoveryServiceServer(quicServer, ds) + connectInter.Handle( + dconnect.NewDiscoveryServiceHandler(discoveryconnect.Topology{Topology: ds}), + ) - dsHealth := health.NewServer() - dsHealth.SetServingStatus("discovery", healthpb.HealthCheckResponse_SERVING) - healthpb.RegisterHealthServer(tcpServer, dsHealth) + // dsHealth := health.NewServer() + // dsHealth.SetServingStatus("discovery", healthpb.HealthCheckResponse_SERVING) + // healthpb.RegisterHealthServer(tcpServer, dsHealth) hpCfg := cs.HiddenPathConfigurator{ - LocalIA: topo.IA(), - Verifier: verifier, - Signer: signer, - PathDB: pathDB, - Dialer: dialer, - FetcherConfig: fetcherCfg, - IntraASTCPServer: tcpServer, + LocalIA: topo.IA(), + Verifier: verifier, + Signer: signer, + PathDB: pathDB, + Dialer: dialer, + FetcherConfig: fetcherCfg, + //IntraASTCPServer: tcpServer, InterASQUICServer: quicServer, } hpWriterCfg, err := hpCfg.Setup(globalCfg.PS.HiddenPathsCfg) @@ -664,32 +727,94 @@ func realMain(ctx context.Context) error { AllowedSVHostProto: globalCfg.DRKey.Delegation.ToAllowedSet(), } cppb.RegisterDRKeyInterServiceServer(quicServer, drkeyService) - cppb.RegisterDRKeyIntraServiceServer(tcpServer, drkeyService) + //cppb.RegisterDRKeyIntraServiceServer(tcpServer, drkeyService) log.Info("DRKey is enabled") } else { log.Info("DRKey is DISABLED by configuration") } promgrpc.Register(quicServer) - promgrpc.Register(tcpServer) + // TODO prom middleware + //promgrpc.Register(tcpServer) var cleanup app.Cleanup + connectServer := http3.Server{ + Handler: libconnect.AttachPeer(connectInter), + } + + grpcConns := make(chan quic.Connection) g.Go(func() error { defer log.HandlePanic() +<<<<<<< HEAD if err := quicServer.Serve(quicStack.Listener); err != nil { return serrors.Wrap("serving gRPC/QUIC API", err) +======= + // TODO can be generic function, demux mux by next proto + listener := quicStack.Listener + for { + conn, err := listener.Accept(context.Background()) + if err == quic.ErrServerClosed { + return http.ErrServerClosed + } + if err != nil { + return err + } + go func() { + defer log.HandlePanic() + fmt.Println("protocol", conn.ConnectionState().TLS.NegotiatedProtocol) + if conn.ConnectionState().TLS.NegotiatedProtocol == "h3" { + if err := connectServer.ServeQUICConn(conn); err != nil { + log.Debug(err.Error()) + } + } else { + fmt.Println("<- conn") + grpcConns <- conn + fmt.Println("<- conn ok") + } + }() +>>>>>>> 244e9b483 (THE GRAND MERGE) + } + }) + + g.Go(func() error { + defer log.HandlePanic() + grpcListener := squic.NewConnListener(grpcConns, quicStack.Listener.Addr()) + fmt.Println("serving gRPC") + if err := quicServer.Serve(grpcListener); err != nil { + panic(err) + //return serrors.WrapStr("serving gRPC/TCP API", err) } + fmt.Println("whwwwwat?") return nil }) cleanup.Add(func() error { quicServer.GracefulStop(); return nil }) + + intraServer := http.Server{ + Handler: h2c.NewHandler(libconnect.AttachPeer(connectIntra), &http2.Server{}), + } g.Go(func() error { defer log.HandlePanic() +<<<<<<< HEAD if err := tcpServer.Serve(tcpStack); err != nil { return serrors.Wrap("serving gRPC/TCP API", err) +======= + tcpListener, err := nc.TCPStack() + if err != nil { + return serrors.WrapStr("initializing TCP stack", err) + } + if err := intraServer.Serve(tcpListener); err != nil { + return serrors.WrapStr("serving connect/TCP API", err) +>>>>>>> 244e9b483 (THE GRAND MERGE) } return nil }) - cleanup.Add(func() error { tcpServer.GracefulStop(); return nil }) + cleanup.Add(func() error { + // TODO: add cleanup.AddCtx ? + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + intraServer.Shutdown(ctx) + return nil + }) if globalCfg.API.Addr != "" { r := chi.NewRouter() @@ -782,9 +907,23 @@ func realMain(ctx context.Context) error { TrustDB: trustDB, PathDB: pathDB, RevCache: revCache, - BeaconSenderFactory: &beaconinggrpc.BeaconSenderFactory{ - Dialer: dialer, + BeaconSenderFactory: &happy.BeaconSenderFactory{ + Connect: &connect.BeaconSenderFactory{ + Dialer: (&squic.EarlyDialerFactory{ + Transport: quicStack.InsecureDialer.Transport, + TLSConfig: func() *tls.Config { + cfg := quicStack.InsecureDialer.TLSConfig.Clone() + cfg.NextProtos = []string{"h3", "SCION"} + return cfg + }(), + Rewriter: dialer.Rewriter, + }).NewDialer, + }, + Grpc: &beaconinggrpc.BeaconSenderFactory{ + Dialer: dialer, + }, }, +<<<<<<< HEAD SegmentRegister: beaconinggrpc.Registrar{Dialer: dialer}, BeaconStore: beaconStore, SignerGen: beaconing.SignerGenFunc(func(ctx context.Context) ([]beaconing.Signer, error) { @@ -801,6 +940,24 @@ func realMain(ctx context.Context) error { } return r, nil }), +======= + SegmentRegister: &happy.Registrar{ + Connect: beaconingconnect.Registrar{ + Dialer: (&squic.EarlyDialerFactory{ + Transport: quicStack.InsecureDialer.Transport, + TLSConfig: func() *tls.Config { + cfg := quicStack.InsecureDialer.TLSConfig.Clone() + cfg.NextProtos = []string{"h3", "SCION"} + return cfg + }(), + Rewriter: dialer.Rewriter, + }).NewDialer, + }, + Grpc: beaconinggrpc.Registrar{Dialer: dialer}, + }, + BeaconStore: beaconStore, + SignerGen: signer.SignerGen, +>>>>>>> 244e9b483 (THE GRAND MERGE) Inspector: inspector, Metrics: metrics, DRKeyEngine: drkeyEngine, diff --git a/control/segreg/connect/BUILD.bazel b/control/segreg/connect/BUILD.bazel new file mode 100644 index 0000000000..2b29c740f4 --- /dev/null +++ b/control/segreg/connect/BUILD.bazel @@ -0,0 +1,13 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["server.go"], + importpath = "github.com/scionproto/scion/control/segreg/connect", + visibility = ["//visibility:public"], + deps = [ + "//control/segreg/grpc:go_default_library", + "//pkg/proto/control_plane:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +) diff --git a/control/segreg/connect/server.go b/control/segreg/connect/server.go new file mode 100644 index 0000000000..02e01823c8 --- /dev/null +++ b/control/segreg/connect/server.go @@ -0,0 +1,21 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/scionproto/scion/control/segreg/grpc" + "github.com/scionproto/scion/pkg/proto/control_plane" +) + +type RegistrationServer struct { + *grpc.RegistrationServer +} + +func (s RegistrationServer) SegmentsRegistration(ctx context.Context, req *connect.Request[control_plane.SegmentsRegistrationRequest]) (*connect.Response[control_plane.SegmentsRegistrationResponse], error) { + rep, err := s.RegistrationServer.SegmentsRegistration(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/control/segreq/connect/BUILD.bazel b/control/segreq/connect/BUILD.bazel new file mode 100644 index 0000000000..28be25d0a4 --- /dev/null +++ b/control/segreq/connect/BUILD.bazel @@ -0,0 +1,13 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["lookup.go"], + importpath = "github.com/scionproto/scion/control/segreq/connect", + visibility = ["//visibility:public"], + deps = [ + "//control/segreq/grpc:go_default_library", + "//pkg/proto/control_plane:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +) diff --git a/control/segreq/connect/lookup.go b/control/segreq/connect/lookup.go new file mode 100644 index 0000000000..20507ccbc4 --- /dev/null +++ b/control/segreq/connect/lookup.go @@ -0,0 +1,21 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/scionproto/scion/control/segreq/grpc" + "github.com/scionproto/scion/pkg/proto/control_plane" +) + +type LookupServer struct { + *grpc.LookupServer +} + +func (s LookupServer) Segments(ctx context.Context, req *connect.Request[control_plane.SegmentsRequest]) (*connect.Response[control_plane.SegmentsResponse], error) { + rep, err := s.LookupServer.Segments(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/control/trust/connect/BUILD.bazel b/control/trust/connect/BUILD.bazel new file mode 100644 index 0000000000..3c471de77f --- /dev/null +++ b/control/trust/connect/BUILD.bazel @@ -0,0 +1,14 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["material.go"], + importpath = "github.com/scionproto/scion/control/trust/connect", + visibility = ["//visibility:public"], + deps = [ + "//control/trust/grpc:go_default_library", + "//pkg/proto/control_plane:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +) diff --git a/control/trust/connect/material.go b/control/trust/connect/material.go new file mode 100644 index 0000000000..1e653c7d3d --- /dev/null +++ b/control/trust/connect/material.go @@ -0,0 +1,32 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/scionproto/scion/control/trust/grpc" + "github.com/scionproto/scion/pkg/proto/control_plane" + "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" +) + +var _ control_planeconnect.TrustMaterialServiceHandler = MaterialServer{} + +type MaterialServer struct { + *grpc.MaterialServer +} + +func (m MaterialServer) Chains(ctx context.Context, req *connect.Request[control_plane.ChainsRequest]) (*connect.Response[control_plane.ChainsResponse], error) { + rep, err := m.MaterialServer.Chains(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} + +func (m MaterialServer) TRC(ctx context.Context, req *connect.Request[control_plane.TRCRequest]) (*connect.Response[control_plane.TRCResponse], error) { + rep, err := m.MaterialServer.TRC(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/gateway/BUILD.bazel b/gateway/BUILD.bazel index 74c479bc74..06ca571659 100644 --- a/gateway/BUILD.bazel +++ b/gateway/BUILD.bazel @@ -14,7 +14,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//gateway/control:go_default_library", + "//gateway/control/connect:go_default_library", "//gateway/control/grpc:go_default_library", + "//gateway/control/happy:go_default_library", "//gateway/dataplane:go_default_library", "//gateway/pathhealth:go_default_library", "//gateway/pathhealth/policies:go_default_library", @@ -22,6 +24,7 @@ go_library( "//gateway/routing:go_default_library", "//gateway/xnet:go_default_library", "//pkg/addr:go_default_library", + "//pkg/connect:go_default_library", "//pkg/daemon:go_default_library", "//pkg/grpc:go_default_library", "//pkg/log:go_default_library", @@ -30,6 +33,7 @@ go_library( "//pkg/private/serrors:go_default_library", "//pkg/private/util:go_default_library", "//pkg/proto/gateway:go_default_library", + "//pkg/proto/gateway/v1/gatewayconnect:go_default_library", "//pkg/snet:go_default_library", "//pkg/snet/metrics:go_default_library", "//pkg/snet/squic:go_default_library", @@ -41,6 +45,7 @@ go_library( "@com_github_prometheus_client_golang//prometheus:go_default_library", "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_quic_go_quic_go//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/gateway/control/connect/BUILD.bazel b/gateway/control/connect/BUILD.bazel new file mode 100644 index 0000000000..5a1aa82817 --- /dev/null +++ b/gateway/control/connect/BUILD.bazel @@ -0,0 +1,26 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "discoverer.go", + "prefix_fetcher.go", + "prefix_server.go", + ], + importpath = "github.com/scionproto/scion/gateway/control/connect", + visibility = ["//visibility:public"], + deps = [ + "//gateway/control:go_default_library", + "//gateway/control/grpc:go_default_library", + "//pkg/addr:go_default_library", + "//pkg/connect:go_default_library", + "//pkg/private/serrors:go_default_library", + "//pkg/proto/discovery:go_default_library", + "//pkg/proto/discovery/v1/discoveryconnect:go_default_library", + "//pkg/proto/gateway:go_default_library", + "//pkg/proto/gateway/v1/gatewayconnect:go_default_library", + "//pkg/snet:go_default_library", + "@com_connectrpc_connect//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", + ], +) diff --git a/gateway/control/connect/discoverer.go b/gateway/control/connect/discoverer.go new file mode 100644 index 0000000000..96ff1b3c54 --- /dev/null +++ b/gateway/control/connect/discoverer.go @@ -0,0 +1,55 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/gateway/control" + "github.com/scionproto/scion/gateway/control/grpc" + "github.com/scionproto/scion/pkg/addr" + libconnect "github.com/scionproto/scion/pkg/connect" + "github.com/scionproto/scion/pkg/private/serrors" + dpb "github.com/scionproto/scion/pkg/proto/discovery" + "github.com/scionproto/scion/pkg/proto/discovery/v1/discoveryconnect" + "github.com/scionproto/scion/pkg/snet" +) + +// Discoverer discovers the gateways for a specific remote AS. +type Discoverer struct { + // Remote is the ISD-AS of the remote AS. + Remote addr.IA + // Dialer dials a new QUIC connection. + Dialer libconnect.Dialer + // Paths is a registration for the paths to the remote AS. + Paths control.PathMonitorRegistration +} + +func (d Discoverer) Gateways(ctx context.Context) ([]control.Gateway, error) { + paths := d.Paths.Get().Paths + if len(paths) == 0 { + return nil, serrors.New("no path available") + } + ds := &snet.SVCAddr{ + IA: d.Remote, + Path: paths[0].Dataplane(), + NextHop: paths[0].UnderlayNextHop(), + SVC: addr.SvcDS, + } + + dialer := d.Dialer(ds) + client := discoveryconnect.NewDiscoveryServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(ds), + ) + + rep, err := client.Gateways(ctx, connect.NewRequest(&dpb.GatewaysRequest{})) + if err != nil { + return nil, serrors.WrapStr("receiving gateways", err) + } + return grpc.TransformGateways(rep.Msg.Gateways) +} diff --git a/gateway/control/connect/prefix_fetcher.go b/gateway/control/connect/prefix_fetcher.go new file mode 100644 index 0000000000..759ff6055e --- /dev/null +++ b/gateway/control/connect/prefix_fetcher.go @@ -0,0 +1,79 @@ +// Copyright 2023 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "net" + + "connectrpc.com/connect" + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/gateway/control" + "github.com/scionproto/scion/pkg/addr" + libconnect "github.com/scionproto/scion/pkg/connect" + "github.com/scionproto/scion/pkg/private/serrors" + gpb "github.com/scionproto/scion/pkg/proto/gateway" + "github.com/scionproto/scion/pkg/proto/gateway/v1/gatewayconnect" + "github.com/scionproto/scion/pkg/snet" +) + +// PrefixFetcher fetches prefixes from a gateway in a specific remote AS. +type PrefixFetcher struct { + // Remote is the ISD-AS of the remote AS. + Remote addr.IA + // Dialer dials a new QUIC connection. + Dialer libconnect.Dialer + // Paths is a registration for the paths to the remote AS. + Paths control.PathMonitorRegistration +} + +func (f PrefixFetcher) Prefixes(ctx context.Context, gateway *net.UDPAddr) ([]*net.IPNet, error) { + paths := f.Paths.Get().Paths + if len(paths) == 0 { + return nil, serrors.New("no path available") + } + remote := &snet.UDPAddr{ + IA: f.Remote, + Path: paths[0].Dataplane(), + NextHop: paths[0].UnderlayNextHop(), + Host: gateway, + } + + dialer := f.Dialer(remote) + client := gatewayconnect.NewIPPrefixesServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(remote), + ) + rep, err := client.Prefixes(ctx, connect.NewRequest(&gpb.PrefixesRequest{})) + if err != nil { + return nil, serrors.WrapStr("receiving IP prefixes", err) + } + prefixes := make([]*net.IPNet, 0, len(rep.Msg.Prefixes)) + for _, pb := range rep.Msg.Prefixes { + mask := net.CIDRMask(int(pb.Mask), len(pb.Prefix)*8) + if mask == nil { + continue + } + prefixes = append(prefixes, &net.IPNet{ + IP: pb.Prefix, + Mask: mask, + }) + } + return prefixes, nil +} diff --git a/gateway/control/connect/prefix_server.go b/gateway/control/connect/prefix_server.go new file mode 100644 index 0000000000..f1fe8e675c --- /dev/null +++ b/gateway/control/connect/prefix_server.go @@ -0,0 +1,41 @@ +// Copyright 2023 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + + "connectrpc.com/connect" + + "github.com/scionproto/scion/gateway/control/grpc" + "github.com/scionproto/scion/pkg/proto/gateway" +) + +// IPPrefixServer serves IP prefix requests. +type IPPrefixServer struct { + *grpc.IPPrefixServer +} + +func (s IPPrefixServer) Prefixes( + ctx context.Context, + req *connect.Request[gateway.PrefixesRequest], +) (*connect.Response[gateway.PrefixesResponse], error) { + + rep, err := s.IPPrefixServer.Prefixes(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/gateway/control/grpc/discoverer.go b/gateway/control/grpc/discoverer.go index f7ba9e515b..5111290aa0 100644 --- a/gateway/control/grpc/discoverer.go +++ b/gateway/control/grpc/discoverer.go @@ -54,8 +54,12 @@ func (d Discoverer) Gateways(ctx context.Context) ([]control.Gateway, error) { if err != nil { return nil, serrors.Wrap("receiving gateways", err) } - gateways := make([]control.Gateway, 0, len(rep.Gateways)) - for _, pb := range rep.Gateways { + return TransformGateways(rep.Gateways) +} + +func TransformGateways(response []*dpb.Gateway) ([]control.Gateway, error) { + gateways := make([]control.Gateway, 0, len(response)) + for _, pb := range response { ctrl, err := net.ResolveUDPAddr("udp", pb.ControlAddress) if err != nil { return nil, serrors.Wrap("parsing control address", err) diff --git a/gateway/control/happy/BUILD.bazel b/gateway/control/happy/BUILD.bazel new file mode 100644 index 0000000000..724a3f307e --- /dev/null +++ b/gateway/control/happy/BUILD.bazel @@ -0,0 +1,15 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "discoverer.go", + "prefix_fetcher.go", + ], + importpath = "github.com/scionproto/scion/gateway/control/happy", + visibility = ["//visibility:public"], + deps = [ + "//gateway/control:go_default_library", + "//pkg/connect/happy:go_default_library", + ], +) diff --git a/gateway/control/happy/discoverer.go b/gateway/control/happy/discoverer.go new file mode 100644 index 0000000000..0b557e508f --- /dev/null +++ b/gateway/control/happy/discoverer.go @@ -0,0 +1,27 @@ +package happy + +import ( + "context" + + "github.com/scionproto/scion/gateway/control" + "github.com/scionproto/scion/pkg/connect/happy" +) + +type Discoverer struct { + Connect control.Discoverer + Grpc control.Discoverer +} + +func (d Discoverer) Gateways(ctx context.Context) ([]control.Gateway, error) { + return happy.Happy( + ctx, + happy.Call0[[]control.Gateway]{ + Call: d.Connect.Gateways, + Typ: "discovery.v1.DiscoveryService.Gateways", + }, + happy.Call0[[]control.Gateway]{ + Call: d.Grpc.Gateways, + Typ: "discovery.v1.DiscoveryService.Gateways", + }, + ) +} diff --git a/gateway/control/happy/prefix_fetcher.go b/gateway/control/happy/prefix_fetcher.go new file mode 100644 index 0000000000..f7f4b62cb7 --- /dev/null +++ b/gateway/control/happy/prefix_fetcher.go @@ -0,0 +1,30 @@ +package happy + +import ( + "context" + "net" + + "github.com/scionproto/scion/gateway/control" + "github.com/scionproto/scion/pkg/connect/happy" +) + +type PrefixFetcher struct { + Connect control.SimplePrefixFetcher + Grpc control.SimplePrefixFetcher +} + +func (f PrefixFetcher) Prefixes(ctx context.Context, gateway *net.UDPAddr) ([]*net.IPNet, error) { + return happy.Happy( + ctx, + happy.Call1[*net.UDPAddr, []*net.IPNet]{ + Call: f.Connect.Prefixes, + Input1: gateway, + Typ: "gateway.v1.IPPrefixesService.Prefixes", + }, + happy.Call1[*net.UDPAddr, []*net.IPNet]{ + Call: f.Grpc.Prefixes, + Input1: gateway, + Typ: "gateway.v1.IPPrefixesService.Prefixes", + }, + ) +} diff --git a/gateway/control/watcher.go b/gateway/control/watcher.go index e55ce07da1..10df43abc6 100644 --- a/gateway/control/watcher.go +++ b/gateway/control/watcher.go @@ -307,10 +307,14 @@ type PrefixConsumer interface { // PrefixFetcher fetches the IP prefixes from a remote gateway. type PrefixFetcher interface { - Prefixes(ctx context.Context, gateway *net.UDPAddr) ([]*net.IPNet, error) + SimplePrefixFetcher Close() error } +type SimplePrefixFetcher interface { + Prefixes(ctx context.Context, gateway *net.UDPAddr) ([]*net.IPNet, error) +} + // PrefixFetcherFactory constructs a PrefixFetcher for a given remote gateway. type PrefixFetcherFactory interface { NewPrefixFetcher(ctx context.Context, gateway Gateway) PrefixFetcher diff --git a/gateway/gateway.go b/gateway/gateway.go index 06bd6a38d1..5c95687484 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -26,9 +26,11 @@ import ( "github.com/prometheus/client_golang/prometheus" quic "github.com/quic-go/quic-go" + "github.com/quic-go/quic-go/http3" "google.golang.org/grpc" "github.com/scionproto/scion/gateway/control" + controlconnect "github.com/scionproto/scion/gateway/control/connect" controlgrpc "github.com/scionproto/scion/gateway/control/grpc" "github.com/scionproto/scion/gateway/dataplane" "github.com/scionproto/scion/gateway/pathhealth" @@ -37,6 +39,7 @@ import ( "github.com/scionproto/scion/gateway/routing" "github.com/scionproto/scion/gateway/xnet" "github.com/scionproto/scion/pkg/addr" + "github.com/scionproto/scion/pkg/connect" "github.com/scionproto/scion/pkg/daemon" libgrpc "github.com/scionproto/scion/pkg/grpc" "github.com/scionproto/scion/pkg/log" @@ -44,6 +47,7 @@ import ( "github.com/scionproto/scion/pkg/private/serrors" "github.com/scionproto/scion/pkg/private/util" gatewaypb "github.com/scionproto/scion/pkg/proto/gateway" + "github.com/scionproto/scion/pkg/proto/gateway/v1/gatewayconnect" "github.com/scionproto/scion/pkg/snet" "github.com/scionproto/scion/pkg/snet/squic" infraenv "github.com/scionproto/scion/private/app/appnet" @@ -485,6 +489,23 @@ func (g *Gateway) Run(ctx context.Context) error { PacketConnMetrics: g.Metrics.SCIONPacketConnMetrics, Metrics: g.Metrics.SCIONNetworkMetrics, } + + grpcDialer := &libgrpc.QUICDialer{ + Dialer: quicClientDialer, + Rewriter: &infraenv.AddressRewriter{ + // Use the local Daemon to construct paths to the target AS. + Router: pathRouter, + // We never resolve addresses in the local AS, so pass a nil here. + SVCRouter: nil, + Resolver: &svc.Resolver{ + LocalIA: localIA, + // Reuse the network with SCMP error support. + ConnFactory: scionNetwork.Dispatcher, + LocalIP: g.ServiceDiscoveryClientIP, + }, + SVCResolutionFraction: 1.337, + }, + } remoteMonitor := &control.RemoteMonitor{ IAs: remoteIAsChannel, RemotesMonitored: rmMetric, @@ -497,6 +518,7 @@ func (g *Gateway) Run(ctx context.Context) error { Policies: &policies.Policies{ PathPolicy: control.DefaultPathPolicy, }, +<<<<<<< HEAD Dialer: &libgrpc.QUICDialer{ Dialer: quicClientDialer, Rewriter: &infraenv.AddressRewriter{ @@ -512,6 +534,14 @@ func (g *Gateway) Run(ctx context.Context) error { }, }, }, +======= + Dialer: grpcDialer, + ConnectDialer: (&squic.EarlyDialerFactory{ + Transport: quicClientDialer.Transport, + TLSConfig: connect.AdaptTLS(quicClientDialer.TLSConfig), + Rewriter: grpcDialer.Rewriter, + }).NewDialer, +>>>>>>> 244e9b483 (THE GRAND MERGE) }, } @@ -535,35 +565,66 @@ func (g *Gateway) Run(ctx context.Context) error { logger.Info("QUIC server connection initialized", "local_addr", serverConn.LocalAddr()) - internalQUICServerListener, err := quic.Listen(serverConn, ephemeralTLSConfig, nil) + internalQUICServerListener, err := quic.Listen( + serverConn, + connect.AdaptTLS(ephemeralTLSConfig), + nil, + ) if err != nil { return serrors.Wrap("unable to initializer server QUIC listener", err) } - // Wrap in net.Listener for use with gRPC - quicServerListener := squic.NewConnListener(internalQUICServerListener) var paMetric metrics.Gauge if g.Metrics != nil { paMetric = metrics.NewPromGauge(g.Metrics.PrefixesAdvertised) } - discoveryServer := grpc.NewServer( + + prefixConnect := http.NewServeMux() + prefixGrpc := grpc.NewServer( libgrpc.UnaryServerInterceptor(), libgrpc.DefaultMaxConcurrentStreams(), ) - gatewaypb.RegisterIPPrefixesServiceServer( - discoveryServer, - controlgrpc.IPPrefixServer{ - LocalIA: localIA, - Advertiser: &SelectAdvertisedRoutes{ - ConfigPublisher: configPublisher, - }, - PrefixesAdvertised: paMetric, + + prefixServer := controlgrpc.IPPrefixServer{ + LocalIA: localIA, + Advertiser: &SelectAdvertisedRoutes{ + ConfigPublisher: configPublisher, }, + PrefixesAdvertised: paMetric, + } + prefixConnect.Handle( + gatewayconnect.NewIPPrefixesServiceHandler(controlconnect.IPPrefixServer{ + IPPrefixServer: &prefixServer, + }), ) + gatewaypb.RegisterIPPrefixesServiceServer( + prefixGrpc, + prefixServer, + ) + + grpcConns := make(chan quic.Connection) + prefixConnectionDispatcher := connect.ConnectionDispatcher{ + Listener: internalQUICServerListener, + Connect: &http3.Server{Handler: connect.AttachPeer(prefixConnect)}, + Grpc: connect.QUICConnServerFunc(func(conn quic.Connection) error { + grpcConns <- conn + return nil + }), + Error: func(err error) { + logger.Debug("Failed to handle connection", "err", err) + }, + } go func() { defer log.HandlePanic() - if err := discoveryServer.Serve(quicServerListener); err != nil { + if err := prefixConnectionDispatcher.Run(ctx); err != nil { + panic(err) + } + }() + go func() { + defer log.HandlePanic() + grpcListener := squic.NewConnListener(grpcConns, internalQUICServerListener.Addr()) + if err := prefixGrpc.Serve(grpcListener); err != nil { panic(err) } }() diff --git a/gateway/watcher.go b/gateway/watcher.go index af30d13ae6..44130ac77c 100644 --- a/gateway/watcher.go +++ b/gateway/watcher.go @@ -20,9 +20,12 @@ import ( "sync" "github.com/scionproto/scion/gateway/control" + controlconnect "github.com/scionproto/scion/gateway/control/connect" controlgrpc "github.com/scionproto/scion/gateway/control/grpc" + "github.com/scionproto/scion/gateway/control/happy" "github.com/scionproto/scion/gateway/pathhealth/policies" "github.com/scionproto/scion/pkg/addr" + "github.com/scionproto/scion/pkg/connect" libgrpc "github.com/scionproto/scion/pkg/grpc" "github.com/scionproto/scion/pkg/private/serrors" ) @@ -35,34 +38,44 @@ type fetcherFactory struct { func (f fetcherFactory) NewPrefixFetcher(ctx context.Context, gateway control.Gateway) control.PrefixFetcher { - return &prefixFetcher{ - PrefixFetcher: &controlgrpc.PrefixFetcher{ - Remote: f.remote, - Dialer: f.wf.Dialer, - Pather: f.wf.PathMonitor.Register( - ctx, + pather := f.wf.PathMonitor.Register( + ctx, + f.remote, + &policies.Policies{ + PathPolicy: control.PathPolicyWithAllowedInterfaces( + f.wf.Policies.PathPolicy, f.remote, - &policies.Policies{ - PathPolicy: control.PathPolicyWithAllowedInterfaces( - f.wf.Policies.PathPolicy, - f.remote, - gateway.Interfaces, - ), - PerfPolicy: f.wf.Policies.PerfPolicy, - PathCount: f.wf.Policies.PathCount, - }, - // XXX(roosd): This potentially can lead to label value - // explosion. However, the gateway IPs are rather stable in - // practice. Conceptually, this is similar to using the remote - // ISD-AS as a label value, which we do as well. - fmt.Sprintf("prefix-watcher-%s", gateway.Control.IP), + gateway.Interfaces, ), + PerfPolicy: f.wf.Policies.PerfPolicy, + PathCount: f.wf.Policies.PathCount, + }, + // XXX(roosd): This potentially can lead to label value + // explosion. However, the gateway IPs are rather stable in + // practice. Conceptually, this is similar to using the remote + // ISD-AS as a label value, which we do as well. + fmt.Sprintf("prefix-watcher-%s", gateway.Control.IP), + ) + return &prefixFetcher{ + SimplePrefixFetcher: happy.PrefixFetcher{ + Connect: &controlconnect.PrefixFetcher{ + Remote: f.remote, + Dialer: f.wf.ConnectDialer, + Paths: pather, + }, + Grpc: &controlgrpc.PrefixFetcher{ + Remote: f.remote, + Dialer: f.wf.Dialer, + Pather: pather, + }, }, + pather: pather, } } type prefixFetcher struct { - *controlgrpc.PrefixFetcher + control.SimplePrefixFetcher + pather control.PathMonitorRegistration closedMtx sync.RWMutex closed bool @@ -75,15 +88,16 @@ func (f *prefixFetcher) Close() error { return serrors.New("already closed") } f.closed = true - f.PrefixFetcher.Pather.Close() + f.pather.Close() return nil } type WatcherFactory struct { - Dialer libgrpc.Dialer - PathMonitor control.PathMonitor - Aggregator control.PrefixConsumer - Policies *policies.Policies + Dialer libgrpc.Dialer + ConnectDialer connect.Dialer + PathMonitor control.PathMonitor + Aggregator control.PrefixConsumer + Policies *policies.Policies } func (wf *WatcherFactory) New( @@ -96,11 +110,19 @@ func (wf *WatcherFactory) New( return &watcherWrapper{ GatewayWatcher: control.GatewayWatcher{ Remote: remote, - Discoverer: controlgrpc.Discoverer{ - Remote: remote, - Dialer: wf.Dialer, - Paths: pather, + Discoverer: happy.Discoverer{ + Connect: controlconnect.Discoverer{ + Remote: remote, + Dialer: wf.ConnectDialer, + Paths: pather, + }, + Grpc: controlgrpc.Discoverer{ + Remote: remote, + Dialer: wf.Dialer, + Paths: pather, + }, }, + Template: control.PrefixWatcherConfig{ Consumer: wf.Aggregator, FetcherFactory: fetcherFactory{ diff --git a/go.mod b/go.mod index b15daeb4cc..49f70c2401 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,18 @@ module github.com/scionproto/scion go 1.24.2 require ( +<<<<<<< HEAD connectrpc.com/connect v1.18.1 github.com/antlr4-go/antlr/v4 v4.13.1 github.com/bazelbuild/rules_go v0.53.0 github.com/buildkite/go-buildkite/v4 v4.1.0 github.com/cilium/ebpf v0.18.0 +======= + connectrpc.com/connect v1.12.0 + github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9 + github.com/bazelbuild/rules_go v0.38.1 + github.com/buildkite/go-buildkite/v2 v2.9.0 +>>>>>>> 244e9b483 (THE GRAND MERGE) github.com/dchest/cmac v1.0.0 github.com/fatih/color v1.18.0 github.com/getkin/kin-openapi v0.131.0 @@ -95,6 +102,7 @@ require ( github.com/mdlayher/packet v1.1.2 // indirect github.com/mdlayher/socket v0.5.1 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect +<<<<<<< HEAD github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect @@ -104,6 +112,16 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.63.0 // indirect +======= + github.com/onsi/ginkgo/v2 v2.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/perimeterx/marshmallow v1.1.4 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/qtls-go1-20 v0.4.1 // indirect +>>>>>>> 244e9b483 (THE GRAND MERGE) github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index 04a18a6609..ec51a3c8d9 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,47 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +<<<<<<< HEAD connectrpc.com/connect v1.18.1 h1:PAg7CjSAGvscaf6YZKUefjoih5Z/qYkyaTrBW8xvYPw= connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8= +======= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +connectrpc.com/connect v1.12.0 h1:HwKdOY0lGhhoHdsza+hW55aqHEC64pYpObRNoAgn70g= +connectrpc.com/connect v1.12.0/go.mod h1:3AGaO6RRGMx5IKFfqbe3hvK1NqLosFNP2BxDYTPmNPo= +>>>>>>> 244e9b483 (THE GRAND MERGE) dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -251,6 +292,7 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +<<<<<<< HEAD github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= @@ -259,6 +301,31 @@ github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2b github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= github.com/quic-go/quic-go v0.50.1 h1:unsgjFIUqW8a2oopkY7YNONpV1gYND6Nt9hnt1PN94Q= github.com/quic-go/quic-go v0.50.1/go.mod h1:Vim6OmUvlYdwBhXP9ZVrtGmCMWa3wEqhq3NgYrI8b4E= +======= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= +github.com/quic-go/qtls-go1-20 v0.4.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= +github.com/quic-go/quic-go v0.40.0 h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw= +github.com/quic-go/quic-go v0.40.0/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +>>>>>>> 244e9b483 (THE GRAND MERGE) github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/go_deps.bzl b/go_deps.bzl new file mode 100644 index 0000000000..699c057988 --- /dev/null +++ b/go_deps.bzl @@ -0,0 +1,1827 @@ +# This file is kept in sync with go.mod using gazelle update-repos. +# Manual tweaks and gazelle directives can be applied. +# To update, run: +# +# make go_deps.bzl +# +load("@bazel_gazelle//:deps.bzl", "go_repository") + +def go_deps(): + go_repository( + name = "co_honnef_go_tools", + importpath = "honnef.co/go/tools", + sum = "h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=", + version = "v0.3.2", + ) + go_repository( + name = "com_connectrpc_connect", + importpath = "connectrpc.com/connect", + sum = "h1:HwKdOY0lGhhoHdsza+hW55aqHEC64pYpObRNoAgn70g=", + version = "v1.12.0", + ) + go_repository( + name = "com_github_alecthomas_template", + importpath = "github.com/alecthomas/template", + sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=", + version = "v0.0.0-20190718012654-fb15b899a751", + ) + go_repository( + name = "com_github_alecthomas_units", + importpath = "github.com/alecthomas/units", + sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=", + version = "v0.0.0-20190924025748-f65c72e2690d", + ) + go_repository( + name = "com_github_andybalholm_brotli", + importpath = "github.com/andybalholm/brotli", + sum = "h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_antlr_antlr4_runtime_go_antlr", + importpath = "github.com/antlr/antlr4/runtime/Go/antlr", + sum = "h1:zvkJv+9Pxm1nnEMcKnShREt4qtduHKz4iw4AB4ul0Ao=", + version = "v0.0.0-20220209173558-ad29539cd2e9", + ) + go_repository( + name = "com_github_apapsch_go_jsonmerge_v2", + importpath = "github.com/apapsch/go-jsonmerge/v2", + sum = "h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_armon_go_metrics", + importpath = "github.com/armon/go-metrics", + sum = "h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_aymerick_douceur", + importpath = "github.com/aymerick/douceur", + sum = "h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_azure_go_ansiterm", + importpath = "github.com/Azure/go-ansiterm", + sum = "h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=", + version = "v0.0.0-20210617225240-d185dfc1b5a1", + ) + go_repository( + name = "com_github_bazelbuild_rules_go", + importpath = "github.com/bazelbuild/rules_go", + sum = "h1:YGNsLhWe18Ielebav7cClP3GMwBxBE+xEArLHtmXDx8=", + version = "v0.38.1", + ) + go_repository( + name = "com_github_benbjohnson_clock", + importpath = "github.com/benbjohnson/clock", + sum = "h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_beorn7_perks", + importpath = "github.com/beorn7/perks", + sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_bmatcuk_doublestar", + importpath = "github.com/bmatcuk/doublestar", + sum = "h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTSaiQ=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_buildkite_go_buildkite_v2", + importpath = "github.com/buildkite/go-buildkite/v2", + sum = "h1:K3eQZXm6ZFphKBIndOI+TnbluA8RDg5JMpwoFxSg3sc=", + version = "v2.9.0", + ) + go_repository( + name = "com_github_burntsushi_toml", + importpath = "github.com/BurntSushi/toml", + sum = "h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_burntsushi_xgb", + importpath = "github.com/BurntSushi/xgb", + sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", + version = "v0.0.0-20160522181843-27f122750802", + ) + go_repository( + name = "com_github_bytedance_sonic", + importpath = "github.com/bytedance/sonic", + sum = "h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0=", + version = "v1.10.0-rc3", + ) + go_repository( + name = "com_github_cenkalti_backoff", + importpath = "github.com/cenkalti/backoff", + sum = "h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=", + version = "v2.2.1+incompatible", + ) + go_repository( + name = "com_github_census_instrumentation_opencensus_proto", + importpath = "github.com/census-instrumentation/opencensus-proto", + sum = "h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=", + version = "v0.4.1", + ) + go_repository( + name = "com_github_cespare_xxhash_v2", + importpath = "github.com/cespare/xxhash/v2", + sum = "h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=", + version = "v2.2.0", + ) + go_repository( + name = "com_github_chenzhuoyu_base64x", + importpath = "github.com/chenzhuoyu/base64x", + sum = "h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=", + version = "v0.0.0-20230717121745-296ad89f973d", + ) + go_repository( + name = "com_github_chenzhuoyu_iasm", + importpath = "github.com/chenzhuoyu/iasm", + sum = "h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_chzyer_logex", + importpath = "github.com/chzyer/logex", + sum = "h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=", + version = "v1.1.10", + ) + go_repository( + name = "com_github_chzyer_readline", + importpath = "github.com/chzyer/readline", + sum = "h1:lSwwFrbNviGePhkewF1az4oLmcwqCZijQ2/Wi3BGHAI=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_chzyer_test", + importpath = "github.com/chzyer/test", + sum = "h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=", + version = "v0.0.0-20180213035817-a1ea475d72b1", + ) + go_repository( + name = "com_github_client9_misspell", + importpath = "github.com/client9/misspell", + sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", + version = "v0.3.4", + ) + go_repository( + name = "com_github_cloudykit_fastprinter", + importpath = "github.com/CloudyKit/fastprinter", + sum = "h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=", + version = "v0.0.0-20200109182630-33d98a066a53", + ) + go_repository( + name = "com_github_cloudykit_jet_v6", + importpath = "github.com/CloudyKit/jet/v6", + sum = "h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME=", + version = "v6.2.0", + ) + go_repository( + name = "com_github_cncf_udpa_go", + importpath = "github.com/cncf/udpa/go", + sum = "h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=", + version = "v0.0.0-20220112060539-c52dc94e7fbe", + ) + go_repository( + name = "com_github_cncf_xds_go", + importpath = "github.com/cncf/xds/go", + sum = "h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=", + version = "v0.0.0-20230607035331-e9ce68804cb4", + ) + go_repository( + name = "com_github_codahale_hdrhistogram", + importpath = "github.com/codahale/hdrhistogram", + sum = "h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=", + version = "v0.0.0-20161010025455-3a0bb77429bd", + ) + go_repository( + name = "com_github_containerd_stargz_snapshotter_estargz", + importpath = "github.com/containerd/stargz-snapshotter/estargz", + sum = "h1:+7nYmHJb0tEkcRaAW+MHqoKaJYZmkikupxCqVtmPuY0=", + version = "v0.12.1", + ) + go_repository( + name = "com_github_coreos_go_semver", + importpath = "github.com/coreos/go-semver", + sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_coreos_go_systemd_v22", + importpath = "github.com/coreos/go-systemd/v22", + sum = "h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=", + version = "v22.3.2", + ) + go_repository( + name = "com_github_cpuguy83_go_md2man_v2", + importpath = "github.com/cpuguy83/go-md2man/v2", + sum = "h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=", + version = "v2.0.2", + ) + go_repository( + name = "com_github_creack_pty", + importpath = "github.com/creack/pty", + sum = "h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=", + version = "v1.1.9", + ) + go_repository( + name = "com_github_davecgh_go_spew", + importpath = "github.com/davecgh/go-spew", + sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_dchest_cmac", + importpath = "github.com/dchest/cmac", + sum = "h1:Vaorm9FVpO2P+YmRdH0RVCUB1XF3Ge1yg9scPvJphyk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_decred_dcrd_crypto_blake256", + importpath = "github.com/decred/dcrd/crypto/blake256", + sum = "h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_decred_dcrd_dcrec_secp256k1_v4", + importpath = "github.com/decred/dcrd/dcrec/secp256k1/v4", + sum = "h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=", + version = "v4.0.1", + ) + go_repository( + name = "com_github_deepmap_oapi_codegen_v2", + importpath = "github.com/deepmap/oapi-codegen/v2", + sum = "h1:3TS7w3r+XnjKFXcbFbc16pTWzfTy0OLPkCsutEHjWDA=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_docker_cli", + importpath = "github.com/docker/cli", + sum = "h1:lWQbHSHUFs7KraSN2jOJK7zbMS2jNCHI4mt4xUFUVQ4=", + version = "v20.10.20+incompatible", + ) + go_repository( + name = "com_github_docker_distribution", + importpath = "github.com/docker/distribution", + sum = "h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=", + version = "v2.8.1+incompatible", + ) + go_repository( + name = "com_github_docker_docker", + importpath = "github.com/docker/docker", + sum = "h1:kH9tx6XO+359d+iAkumyKDc5Q1kOwPuAUaeri48nD6E=", + version = "v20.10.20+incompatible", + ) + go_repository( + name = "com_github_docker_docker_credential_helpers", + importpath = "github.com/docker/docker-credential-helpers", + sum = "h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=", + version = "v0.7.0", + ) + go_repository( + name = "com_github_docker_go_connections", + importpath = "github.com/docker/go-connections", + sum = "h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_docker_go_units", + importpath = "github.com/docker/go-units", + sum = "h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_dustin_go_humanize", + importpath = "github.com/dustin/go-humanize", + sum = "h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_dvyukov_go_fuzz", + importpath = "github.com/dvyukov/go-fuzz", + sum = "h1:q1oJaUPdmpDm/VyXosjgPgr6wS7c5iV2p0PwJD73bUI=", + version = "v0.0.0-20210103155950-6a8e9d1f2415", + ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA=", + version = "v0.11.1-0.20230524094728-9239064ad72f", + ) + go_repository( + name = "com_github_envoyproxy_protoc_gen_validate", + importpath = "github.com/envoyproxy/protoc-gen-validate", + sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", + version = "v0.10.1", + ) + go_repository( + name = "com_github_fatih_color", + importpath = "github.com/fatih/color", + sum = "h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=", + version = "v1.14.1", + ) + go_repository( + name = "com_github_fatih_structs", + importpath = "github.com/fatih/structs", + sum = "h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_flosch_pongo2_v4", + importpath = "github.com/flosch/pongo2/v4", + sum = "h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=", + version = "v4.0.2", + ) + go_repository( + name = "com_github_francoispqt_gojay", + importpath = "github.com/francoispqt/gojay", + sum = "h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=", + version = "v1.2.13", + ) + go_repository( + name = "com_github_frankban_quicktest", + importpath = "github.com/frankban/quicktest", + sum = "h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=", + version = "v1.14.3", + ) + go_repository( + name = "com_github_fsnotify_fsnotify", + importpath = "github.com/fsnotify/fsnotify", + sum = "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_gabriel_vasile_mimetype", + importpath = "github.com/gabriel-vasile/mimetype", + sum = "h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_getkin_kin_openapi", + importpath = "github.com/getkin/kin-openapi", + sum = "h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM=", + version = "v0.118.0", + ) + go_repository( + name = "com_github_gin_contrib_sse", + importpath = "github.com/gin-contrib/sse", + sum = "h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_gin_gonic_gin", + importpath = "github.com/gin-gonic/gin", + sum = "h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=", + version = "v1.9.1", + ) + go_repository( + name = "com_github_go_chi_chi_v5", + importpath = "github.com/go-chi/chi/v5", + sum = "h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=", + version = "v5.0.8", + ) + go_repository( + name = "com_github_go_chi_cors", + importpath = "github.com/go-chi/cors", + sum = "h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_go_gl_glfw", + importpath = "github.com/go-gl/glfw", + sum = "h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=", + version = "v0.0.0-20190409004039-e6da0acd62b1", + ) + go_repository( + name = "com_github_go_gl_glfw_v3_3_glfw", + importpath = "github.com/go-gl/glfw/v3.3/glfw", + sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=", + version = "v0.0.0-20200222043503-6f7a984d4dc4", + ) + go_repository( + name = "com_github_go_kit_kit", + importpath = "github.com/go-kit/kit", + sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_go_kit_log", + importpath = "github.com/go-kit/log", + sum = "h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_go_logfmt_logfmt", + importpath = "github.com/go-logfmt/logfmt", + sum = "h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=", + version = "v0.5.1", + ) + go_repository( + name = "com_github_go_logr_logr", + importpath = "github.com/go-logr/logr", + sum = "h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=", + version = "v1.2.4", + ) + go_repository( + name = "com_github_go_openapi_jsonpointer", + importpath = "github.com/go-openapi/jsonpointer", + sum = "h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=", + version = "v0.19.5", + ) + go_repository( + name = "com_github_go_openapi_swag", + importpath = "github.com/go-openapi/swag", + sum = "h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU=", + version = "v0.21.1", + ) + go_repository( + name = "com_github_go_playground_locales", + importpath = "github.com/go-playground/locales", + sum = "h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=", + version = "v0.14.1", + ) + go_repository( + name = "com_github_go_playground_universal_translator", + importpath = "github.com/go-playground/universal-translator", + sum = "h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=", + version = "v0.18.1", + ) + go_repository( + name = "com_github_go_playground_validator_v10", + importpath = "github.com/go-playground/validator/v10", + sum = "h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k=", + version = "v10.14.1", + ) + go_repository( + name = "com_github_go_stack_stack", + importpath = "github.com/go-stack/stack", + sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_go_task_slim_sprig", + importpath = "github.com/go-task/slim-sprig", + sum = "h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=", + version = "v0.0.0-20230315185526-52ccab3ef572", + ) + go_repository( + name = "com_github_go_test_deep", + importpath = "github.com/go-test/deep", + sum = "h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=", + version = "v1.0.8", + ) + go_repository( + name = "com_github_goccy_go_json", + importpath = "github.com/goccy/go-json", + sum = "h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=", + version = "v0.10.2", + ) + go_repository( + name = "com_github_gogo_protobuf", + importpath = "github.com/gogo/protobuf", + sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_golang_glog", + importpath = "github.com/golang/glog", + sum = "h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_golang_groupcache", + importpath = "github.com/golang/groupcache", + sum = "h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=", + version = "v0.0.0-20210331224755-41bb18bfe9da", + ) + go_repository( + name = "com_github_golang_mock", + importpath = "github.com/golang/mock", + sum = "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_golang_protobuf", + importpath = "github.com/golang/protobuf", + sum = "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=", + version = "v1.5.3", + ) + go_repository( + name = "com_github_golang_snappy", + importpath = "github.com/golang/snappy", + sum = "h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=", + version = "v0.0.4", + ) + go_repository( + name = "com_github_gomarkdown_markdown", + importpath = "github.com/gomarkdown/markdown", + sum = "h1:uK3X/2mt4tbSGoHvbLBHUny7CKiuwUip3MArtukol4E=", + version = "v0.0.0-20230716120725-531d2d74bc12", + ) + go_repository( + name = "com_github_google_btree", + importpath = "github.com/google/btree", + sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_go_cmp", + importpath = "github.com/google/go-cmp", + sum = "h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=", + version = "v0.5.9", + ) + go_repository( + name = "com_github_google_go_containerregistry", + importpath = "github.com/google/go-containerregistry", + sum = "h1:y1C7Z3e149OJbOPDBxLYR8ITPz8dTKqQwjErKVHJC8k=", + version = "v0.13.0", + ) + go_repository( + name = "com_github_google_go_querystring", + importpath = "github.com/google/go-querystring", + sum = "h1:Avad62mreCc9la5buHvHZXbvsY+GPYUVjd8xsi48FYY=", + version = "v1.0.1-0.20190318165438-c8c88dbee036", + ) + go_repository( + name = "com_github_google_gofuzz", + importpath = "github.com/google/gofuzz", + sum = "h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_gopacket", + importpath = "github.com/google/gopacket", + sum = "h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=", + version = "v1.1.19", + ) + go_repository( + name = "com_github_google_martian", + importpath = "github.com/google/martian", + sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_google_martian_v3", + importpath = "github.com/google/martian/v3", + sum = "h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60=", + version = "v3.1.0", + ) + go_repository( + name = "com_github_google_pprof", + importpath = "github.com/google/pprof", + sum = "h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=", + version = "v0.0.0-20221118152302-e6195bd50e26", + ) + go_repository( + name = "com_github_google_renameio", + importpath = "github.com/google/renameio", + sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_google_uuid", + importpath = "github.com/google/uuid", + sum = "h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_googleapis_enterprise_certificate_proxy", + importpath = "github.com/googleapis/enterprise-certificate-proxy", + sum = "h1:RY7tHKZcRlk788d5WSo/e83gOyyy742E8GSs771ySpg=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_googleapis_gax_go_v2", + importpath = "github.com/googleapis/gax-go/v2", + sum = "h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ=", + version = "v2.7.0", + ) + go_repository( + name = "com_github_googleapis_google_cloud_go_testing", + importpath = "github.com/googleapis/google-cloud-go-testing", + sum = "h1:tlyzajkF3030q6M8SvmJSemC9DTHL/xaMa18b65+JM4=", + version = "v0.0.0-20200911160855-bcd43fbb19e8", + ) + go_repository( + name = "com_github_gopherjs_gopherjs", + importpath = "github.com/gopherjs/gopherjs", + sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", + version = "v0.0.0-20181017120253-0766667cb4d1", + ) + go_repository( + name = "com_github_gorilla_css", + importpath = "github.com/gorilla/css", + sum = "h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_gorilla_mux", + importpath = "github.com/gorilla/mux", + sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_middleware", + importpath = "github.com/grpc-ecosystem/go-grpc-middleware", + sum = "h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_prometheus", + importpath = "github.com/grpc-ecosystem/go-grpc-prometheus", + sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_opentracing", + importpath = "github.com/grpc-ecosystem/grpc-opentracing", + sum = "h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=", + version = "v0.0.0-20180507213350-8e809c8a8645", + ) + go_repository( + name = "com_github_hashicorp_consul_api", + importpath = "github.com/hashicorp/consul/api", + sum = "h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g=", + version = "v1.18.0", + ) + go_repository( + name = "com_github_hashicorp_go_cleanhttp", + importpath = "github.com/hashicorp/go-cleanhttp", + sum = "h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=", + version = "v0.5.2", + ) + go_repository( + name = "com_github_hashicorp_go_hclog", + importpath = "github.com/hashicorp/go-hclog", + sum = "h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_hashicorp_go_immutable_radix", + importpath = "github.com/hashicorp/go-immutable-radix", + sum = "h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_hashicorp_go_rootcerts", + importpath = "github.com/hashicorp/go-rootcerts", + sum = "h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_hashicorp_golang_lru", + importpath = "github.com/hashicorp/golang-lru", + sum = "h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o8jga4=", + version = "v0.6.0", + ) + go_repository( + name = "com_github_hashicorp_hcl", + importpath = "github.com/hashicorp/hcl", + sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_serf", + importpath = "github.com/hashicorp/serf", + sum = "h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=", + version = "v0.10.1", + ) + go_repository( + name = "com_github_iancoleman_strcase", + importpath = "github.com/iancoleman/strcase", + sum = "h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_ianlancetaylor_demangle", + importpath = "github.com/ianlancetaylor/demangle", + sum = "h1:rcanfLhLDA8nozr/K289V1zcntHr3V+SHlXwzz1ZI2g=", + version = "v0.0.0-20220319035150-800ac71e25c2", + ) + go_repository( + name = "com_github_inconshreveable_mousetrap", + importpath = "github.com/inconshreveable/mousetrap", + sum = "h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_invopop_yaml", + importpath = "github.com/invopop/yaml", + sum = "h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_iris_contrib_schema", + importpath = "github.com/iris-contrib/schema", + sum = "h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw=", + version = "v0.0.6", + ) + go_repository( + name = "com_github_joker_jade", + importpath = "github.com/Joker/jade", + sum = "h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk=", + version = "v1.1.3", + ) + go_repository( + name = "com_github_josharian_intern", + importpath = "github.com/josharian/intern", + sum = "h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jpillora_backoff", + importpath = "github.com/jpillora/backoff", + sum = "h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_json_iterator_go", + importpath = "github.com/json-iterator/go", + sum = "h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=", + version = "v1.1.12", + ) + go_repository( + name = "com_github_jstemmer_go_junit_report", + importpath = "github.com/jstemmer/go-junit-report", + sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_jtolds_gls", + importpath = "github.com/jtolds/gls", + sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=", + version = "v4.20.0+incompatible", + ) + go_repository( + name = "com_github_juju_gnuflag", + importpath = "github.com/juju/gnuflag", + sum = "h1:c93kUJDtVAXFEhsCh5jSxyOJmFHuzcihnslQiX8Urwo=", + version = "v0.0.0-20171113085948-2ce1bb71843d", + ) + go_repository( + name = "com_github_julienschmidt_httprouter", + importpath = "github.com/julienschmidt/httprouter", + sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_kataras_blocks", + importpath = "github.com/kataras/blocks", + sum = "h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4=", + version = "v0.0.7", + ) + go_repository( + name = "com_github_kataras_golog", + importpath = "github.com/kataras/golog", + sum = "h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk=", + version = "v0.1.9", + ) + go_repository( + name = "com_github_kataras_iris_v12", + importpath = "github.com/kataras/iris/v12", + sum = "h1:R5UzUW4MIByBM6tKMG3UqJ7hL1JCEE+dkqQ8L72f6PU=", + version = "v12.2.5", + ) + go_repository( + name = "com_github_kataras_pio", + importpath = "github.com/kataras/pio", + sum = "h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w=", + version = "v0.0.12", + ) + go_repository( + name = "com_github_kataras_sitemap", + importpath = "github.com/kataras/sitemap", + sum = "h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY=", + version = "v0.0.6", + ) + go_repository( + name = "com_github_kataras_tunnel", + importpath = "github.com/kataras/tunnel", + sum = "h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=", + version = "v0.0.4", + ) + go_repository( + name = "com_github_kballard_go_shellquote", + importpath = "github.com/kballard/go-shellquote", + sum = "h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=", + version = "v0.0.0-20180428030007-95032a82bc51", + ) + go_repository( + name = "com_github_kisielk_errcheck", + importpath = "github.com/kisielk/errcheck", + sum = "h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_kisielk_gotool", + importpath = "github.com/kisielk/gotool", + sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_klauspost_compress", + importpath = "github.com/klauspost/compress", + sum = "h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=", + version = "v1.16.7", + ) + go_repository( + name = "com_github_klauspost_cpuid_v2", + importpath = "github.com/klauspost/cpuid/v2", + sum = "h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=", + version = "v2.2.5", + ) + go_repository( + name = "com_github_konsorten_go_windows_terminal_sequences", + importpath = "github.com/konsorten/go-windows-terminal-sequences", + sum = "h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_kr_fs", + importpath = "github.com/kr/fs", + sum = "h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_kr_logfmt", + importpath = "github.com/kr/logfmt", + sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=", + version = "v0.0.0-20140226030751-b84e30acd515", + ) + go_repository( + name = "com_github_kr_pretty", + importpath = "github.com/kr/pretty", + sum = "h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_kr_pty", + importpath = "github.com/kr/pty", + sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_kr_text", + importpath = "github.com/kr/text", + sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_labstack_echo_v4", + importpath = "github.com/labstack/echo/v4", + sum = "h1:dEpLU2FLg4UVmvCGPuk/APjlH6GDpbEPti61srUUUs4=", + version = "v4.11.1", + ) + go_repository( + name = "com_github_labstack_gommon", + importpath = "github.com/labstack/gommon", + sum = "h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_leodido_go_urn", + importpath = "github.com/leodido/go-urn", + sum = "h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=", + version = "v1.2.4", + ) + go_repository( + name = "com_github_lestrrat_go_backoff_v2", + importpath = "github.com/lestrrat-go/backoff/v2", + sum = "h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A=", + version = "v2.0.8", + ) + go_repository( + name = "com_github_lestrrat_go_blackmagic", + importpath = "github.com/lestrrat-go/blackmagic", + sum = "h1:XzdxDbuQTz0RZZEmdU7cnQxUtFUzgCSPq8RCz4BxIi4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_lestrrat_go_httpcc", + importpath = "github.com/lestrrat-go/httpcc", + sum = "h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_lestrrat_go_iter", + importpath = "github.com/lestrrat-go/iter", + sum = "h1:q8faalr2dY6o8bV45uwrxq12bRa1ezKrB6oM9FUgN4A=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_lestrrat_go_jwx", + importpath = "github.com/lestrrat-go/jwx", + sum = "h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA=", + version = "v1.2.25", + ) + go_repository( + name = "com_github_lestrrat_go_option", + importpath = "github.com/lestrrat-go/option", + sum = "h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_magiconair_properties", + importpath = "github.com/magiconair/properties", + sum = "h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=", + version = "v1.8.7", + ) + go_repository( + name = "com_github_mailgun_raymond_v2", + importpath = "github.com/mailgun/raymond/v2", + sum = "h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw=", + version = "v2.0.48", + ) + go_repository( + name = "com_github_mailru_easyjson", + importpath = "github.com/mailru/easyjson", + sum = "h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=", + version = "v0.7.7", + ) + go_repository( + name = "com_github_mattn_go_colorable", + importpath = "github.com/mattn/go-colorable", + sum = "h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=", + version = "v0.1.13", + ) + go_repository( + name = "com_github_mattn_go_isatty", + importpath = "github.com/mattn/go-isatty", + sum = "h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=", + version = "v0.0.19", + ) + go_repository( + name = "com_github_mattn_go_runewidth", + importpath = "github.com/mattn/go-runewidth", + sum = "h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=", + version = "v0.0.9", + ) + go_repository( + name = "com_github_mattn_go_sqlite3", + importpath = "github.com/mattn/go-sqlite3", + sum = "h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM=", + version = "v1.14.17", + ) + go_repository( + name = "com_github_matttproud_golang_protobuf_extensions", + importpath = "github.com/matttproud/golang_protobuf_extensions", + sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_microcosm_cc_bluemonday", + importpath = "github.com/microcosm-cc/bluemonday", + sum = "h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg=", + version = "v1.0.25", + ) + go_repository( + name = "com_github_microsoft_go_winio", + importpath = "github.com/Microsoft/go-winio", + sum = "h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=", + version = "v0.6.0", + ) + go_repository( + name = "com_github_mitchellh_go_homedir", + importpath = "github.com/mitchellh/go-homedir", + sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_mitchellh_mapstructure", + importpath = "github.com/mitchellh/mapstructure", + sum = "h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_moby_term", + importpath = "github.com/moby/term", + sum = "h1:yH0SvLzcbZxcJXho2yh7CqdENGMQe73Cw3woZBpPli0=", + version = "v0.0.0-20210610120745-9d4ed1856297", + ) + go_repository( + name = "com_github_modern_go_concurrent", + importpath = "github.com/modern-go/concurrent", + sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=", + version = "v0.0.0-20180306012644-bacd9c7ef1dd", + ) + go_repository( + name = "com_github_modern_go_reflect2", + importpath = "github.com/modern-go/reflect2", + sum = "h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_mohae_deepcopy", + importpath = "github.com/mohae/deepcopy", + sum = "h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=", + version = "v0.0.0-20170929034955-c48cc78d4826", + ) + go_repository( + name = "com_github_morikuni_aec", + importpath = "github.com/morikuni/aec", + sum = "h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mwitkow_go_conntrack", + importpath = "github.com/mwitkow/go-conntrack", + sum = "h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=", + version = "v0.0.0-20190716064945-2f068394615f", + ) + go_repository( + name = "com_github_niemeyer_pretty", + importpath = "github.com/niemeyer/pretty", + sum = "h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=", + version = "v0.0.0-20200227124842-a10e7caefd8e", + ) + go_repository( + name = "com_github_oapi_codegen_runtime", + importpath = "github.com/oapi-codegen/runtime", + sum = "h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_olekukonko_tablewriter", + importpath = "github.com/olekukonko/tablewriter", + sum = "h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=", + version = "v0.0.5", + ) + go_repository( + name = "com_github_onsi_ginkgo_v2", + importpath = "github.com/onsi/ginkgo/v2", + sum = "h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=", + version = "v2.9.5", + ) + go_repository( + name = "com_github_onsi_gomega", + importpath = "github.com/onsi/gomega", + sum = "h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=", + version = "v1.27.6", + ) + go_repository( + name = "com_github_opencontainers_go_digest", + importpath = "github.com/opencontainers/go-digest", + sum = "h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_opencontainers_image_spec", + importpath = "github.com/opencontainers/image-spec", + sum = "h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034=", + version = "v1.1.0-rc2", + ) + go_repository( + name = "com_github_opentracing_opentracing_go", + importpath = "github.com/opentracing/opentracing-go", + sum = "h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_patrickmn_go_cache", + importpath = "github.com/patrickmn/go-cache", + sum = "h1:MUIwjEiAMYk8zkXXUQeb5itrXF+HpS2pfxNsA2a7AiY=", + version = "v2.1.1-0.20180815053127-5633e0862627+incompatible", + ) + go_repository( + name = "com_github_pelletier_go_toml", + importpath = "github.com/pelletier/go-toml", + sum = "h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=", + version = "v1.9.5", + ) + go_repository( + name = "com_github_pelletier_go_toml_v2", + importpath = "github.com/pelletier/go-toml/v2", + sum = "h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=", + version = "v2.0.9", + ) + go_repository( + name = "com_github_perimeterx_marshmallow", + importpath = "github.com/perimeterx/marshmallow", + sum = "h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw=", + version = "v1.1.4", + ) + go_repository( + name = "com_github_pkg_errors", + importpath = "github.com/pkg/errors", + sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_pkg_sftp", + importpath = "github.com/pkg/sftp", + sum = "h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs=", + version = "v1.13.1", + ) + go_repository( + name = "com_github_pmezard_go_difflib", + importpath = "github.com/pmezard/go-difflib", + sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_prometheus_client_golang", + importpath = "github.com/prometheus/client_golang", + sum = "h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=", + version = "v1.14.0", + ) + go_repository( + name = "com_github_prometheus_client_model", + importpath = "github.com/prometheus/client_model", + sum = "h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_prometheus_common", + importpath = "github.com/prometheus/common", + sum = "h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=", + version = "v0.37.0", + ) + go_repository( + name = "com_github_prometheus_procfs", + importpath = "github.com/prometheus/procfs", + sum = "h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=", + version = "v0.12.0", + ) + go_repository( + name = "com_github_quic_go_qpack", + importpath = "github.com/quic-go/qpack", + sum = "h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_quic_go_qtls_go1_20", + importpath = "github.com/quic-go/qtls-go1-20", + sum = "h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=", + version = "v0.4.1", + ) + go_repository( + name = "com_github_quic_go_quic_go", + importpath = "github.com/quic-go/quic-go", + patch_args = ["-p1"], # keep + patches = [ + "@//patches/com_github_quic_go_quic_go:http3_remote_addr.patch", # keep + ], + sum = "h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw=", + version = "v0.40.0", + ) + go_repository( + name = "com_github_ravenox_go_jsoncommentstrip", + importpath = "github.com/RaveNoX/go-jsoncommentstrip", + sum = "h1:t527LHHE3HmiHrq74QMpNPZpGCIJzTx+apLkMKt4HC0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_remyoudompheng_bigfft", + importpath = "github.com/remyoudompheng/bigfft", + sum = "h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=", + version = "v0.0.0-20230129092748-24d4a6f8daec", + ) + go_repository( + name = "com_github_rogpeppe_go_internal", + importpath = "github.com/rogpeppe/go-internal", + sum = "h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=", + version = "v1.6.1", + ) + go_repository( + name = "com_github_russross_blackfriday_v2", + importpath = "github.com/russross/blackfriday/v2", + sum = "h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=", + version = "v2.1.0", + ) + go_repository( + name = "com_github_sagikazarmark_crypt", + importpath = "github.com/sagikazarmark/crypt", + sum = "h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zruedRdZk=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_schollz_closestmatch", + importpath = "github.com/schollz/closestmatch", + sum = "h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_sergi_go_diff", + importpath = "github.com/sergi/go-diff", + sum = "h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_shopify_goreferrer", + importpath = "github.com/Shopify/goreferrer", + sum = "h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0=", + version = "v0.0.0-20220729165902-8cddb4f5de06", + ) + go_repository( + name = "com_github_sirupsen_logrus", + importpath = "github.com/sirupsen/logrus", + sum = "h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=", + version = "v1.9.0", + ) + go_repository( + name = "com_github_smartystreets_assertions", + importpath = "github.com/smartystreets/assertions", + sum = "h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_smartystreets_goconvey", + importpath = "github.com/smartystreets/goconvey", + sum = "h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=", + version = "v1.7.2", + ) + go_repository( + name = "com_github_songgao_water", + importpath = "github.com/songgao/water", + sum = "h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8=", + version = "v0.0.0-20200317203138-2b4b6d7c09d8", + ) + go_repository( + name = "com_github_spf13_afero", + importpath = "github.com/spf13/afero", + sum = "h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=", + version = "v1.9.3", + ) + go_repository( + name = "com_github_spf13_cast", + importpath = "github.com/spf13/cast", + sum = "h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_spf13_cobra", + importpath = "github.com/spf13/cobra", + sum = "h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=", + version = "v1.6.1", + ) + go_repository( + name = "com_github_spf13_jwalterweatherman", + importpath = "github.com/spf13/jwalterweatherman", + sum = "h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_spf13_pflag", + importpath = "github.com/spf13/pflag", + sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_spf13_viper", + importpath = "github.com/spf13/viper", + sum = "h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=", + version = "v1.15.0", + ) + go_repository( + name = "com_github_spkg_bom", + importpath = "github.com/spkg/bom", + sum = "h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc=", + version = "v0.0.0-20160624110644-59b7046e48ad", + ) + go_repository( + name = "com_github_stretchr_objx", + importpath = "github.com/stretchr/objx", + sum = "h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_stretchr_testify", + importpath = "github.com/stretchr/testify", + sum = "h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=", + version = "v1.8.4", + ) + go_repository( + name = "com_github_subosito_gotenv", + importpath = "github.com/subosito/gotenv", + sum = "h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_tdewolff_minify_v2", + importpath = "github.com/tdewolff/minify/v2", + sum = "h1:Q2BqOTmlMjoutkuD/OPCnJUpIqrzT3nRPkw+q+KpXS0=", + version = "v2.12.8", + ) + go_repository( + name = "com_github_tdewolff_parse_v2", + importpath = "github.com/tdewolff/parse/v2", + sum = "h1:WrFllrqmzAcrKHzoYgMupqgUBIfBVOb0yscFzDf8bBg=", + version = "v2.6.7", + ) + go_repository( + name = "com_github_twitchyliquid64_golang_asm", + importpath = "github.com/twitchyliquid64/golang-asm", + sum = "h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=", + version = "v0.15.1", + ) + go_repository( + name = "com_github_uber_jaeger_client_go", + importpath = "github.com/uber/jaeger-client-go", + sum = "h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=", + version = "v2.30.0+incompatible", + ) + go_repository( + name = "com_github_uber_jaeger_lib", + importpath = "github.com/uber/jaeger-lib", + sum = "h1:iMSCV0rmXEogjNWPh2D0xk9YVKvrtGoHJNe9ebLu/pw=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_ugorji_go", + importpath = "github.com/ugorji/go", + sum = "h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=", + version = "v1.2.7", + ) + go_repository( + name = "com_github_ugorji_go_codec", + importpath = "github.com/ugorji/go/codec", + sum = "h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=", + version = "v1.2.11", + ) + go_repository( + name = "com_github_valyala_bytebufferpool", + importpath = "github.com/valyala/bytebufferpool", + sum = "h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_valyala_fasttemplate", + importpath = "github.com/valyala/fasttemplate", + sum = "h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_vbatts_tar_split", + importpath = "github.com/vbatts/tar-split", + sum = "h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME=", + version = "v0.11.2", + ) + go_repository( + name = "com_github_vishvananda_netlink", + importpath = "github.com/vishvananda/netlink", + sum = "h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs=", + version = "v1.2.1-beta.2", + ) + go_repository( + name = "com_github_vishvananda_netns", + importpath = "github.com/vishvananda/netns", + sum = "h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns=", + version = "v0.0.0-20200728191858-db3c7e526aae", + ) + go_repository( + name = "com_github_vmihailenco_msgpack_v5", + importpath = "github.com/vmihailenco/msgpack/v5", + sum = "h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=", + version = "v5.3.5", + ) + go_repository( + name = "com_github_vmihailenco_tagparser_v2", + importpath = "github.com/vmihailenco/tagparser/v2", + sum = "h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_yosssi_ace", + importpath = "github.com/yosssi/ace", + sum = "h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=", + version = "v0.0.5", + ) + go_repository( + name = "com_github_yuin_goldmark", + importpath = "github.com/yuin/goldmark", + sum = "h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=", + version = "v1.4.13", + ) + go_repository( + name = "com_google_cloud_go", + importpath = "cloud.google.com/go", + sum = "h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y=", + version = "v0.105.0", + ) + go_repository( + name = "com_google_cloud_go_bigquery", + importpath = "cloud.google.com/go/bigquery", + sum = "h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=", + version = "v1.8.0", + ) + go_repository( + name = "com_google_cloud_go_compute", + importpath = "cloud.google.com/go/compute", + sum = "h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY=", + version = "v1.19.1", + ) + go_repository( + name = "com_google_cloud_go_compute_metadata", + importpath = "cloud.google.com/go/compute/metadata", + sum = "h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=", + version = "v0.2.3", + ) + go_repository( + name = "com_google_cloud_go_datastore", + importpath = "cloud.google.com/go/datastore", + sum = "h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=", + version = "v1.1.0", + ) + go_repository( + name = "com_google_cloud_go_firestore", + importpath = "cloud.google.com/go/firestore", + sum = "h1:IBlRyxgGySXu5VuW0RgGFlTtLukSnNkpDiEOMkQkmpA=", + version = "v1.9.0", + ) + go_repository( + name = "com_google_cloud_go_longrunning", + importpath = "cloud.google.com/go/longrunning", + sum = "h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs=", + version = "v0.3.0", + ) + go_repository( + name = "com_google_cloud_go_pubsub", + importpath = "cloud.google.com/go/pubsub", + sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=", + version = "v1.3.1", + ) + go_repository( + name = "com_google_cloud_go_storage", + importpath = "cloud.google.com/go/storage", + sum = "h1:6RRlFMv1omScs6iq2hfE3IvgE+l6RfJPampq8UZc5TU=", + version = "v1.14.0", + ) + go_repository( + name = "com_lukechampine_uint128", + importpath = "lukechampine.com/uint128", + sum = "h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=", + version = "v1.2.0", + ) + go_repository( + name = "com_shuralyov_dmitri_gpu_mtl", + importpath = "dmitri.shuralyov.com/gpu/mtl", + sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=", + version = "v0.0.0-20190408044501-666a987793e9", + ) + go_repository( + name = "in_gopkg_alecthomas_kingpin_v2", + importpath = "gopkg.in/alecthomas/kingpin.v2", + sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=", + version = "v2.2.6", + ) + go_repository( + name = "in_gopkg_check_v1", + importpath = "gopkg.in/check.v1", + sum = "h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=", + version = "v1.0.0-20201130134442-10cb98267c6c", + ) + go_repository( + name = "in_gopkg_errgo_v2", + importpath = "gopkg.in/errgo.v2", + sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=", + version = "v2.1.0", + ) + go_repository( + name = "in_gopkg_ini_v1", + importpath = "gopkg.in/ini.v1", + sum = "h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=", + version = "v1.67.0", + ) + go_repository( + name = "in_gopkg_yaml_v2", + importpath = "gopkg.in/yaml.v2", + sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=", + version = "v2.4.0", + ) + go_repository( + name = "in_gopkg_yaml_v3", + importpath = "gopkg.in/yaml.v3", + sum = "h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=", + version = "v3.0.1", + ) + go_repository( + name = "io_etcd_go_etcd_api_v3", + importpath = "go.etcd.io/etcd/api/v3", + sum = "h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A=", + version = "v3.5.6", + ) + go_repository( + name = "io_etcd_go_etcd_client_pkg_v3", + importpath = "go.etcd.io/etcd/client/pkg/v3", + sum = "h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU=", + version = "v3.5.6", + ) + go_repository( + name = "io_etcd_go_etcd_client_v2", + importpath = "go.etcd.io/etcd/client/v2", + sum = "h1:fIDR0p4KMjw01MJMfUIDWdQbjo06PD6CeYM5z4EHLi0=", + version = "v2.305.6", + ) + go_repository( + name = "io_etcd_go_etcd_client_v3", + importpath = "go.etcd.io/etcd/client/v3", + sum = "h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E=", + version = "v3.5.6", + ) + go_repository( + name = "io_opencensus_go", + importpath = "go.opencensus.io", + sum = "h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=", + version = "v0.24.0", + ) + go_repository( + name = "io_rsc_binaryregexp", + importpath = "rsc.io/binaryregexp", + sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", + version = "v0.2.0", + ) + go_repository( + name = "io_rsc_quote_v3", + importpath = "rsc.io/quote/v3", + sum = "h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=", + version = "v3.1.0", + ) + go_repository( + name = "io_rsc_sampler", + importpath = "rsc.io/sampler", + sum = "h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=", + version = "v1.3.0", + ) + go_repository( + name = "org_go4_netipx", + importpath = "go4.org/netipx", + sum = "h1:ketMxHg+vWm3yccyYiq+uK8D3fRmna2Fcj+awpQp84s=", + version = "v0.0.0-20230125063823-8449b0a6169f", + ) + go_repository( + name = "org_golang_google_api", + importpath = "google.golang.org/api", + sum = "h1:I2SlFjD8ZWabaIFOfeEDg3pf0BHJDh6iYQ1ic3Yu/UU=", + version = "v0.107.0", + ) + go_repository( + name = "org_golang_google_appengine", + importpath = "google.golang.org/appengine", + sum = "h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=", + version = "v1.6.7", + ) + go_repository( + name = "org_golang_google_genproto", + importpath = "google.golang.org/genproto", + sum = "h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g=", + version = "v0.0.0-20230803162519-f966b187b2e5", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_api", + importpath = "google.golang.org/genproto/googleapis/api", + sum = "h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=", + version = "v0.0.0-20230525234035-dd9d682886f9", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_rpc", + importpath = "google.golang.org/genproto/googleapis/rpc", + sum = "h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0=", + version = "v0.0.0-20230815205213-6bfd019c3878", + ) + go_repository( + name = "org_golang_google_grpc", + # XXX(uniquefine): + # Starting with release v0.41.0 rules_go no longer includes the @go_googleapis repo. + # Instead all code code generated from protobufs for Google APIs will have to depend on + # @org_golang_google_genproto. As of v0.32.0 gazelle does not yet correctly resolve dependencies + # to this repository. Thus we have to manually add this here. + build_directives = [ + "gazelle:resolve go google.golang.org/genproto/googleapis/rpc/status @org_golang_google_genproto_googleapis_rpc//status", + ], + importpath = "google.golang.org/grpc", + sum = "h1:uw37EN34aMFFXB2QPW7Tq6tdTbind1GpRxw5aOX3a5k=", + version = "v1.57.2", + ) + go_repository( + name = "org_golang_google_grpc_examples", + importpath = "google.golang.org/grpc/examples", + sum = "h1:ijVKWXLMbG/RK63KfOQ1lEVpEApj174fkw073gxZf3w=", + version = "v0.0.0-20230222033013-5353eaa44095", + ) + go_repository( + name = "org_golang_google_protobuf", + importpath = "google.golang.org/protobuf", + sum = "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=", + version = "v1.31.0", + ) + go_repository( + name = "org_golang_x_arch", + importpath = "golang.org/x/arch", + sum = "h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc=", + version = "v0.4.0", + ) + go_repository( + name = "org_golang_x_crypto", + importpath = "golang.org/x/crypto", + sum = "h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=", + version = "v0.12.0", + ) + go_repository( + name = "org_golang_x_exp", + importpath = "golang.org/x/exp", + sum = "h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o=", + version = "v0.0.0-20221205204356-47842c84f3db", + ) + go_repository( + name = "org_golang_x_exp_typeparams", + importpath = "golang.org/x/exp/typeparams", + sum = "h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM=", + version = "v0.0.0-20220218215828-6cf2b201936e", + ) + go_repository( + name = "org_golang_x_image", + importpath = "golang.org/x/image", + sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", + version = "v0.0.0-20190802002840-cff245a6509b", + ) + go_repository( + name = "org_golang_x_lint", + importpath = "golang.org/x/lint", + sum = "h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=", + version = "v0.0.0-20210508222113-6edffad5e616", + ) + go_repository( + name = "org_golang_x_mobile", + importpath = "golang.org/x/mobile", + sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", + version = "v0.0.0-20190719004257-d2bd2a29d028", + ) + go_repository( + name = "org_golang_x_mod", + importpath = "golang.org/x/mod", + sum = "h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=", + version = "v0.12.0", + ) + go_repository( + name = "org_golang_x_net", + importpath = "golang.org/x/net", + sum = "h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=", + version = "v0.14.0", + ) + go_repository( + name = "org_golang_x_oauth2", + importpath = "golang.org/x/oauth2", + sum = "h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=", + version = "v0.7.0", + ) + go_repository( + name = "org_golang_x_sync", + importpath = "golang.org/x/sync", + sum = "h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=", + version = "v0.3.0", + ) + go_repository( + name = "org_golang_x_sys", + importpath = "golang.org/x/sys", + sum = "h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=", + version = "v0.12.0", + ) + go_repository( + name = "org_golang_x_term", + importpath = "golang.org/x/term", + sum = "h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=", + version = "v0.11.0", + ) + go_repository( + name = "org_golang_x_text", + importpath = "golang.org/x/text", + sum = "h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=", + version = "v0.13.0", + ) + go_repository( + name = "org_golang_x_time", + importpath = "golang.org/x/time", + sum = "h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=", + version = "v0.3.0", + ) + go_repository( + name = "org_golang_x_tools", + importpath = "golang.org/x/tools", + sum = "h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=", + version = "v0.12.0", + ) + go_repository( + name = "org_golang_x_xerrors", + importpath = "golang.org/x/xerrors", + sum = "h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=", + version = "v0.0.0-20220907171357-04be3eba64a2", + ) + go_repository( + name = "org_modernc_cc_v3", + importpath = "modernc.org/cc/v3", + sum = "h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw=", + version = "v3.40.0", + ) + go_repository( + name = "org_modernc_ccgo_v3", + importpath = "modernc.org/ccgo/v3", + sum = "h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw=", + version = "v3.16.13", + ) + go_repository( + name = "org_modernc_ccorpus", + importpath = "modernc.org/ccorpus", + sum = "h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=", + version = "v1.11.6", + ) + go_repository( + name = "org_modernc_httpfs", + importpath = "modernc.org/httpfs", + sum = "h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=", + version = "v1.0.6", + ) + go_repository( + name = "org_modernc_libc", + importpath = "modernc.org/libc", + sum = "h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=", + version = "v1.22.5", + ) + go_repository( + name = "org_modernc_mathutil", + importpath = "modernc.org/mathutil", + sum = "h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=", + version = "v1.5.0", + ) + go_repository( + name = "org_modernc_memory", + importpath = "modernc.org/memory", + sum = "h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=", + version = "v1.5.0", + ) + go_repository( + name = "org_modernc_opt", + importpath = "modernc.org/opt", + sum = "h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=", + version = "v0.1.3", + ) + go_repository( + name = "org_modernc_sqlite", + importpath = "modernc.org/sqlite", + sum = "h1:EsClRIWHGhLTCX44p+Ri/JLD+vFGo0QGjasg2/F9TlI=", + version = "v1.24.0", + ) + go_repository( + name = "org_modernc_strutil", + importpath = "modernc.org/strutil", + sum = "h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=", + version = "v1.1.3", + ) + go_repository( + name = "org_modernc_tcl", + importpath = "modernc.org/tcl", + sum = "h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY=", + version = "v1.15.2", + ) + go_repository( + name = "org_modernc_token", + importpath = "modernc.org/token", + sum = "h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=", + version = "v1.0.1", + ) + go_repository( + name = "org_modernc_z", + importpath = "modernc.org/z", + sum = "h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=", + version = "v1.7.3", + ) + go_repository( + name = "org_uber_go_atomic", + importpath = "go.uber.org/atomic", + sum = "h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=", + version = "v1.9.0", + ) + go_repository( + name = "org_uber_go_goleak", + importpath = "go.uber.org/goleak", + sum = "h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=", + version = "v1.2.1", + ) + go_repository( + name = "org_uber_go_mock", + importpath = "go.uber.org/mock", + sum = "h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=", + version = "v0.3.0", + ) + go_repository( + name = "org_uber_go_multierr", + importpath = "go.uber.org/multierr", + sum = "h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=", + version = "v1.8.0", + ) + go_repository( + name = "org_uber_go_zap", + importpath = "go.uber.org/zap", + sum = "h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=", + version = "v1.24.0", + ) + go_repository( + name = "tools_gotest_v3", + importpath = "gotest.tools/v3", + sum = "h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=", + version = "v3.0.3", + ) diff --git a/patches/com_github_quic_go_quic_go/http3_remote_addr.patch b/patches/com_github_quic_go_quic_go/http3_remote_addr.patch new file mode 100644 index 0000000000..290511f152 --- /dev/null +++ b/patches/com_github_quic_go_quic_go/http3_remote_addr.patch @@ -0,0 +1,21 @@ +diff --git a/http3/server.go b/http3/server.go +index ac2e32a6..a4c4e327 100644 +--- a/http3/server.go ++++ b/http3/server.go +@@ -115,6 +115,8 @@ func (k *contextKey) String() string { return "quic-go/http3 context value " + k + // type *http3.Server. + var ServerContextKey = &contextKey{"http3-server"} + ++var RemoteAddrContextKey = &contextKey{"remote-addr"} ++ + type requestError struct { + err error + streamErr ErrCode +@@ -597,6 +599,7 @@ func (s *Server) handleRequest(conn quic.Connection, str quic.Stream, decoder *q + ctx := str.Context() + ctx = context.WithValue(ctx, ServerContextKey, s) + ctx = context.WithValue(ctx, http.LocalAddrContextKey, conn.LocalAddr()) ++ ctx = context.WithValue(ctx, RemoteAddrContextKey, conn.RemoteAddr()) + req = req.WithContext(ctx) + r := newResponseWriter(str, conn, s.logger) + if req.Method == http.MethodHead { diff --git a/pkg/connect/BUILD.bazel b/pkg/connect/BUILD.bazel new file mode 100644 index 0000000000..6a06ca8ca5 --- /dev/null +++ b/pkg/connect/BUILD.bazel @@ -0,0 +1,19 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "dialer.go", + "server.go", + ], + importpath = "github.com/scionproto/scion/pkg/connect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/log:go_default_library", + "//pkg/snet:go_default_library", + "//pkg/snet/squic:go_default_library", + "@com_github_quic_go_quic_go//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", + "@org_golang_google_grpc//peer:go_default_library", + ], +) diff --git a/pkg/connect/dialer.go b/pkg/connect/dialer.go new file mode 100644 index 0000000000..8c1ea688ff --- /dev/null +++ b/pkg/connect/dialer.go @@ -0,0 +1,42 @@ +package connect + +import ( + "crypto/tls" + "fmt" + "net" + "net/http" + "strconv" + + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/pkg/snet" + "github.com/scionproto/scion/pkg/snet/squic" +) + +type Dialer = func(net.Addr, ...squic.EarlyDialerOption) squic.EarlyDialer + +func BaseUrl(server net.Addr) string { + switch s := server.(type) { + case *snet.UDPAddr: + host := fmt.Sprintf("%s,%s", s.IA, s.Host.IP) + return "https://" + net.JoinHostPort(host, strconv.Itoa(s.Host.Port)) + case *snet.SVCAddr: + return fmt.Sprintf("https://[%s,%s]", s.IA, s.SVC.BaseString()) + default: + return "https://" + server.String() + } +} + +type HTTPClient struct { + RoundTripper *http3.RoundTripper +} + +func (c HTTPClient) Do(req *http.Request) (*http.Response, error) { + return c.RoundTripper.RoundTrip(req) +} + +// AdaptTLS adapts the TLS config to indicate HTTP/3 and connectgrpc support. +func AdaptTLS(cfg *tls.Config) *tls.Config { + c := cfg.Clone() + c.NextProtos = []string{"h3", "SCION"} + return c +} diff --git a/pkg/connect/happy/BUILD.bazel b/pkg/connect/happy/BUILD.bazel new file mode 100644 index 0000000000..bc53e1c930 --- /dev/null +++ b/pkg/connect/happy/BUILD.bazel @@ -0,0 +1,12 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["happy.go"], + importpath = "github.com/scionproto/scion/pkg/connect/happy", + visibility = ["//visibility:public"], + deps = [ + "//pkg/log:go_default_library", + "//pkg/private/serrors:go_default_library", + ], +) diff --git a/pkg/connect/happy/happy.go b/pkg/connect/happy/happy.go new file mode 100644 index 0000000000..76b4f7d82d --- /dev/null +++ b/pkg/connect/happy/happy.go @@ -0,0 +1,129 @@ +package happy + +import ( + "context" + "sync" + "time" + + "github.com/scionproto/scion/pkg/log" + "github.com/scionproto/scion/pkg/private/serrors" +) + +type Caller[R any] interface { + Invoke(context.Context) (R, error) + Type() string +} + +type Call0[R any] struct { + Call func(context.Context) (R, error) + Typ string +} + +func (c Call0[R]) Invoke(ctx context.Context) (R, error) { + return c.Call(ctx) +} + +func (c Call0[R]) Type() string { + return c.Typ +} + +type Call1[I1 any, R any] struct { + Call func(context.Context, I1) (R, error) + Input1 I1 + Typ string +} + +func (c Call1[I1, R]) Invoke(ctx context.Context) (R, error) { + return c.Call(ctx, c.Input1) +} + +func (c Call1[I1, R]) Type() string { + return c.Typ +} + +type NoReturn1[I1 any] func(context.Context, I1) error + +func (d NoReturn1[I1]) Call(ctx context.Context, i1 I1) (struct{}, error) { + return struct{}{}, d(ctx, i1) +} + +type Call2[I1 any, I2, R any] struct { + Call func(context.Context, I1, I2) (R, error) + Input1 I1 + Input2 I2 + Typ string +} + +func (c Call2[I1, I2, R]) Invoke(ctx context.Context) (R, error) { + return c.Call(ctx, c.Input1, c.Input2) +} + +func (c Call2[I1, I2, R]) Type() string { + return c.Typ +} + +type NoReturn2[I1, I2 any] func(context.Context, I1, I2) error + +func (d NoReturn2[I1, I2]) Call(ctx context.Context, i1 I1, i2 I2) (struct{}, error) { + return struct{}{}, d(ctx, i1, i2) +} + +func Happy[R any](ctx context.Context, fast, slow Caller[R]) (R, error) { + logger := log.FromCtx(ctx) + + var ( + wg sync.WaitGroup + reps [2]R + errs [2]error + ) + + wg.Add(2) + abortCtx, cancel := context.WithCancel(ctx) + go func() { + defer log.HandlePanic() + defer wg.Done() + rep, err := fast.Invoke(abortCtx) + if err == nil { + reps[0] = rep + logger.Debug("Received response via connect", "type", fast.Type()) + cancel() + } else { + logger.Debug("Failed to receive via connect", "type", fast.Type(), "err", err) + } + errs[0] = err + }() + + go func() { + defer log.HandlePanic() + defer wg.Done() + select { + case <-abortCtx.Done(): + return + case <-time.After(500 * time.Millisecond): + } + rep, err := slow.Invoke(abortCtx) + if err == nil { + reps[0] = rep + logger.Debug("Received response via grpc", "type", slow.Type()) + cancel() + } else { + logger.Debug("Failed to receive on grpc", "type", slow.Type(), "err", err) + } + errs[1] = err + }() + + wg.Wait() + + var zero R + switch { + // Both requests failed. + case errs[0] != nil && errs[1] != nil: + return zero, serrors.List(errs[:]).ToError() + // Fast request failed. Return slow. + case errs[0] != nil: + return reps[1], nil + // Fast succeeded. Return fast (even if slow succeeded too) + default: + return reps[0], nil + } +} diff --git a/pkg/connect/server.go b/pkg/connect/server.go new file mode 100644 index 0000000000..e20bc34805 --- /dev/null +++ b/pkg/connect/server.go @@ -0,0 +1,81 @@ +package connect + +import ( + "context" + "net" + "net/http" + "net/netip" + + "github.com/quic-go/quic-go" + "github.com/quic-go/quic-go/http3" + "google.golang.org/grpc/peer" + + "github.com/scionproto/scion/pkg/log" +) + +// AttachPeer creates a middleware that attaches the remote address to the +// context with the grpc-go peer mechanism. +func AttachPeer(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + logger := log.FromCtx(r.Context()) + if addr, ok := r.Context().Value(http3.RemoteAddrContextKey).(net.Addr); ok { + logger.Debug("HTTP3 request", "remote", addr) + ctx := peer.NewContext(r.Context(), &peer.Peer{Addr: addr}) + r = r.WithContext(ctx) + } else if addrPort, err := netip.ParseAddrPort(r.RemoteAddr); err == nil { + logger.Debug("HTTP request", "remote", addrPort) + tcpAddr := net.TCPAddrFromAddrPort(addrPort) + ctx := peer.NewContext(r.Context(), &peer.Peer{Addr: tcpAddr}) + r = r.WithContext(ctx) + } + next.ServeHTTP(w, r) + }) + +} + +type QUICConnServer interface { + ServeQUICConn(conn quic.Connection) error +} + +type QUICConnServerFunc func(conn quic.Connection) error + +func (f QUICConnServerFunc) ServeQUICConn(conn quic.Connection) error { + return f(conn) +} + +type ConnectionDispatcher struct { + Listener *quic.Listener + Connect QUICConnServer + Grpc QUICConnServer + Error func(error) +} + +// Run accepts connections and dispatches them to the appropriate server +// handler. +func (d ConnectionDispatcher) Run(ctx context.Context) error { + for { + conn, err := d.Listener.Accept(ctx) + if err == quic.ErrServerClosed { + return http.ErrServerClosed + } + if err != nil { + // If the context has been canceled, we do not report an error. + if ctx.Err() != nil { + return nil + } + return err + } + go func() { + defer log.HandlePanic() + if conn.ConnectionState().TLS.NegotiatedProtocol == "h3" { + if err := d.Connect.ServeQUICConn(conn); err != nil { + d.Error(err) + } + } else { + if err := d.Grpc.ServeQUICConn(conn); err != nil { + d.Error(err) + } + } + }() + } +} diff --git a/pkg/proto/control_plane/v1/control_planeconnect/BUILD.bazel b/pkg/proto/control_plane/v1/control_planeconnect/BUILD.bazel index 8b99864ab3..5b5609df85 100644 --- a/pkg/proto/control_plane/v1/control_planeconnect/BUILD.bazel +++ b/pkg/proto/control_plane/v1/control_planeconnect/BUILD.bazel @@ -1,12 +1,29 @@ +<<<<<<< HEAD load("//tools/proto:connect.bzl", "go_connect_library") go_connect_library( name = "go_default_library", files = [ +======= +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ +>>>>>>> 244e9b483 (THE GRAND MERGE) "cppki.connect.go", "drkey.connect.go", "renewal.connect.go", "seg.connect.go", ], +<<<<<<< HEAD proto = "control_plane", +======= + importpath = "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/control_plane:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +>>>>>>> 244e9b483 (THE GRAND MERGE) ) diff --git a/pkg/proto/control_plane/v1/control_planeconnect/cppki.connect.go b/pkg/proto/control_plane/v1/control_planeconnect/cppki.connect.go index 862e8a8fa5..7f71918e1e 100644 --- a/pkg/proto/control_plane/v1/control_planeconnect/cppki.connect.go +++ b/pkg/proto/control_plane/v1/control_planeconnect/cppki.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/control_plane/v1/cppki.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // TrustMaterialServiceName is the fully-qualified name of the TrustMaterialService service. @@ -44,7 +65,13 @@ const ( // TrustMaterialServiceClient is a client for the proto.control_plane.v1.TrustMaterialService // service. type TrustMaterialServiceClient interface { +<<<<<<< HEAD + Chains(context.Context, *connect.Request[control_plane.ChainsRequest]) (*connect.Response[control_plane.ChainsResponse], error) +======= + // Return the certificate chains that match the request. Chains(context.Context, *connect.Request[control_plane.ChainsRequest]) (*connect.Response[control_plane.ChainsResponse], error) + // Return a specific TRC that matches the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) TRC(context.Context, *connect.Request[control_plane.TRCRequest]) (*connect.Response[control_plane.TRCResponse], error) } @@ -58,19 +85,30 @@ type TrustMaterialServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewTrustMaterialServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TrustMaterialServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD trustMaterialServiceMethods := control_plane.File_proto_control_plane_v1_cppki_proto.Services().ByName("TrustMaterialService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &trustMaterialServiceClient{ chains: connect.NewClient[control_plane.ChainsRequest, control_plane.ChainsResponse]( httpClient, baseURL+TrustMaterialServiceChainsProcedure, +<<<<<<< HEAD connect.WithSchema(trustMaterialServiceMethods.ByName("Chains")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), tRC: connect.NewClient[control_plane.TRCRequest, control_plane.TRCResponse]( httpClient, baseURL+TrustMaterialServiceTRCProcedure, +<<<<<<< HEAD connect.WithSchema(trustMaterialServiceMethods.ByName("TRC")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -94,7 +132,13 @@ func (c *trustMaterialServiceClient) TRC(ctx context.Context, req *connect.Reque // TrustMaterialServiceHandler is an implementation of the // proto.control_plane.v1.TrustMaterialService service. type TrustMaterialServiceHandler interface { +<<<<<<< HEAD Chains(context.Context, *connect.Request[control_plane.ChainsRequest]) (*connect.Response[control_plane.ChainsResponse], error) +======= + // Return the certificate chains that match the request. + Chains(context.Context, *connect.Request[control_plane.ChainsRequest]) (*connect.Response[control_plane.ChainsResponse], error) + // Return a specific TRC that matches the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) TRC(context.Context, *connect.Request[control_plane.TRCRequest]) (*connect.Response[control_plane.TRCResponse], error) } @@ -104,18 +148,29 @@ type TrustMaterialServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewTrustMaterialServiceHandler(svc TrustMaterialServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD trustMaterialServiceMethods := control_plane.File_proto_control_plane_v1_cppki_proto.Services().ByName("TrustMaterialService").Methods() trustMaterialServiceChainsHandler := connect.NewUnaryHandler( TrustMaterialServiceChainsProcedure, svc.Chains, connect.WithSchema(trustMaterialServiceMethods.ByName("Chains")), connect.WithHandlerOptions(opts...), +======= + trustMaterialServiceChainsHandler := connect.NewUnaryHandler( + TrustMaterialServiceChainsProcedure, + svc.Chains, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) trustMaterialServiceTRCHandler := connect.NewUnaryHandler( TrustMaterialServiceTRCProcedure, svc.TRC, +<<<<<<< HEAD connect.WithSchema(trustMaterialServiceMethods.ByName("TRC")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.TrustMaterialService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/control_plane/v1/control_planeconnect/drkey.connect.go b/pkg/proto/control_plane/v1/control_planeconnect/drkey.connect.go index e3dc300f25..d381cd3112 100644 --- a/pkg/proto/control_plane/v1/control_planeconnect/drkey.connect.go +++ b/pkg/proto/control_plane/v1/control_planeconnect/drkey.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2022 ETH Zurich +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/control_plane/v1/drkey.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // DRKeyInterServiceName is the fully-qualified name of the DRKeyInterService service. @@ -57,6 +78,10 @@ const ( // DRKeyInterServiceClient is a client for the proto.control_plane.v1.DRKeyInterService service. type DRKeyInterServiceClient interface { +<<<<<<< HEAD +======= + // Return the Level1Key that matches the request +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeyLevel1(context.Context, *connect.Request[control_plane.DRKeyLevel1Request]) (*connect.Response[control_plane.DRKeyLevel1Response], error) } @@ -69,13 +94,20 @@ type DRKeyInterServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewDRKeyInterServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DRKeyInterServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD dRKeyInterServiceMethods := control_plane.File_proto_control_plane_v1_drkey_proto.Services().ByName("DRKeyInterService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &dRKeyInterServiceClient{ dRKeyLevel1: connect.NewClient[control_plane.DRKeyLevel1Request, control_plane.DRKeyLevel1Response]( httpClient, baseURL+DRKeyInterServiceDRKeyLevel1Procedure, +<<<<<<< HEAD connect.WithSchema(dRKeyInterServiceMethods.ByName("DRKeyLevel1")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -93,6 +125,10 @@ func (c *dRKeyInterServiceClient) DRKeyLevel1(ctx context.Context, req *connect. // DRKeyInterServiceHandler is an implementation of the proto.control_plane.v1.DRKeyInterService // service. type DRKeyInterServiceHandler interface { +<<<<<<< HEAD +======= + // Return the Level1Key that matches the request +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeyLevel1(context.Context, *connect.Request[control_plane.DRKeyLevel1Request]) (*connect.Response[control_plane.DRKeyLevel1Response], error) } @@ -102,12 +138,19 @@ type DRKeyInterServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewDRKeyInterServiceHandler(svc DRKeyInterServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD dRKeyInterServiceMethods := control_plane.File_proto_control_plane_v1_drkey_proto.Services().ByName("DRKeyInterService").Methods() dRKeyInterServiceDRKeyLevel1Handler := connect.NewUnaryHandler( DRKeyInterServiceDRKeyLevel1Procedure, svc.DRKeyLevel1, connect.WithSchema(dRKeyInterServiceMethods.ByName("DRKeyLevel1")), connect.WithHandlerOptions(opts...), +======= + dRKeyInterServiceDRKeyLevel1Handler := connect.NewUnaryHandler( + DRKeyInterServiceDRKeyLevel1Procedure, + svc.DRKeyLevel1, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.DRKeyInterService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -128,10 +171,22 @@ func (UnimplementedDRKeyInterServiceHandler) DRKeyLevel1(context.Context, *conne // DRKeyIntraServiceClient is a client for the proto.control_plane.v1.DRKeyIntraService service. type DRKeyIntraServiceClient interface { +<<<<<<< HEAD + DRKeyIntraLevel1(context.Context, *connect.Request[control_plane.DRKeyIntraLevel1Request]) (*connect.Response[control_plane.DRKeyIntraLevel1Response], error) + DRKeyASHost(context.Context, *connect.Request[control_plane.DRKeyASHostRequest]) (*connect.Response[control_plane.DRKeyASHostResponse], error) + DRKeyHostAS(context.Context, *connect.Request[control_plane.DRKeyHostASRequest]) (*connect.Response[control_plane.DRKeyHostASResponse], error) + DRKeyHostHost(context.Context, *connect.Request[control_plane.DRKeyHostHostRequest]) (*connect.Response[control_plane.DRKeyHostHostResponse], error) +======= + // Return the ASAS that matches the request DRKeyIntraLevel1(context.Context, *connect.Request[control_plane.DRKeyIntraLevel1Request]) (*connect.Response[control_plane.DRKeyIntraLevel1Response], error) + // Return the AS-Host that matches the request DRKeyASHost(context.Context, *connect.Request[control_plane.DRKeyASHostRequest]) (*connect.Response[control_plane.DRKeyASHostResponse], error) + // Return the Host-AS that matches the request DRKeyHostAS(context.Context, *connect.Request[control_plane.DRKeyHostASRequest]) (*connect.Response[control_plane.DRKeyHostASResponse], error) + // Return the Host-Host that matches the request DRKeyHostHost(context.Context, *connect.Request[control_plane.DRKeyHostHostRequest]) (*connect.Response[control_plane.DRKeyHostHostResponse], error) + // Return the SecretValue that matches the request +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeySecretValue(context.Context, *connect.Request[control_plane.DRKeySecretValueRequest]) (*connect.Response[control_plane.DRKeySecretValueResponse], error) } @@ -144,37 +199,60 @@ type DRKeyIntraServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewDRKeyIntraServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DRKeyIntraServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD dRKeyIntraServiceMethods := control_plane.File_proto_control_plane_v1_drkey_proto.Services().ByName("DRKeyIntraService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &dRKeyIntraServiceClient{ dRKeyIntraLevel1: connect.NewClient[control_plane.DRKeyIntraLevel1Request, control_plane.DRKeyIntraLevel1Response]( httpClient, baseURL+DRKeyIntraServiceDRKeyIntraLevel1Procedure, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyIntraLevel1")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyASHost: connect.NewClient[control_plane.DRKeyASHostRequest, control_plane.DRKeyASHostResponse]( httpClient, baseURL+DRKeyIntraServiceDRKeyASHostProcedure, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyASHost")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyHostAS: connect.NewClient[control_plane.DRKeyHostASRequest, control_plane.DRKeyHostASResponse]( httpClient, baseURL+DRKeyIntraServiceDRKeyHostASProcedure, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyHostAS")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyHostHost: connect.NewClient[control_plane.DRKeyHostHostRequest, control_plane.DRKeyHostHostResponse]( httpClient, baseURL+DRKeyIntraServiceDRKeyHostHostProcedure, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyHostHost")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeySecretValue: connect.NewClient[control_plane.DRKeySecretValueRequest, control_plane.DRKeySecretValueResponse]( httpClient, baseURL+DRKeyIntraServiceDRKeySecretValueProcedure, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeySecretValue")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -216,10 +294,22 @@ func (c *dRKeyIntraServiceClient) DRKeySecretValue(ctx context.Context, req *con // DRKeyIntraServiceHandler is an implementation of the proto.control_plane.v1.DRKeyIntraService // service. type DRKeyIntraServiceHandler interface { +<<<<<<< HEAD DRKeyIntraLevel1(context.Context, *connect.Request[control_plane.DRKeyIntraLevel1Request]) (*connect.Response[control_plane.DRKeyIntraLevel1Response], error) DRKeyASHost(context.Context, *connect.Request[control_plane.DRKeyASHostRequest]) (*connect.Response[control_plane.DRKeyASHostResponse], error) DRKeyHostAS(context.Context, *connect.Request[control_plane.DRKeyHostASRequest]) (*connect.Response[control_plane.DRKeyHostASResponse], error) DRKeyHostHost(context.Context, *connect.Request[control_plane.DRKeyHostHostRequest]) (*connect.Response[control_plane.DRKeyHostHostResponse], error) +======= + // Return the ASAS that matches the request + DRKeyIntraLevel1(context.Context, *connect.Request[control_plane.DRKeyIntraLevel1Request]) (*connect.Response[control_plane.DRKeyIntraLevel1Response], error) + // Return the AS-Host that matches the request + DRKeyASHost(context.Context, *connect.Request[control_plane.DRKeyASHostRequest]) (*connect.Response[control_plane.DRKeyASHostResponse], error) + // Return the Host-AS that matches the request + DRKeyHostAS(context.Context, *connect.Request[control_plane.DRKeyHostASRequest]) (*connect.Response[control_plane.DRKeyHostASResponse], error) + // Return the Host-Host that matches the request + DRKeyHostHost(context.Context, *connect.Request[control_plane.DRKeyHostHostRequest]) (*connect.Response[control_plane.DRKeyHostHostResponse], error) + // Return the SecretValue that matches the request +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeySecretValue(context.Context, *connect.Request[control_plane.DRKeySecretValueRequest]) (*connect.Response[control_plane.DRKeySecretValueResponse], error) } @@ -229,36 +319,59 @@ type DRKeyIntraServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewDRKeyIntraServiceHandler(svc DRKeyIntraServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD dRKeyIntraServiceMethods := control_plane.File_proto_control_plane_v1_drkey_proto.Services().ByName("DRKeyIntraService").Methods() dRKeyIntraServiceDRKeyIntraLevel1Handler := connect.NewUnaryHandler( DRKeyIntraServiceDRKeyIntraLevel1Procedure, svc.DRKeyIntraLevel1, connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyIntraLevel1")), connect.WithHandlerOptions(opts...), +======= + dRKeyIntraServiceDRKeyIntraLevel1Handler := connect.NewUnaryHandler( + DRKeyIntraServiceDRKeyIntraLevel1Procedure, + svc.DRKeyIntraLevel1, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) dRKeyIntraServiceDRKeyASHostHandler := connect.NewUnaryHandler( DRKeyIntraServiceDRKeyASHostProcedure, svc.DRKeyASHost, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyASHost")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) dRKeyIntraServiceDRKeyHostASHandler := connect.NewUnaryHandler( DRKeyIntraServiceDRKeyHostASProcedure, svc.DRKeyHostAS, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyHostAS")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) dRKeyIntraServiceDRKeyHostHostHandler := connect.NewUnaryHandler( DRKeyIntraServiceDRKeyHostHostProcedure, svc.DRKeyHostHost, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeyHostHost")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) dRKeyIntraServiceDRKeySecretValueHandler := connect.NewUnaryHandler( DRKeyIntraServiceDRKeySecretValueProcedure, svc.DRKeySecretValue, +<<<<<<< HEAD connect.WithSchema(dRKeyIntraServiceMethods.ByName("DRKeySecretValue")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.DRKeyIntraService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/control_plane/v1/control_planeconnect/renewal.connect.go b/pkg/proto/control_plane/v1/control_planeconnect/renewal.connect.go index 6edb373516..86ee985307 100644 --- a/pkg/proto/control_plane/v1/control_planeconnect/renewal.connect.go +++ b/pkg/proto/control_plane/v1/control_planeconnect/renewal.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/control_plane/v1/renewal.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // ChainRenewalServiceName is the fully-qualified name of the ChainRenewalService service. @@ -40,6 +61,10 @@ const ( // ChainRenewalServiceClient is a client for the proto.control_plane.v1.ChainRenewalService service. type ChainRenewalServiceClient interface { +<<<<<<< HEAD +======= + // RenewChain creates a chain from the chain request. +>>>>>>> 244e9b483 (THE GRAND MERGE) ChainRenewal(context.Context, *connect.Request[control_plane.ChainRenewalRequest]) (*connect.Response[control_plane.ChainRenewalResponse], error) } @@ -52,13 +77,20 @@ type ChainRenewalServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewChainRenewalServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ChainRenewalServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD chainRenewalServiceMethods := control_plane.File_proto_control_plane_v1_renewal_proto.Services().ByName("ChainRenewalService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &chainRenewalServiceClient{ chainRenewal: connect.NewClient[control_plane.ChainRenewalRequest, control_plane.ChainRenewalResponse]( httpClient, baseURL+ChainRenewalServiceChainRenewalProcedure, +<<<<<<< HEAD connect.WithSchema(chainRenewalServiceMethods.ByName("ChainRenewal")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -76,6 +108,10 @@ func (c *chainRenewalServiceClient) ChainRenewal(ctx context.Context, req *conne // ChainRenewalServiceHandler is an implementation of the proto.control_plane.v1.ChainRenewalService // service. type ChainRenewalServiceHandler interface { +<<<<<<< HEAD +======= + // RenewChain creates a chain from the chain request. +>>>>>>> 244e9b483 (THE GRAND MERGE) ChainRenewal(context.Context, *connect.Request[control_plane.ChainRenewalRequest]) (*connect.Response[control_plane.ChainRenewalResponse], error) } @@ -85,12 +121,19 @@ type ChainRenewalServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewChainRenewalServiceHandler(svc ChainRenewalServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD chainRenewalServiceMethods := control_plane.File_proto_control_plane_v1_renewal_proto.Services().ByName("ChainRenewalService").Methods() chainRenewalServiceChainRenewalHandler := connect.NewUnaryHandler( ChainRenewalServiceChainRenewalProcedure, svc.ChainRenewal, connect.WithSchema(chainRenewalServiceMethods.ByName("ChainRenewal")), connect.WithHandlerOptions(opts...), +======= + chainRenewalServiceChainRenewalHandler := connect.NewUnaryHandler( + ChainRenewalServiceChainRenewalProcedure, + svc.ChainRenewal, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.ChainRenewalService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/control_plane/v1/control_planeconnect/seg.connect.go b/pkg/proto/control_plane/v1/control_planeconnect/seg.connect.go index b0058a7f67..3236affac0 100644 --- a/pkg/proto/control_plane/v1/control_planeconnect/seg.connect.go +++ b/pkg/proto/control_plane/v1/control_planeconnect/seg.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/control_plane/v1/seg.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // SegmentLookupServiceName is the fully-qualified name of the SegmentLookupService service. @@ -52,6 +73,10 @@ const ( // SegmentLookupServiceClient is a client for the proto.control_plane.v1.SegmentLookupService // service. type SegmentLookupServiceClient interface { +<<<<<<< HEAD +======= + // Segments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) Segments(context.Context, *connect.Request[control_plane.SegmentsRequest]) (*connect.Response[control_plane.SegmentsResponse], error) } @@ -65,13 +90,20 @@ type SegmentLookupServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewSegmentLookupServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SegmentLookupServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD segmentLookupServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentLookupService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &segmentLookupServiceClient{ segments: connect.NewClient[control_plane.SegmentsRequest, control_plane.SegmentsResponse]( httpClient, baseURL+SegmentLookupServiceSegmentsProcedure, +<<<<<<< HEAD connect.WithSchema(segmentLookupServiceMethods.ByName("Segments")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -89,6 +121,10 @@ func (c *segmentLookupServiceClient) Segments(ctx context.Context, req *connect. // SegmentLookupServiceHandler is an implementation of the // proto.control_plane.v1.SegmentLookupService service. type SegmentLookupServiceHandler interface { +<<<<<<< HEAD +======= + // Segments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) Segments(context.Context, *connect.Request[control_plane.SegmentsRequest]) (*connect.Response[control_plane.SegmentsResponse], error) } @@ -98,12 +134,19 @@ type SegmentLookupServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewSegmentLookupServiceHandler(svc SegmentLookupServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD segmentLookupServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentLookupService").Methods() segmentLookupServiceSegmentsHandler := connect.NewUnaryHandler( SegmentLookupServiceSegmentsProcedure, svc.Segments, connect.WithSchema(segmentLookupServiceMethods.ByName("Segments")), connect.WithHandlerOptions(opts...), +======= + segmentLookupServiceSegmentsHandler := connect.NewUnaryHandler( + SegmentLookupServiceSegmentsProcedure, + svc.Segments, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.SegmentLookupService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -125,6 +168,10 @@ func (UnimplementedSegmentLookupServiceHandler) Segments(context.Context, *conne // SegmentRegistrationServiceClient is a client for the // proto.control_plane.v1.SegmentRegistrationService service. type SegmentRegistrationServiceClient interface { +<<<<<<< HEAD +======= + // SegmentsRegistration registers segments at the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) SegmentsRegistration(context.Context, *connect.Request[control_plane.SegmentsRegistrationRequest]) (*connect.Response[control_plane.SegmentsRegistrationResponse], error) } @@ -138,13 +185,20 @@ type SegmentRegistrationServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewSegmentRegistrationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SegmentRegistrationServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD segmentRegistrationServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentRegistrationService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &segmentRegistrationServiceClient{ segmentsRegistration: connect.NewClient[control_plane.SegmentsRegistrationRequest, control_plane.SegmentsRegistrationResponse]( httpClient, baseURL+SegmentRegistrationServiceSegmentsRegistrationProcedure, +<<<<<<< HEAD connect.WithSchema(segmentRegistrationServiceMethods.ByName("SegmentsRegistration")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -163,6 +217,10 @@ func (c *segmentRegistrationServiceClient) SegmentsRegistration(ctx context.Cont // SegmentRegistrationServiceHandler is an implementation of the // proto.control_plane.v1.SegmentRegistrationService service. type SegmentRegistrationServiceHandler interface { +<<<<<<< HEAD +======= + // SegmentsRegistration registers segments at the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) SegmentsRegistration(context.Context, *connect.Request[control_plane.SegmentsRegistrationRequest]) (*connect.Response[control_plane.SegmentsRegistrationResponse], error) } @@ -172,12 +230,19 @@ type SegmentRegistrationServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewSegmentRegistrationServiceHandler(svc SegmentRegistrationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD segmentRegistrationServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentRegistrationService").Methods() segmentRegistrationServiceSegmentsRegistrationHandler := connect.NewUnaryHandler( SegmentRegistrationServiceSegmentsRegistrationProcedure, svc.SegmentsRegistration, connect.WithSchema(segmentRegistrationServiceMethods.ByName("SegmentsRegistration")), connect.WithHandlerOptions(opts...), +======= + segmentRegistrationServiceSegmentsRegistrationHandler := connect.NewUnaryHandler( + SegmentRegistrationServiceSegmentsRegistrationProcedure, + svc.SegmentsRegistration, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.SegmentRegistrationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -199,6 +264,10 @@ func (UnimplementedSegmentRegistrationServiceHandler) SegmentsRegistration(conte // SegmentCreationServiceClient is a client for the proto.control_plane.v1.SegmentCreationService // service. type SegmentCreationServiceClient interface { +<<<<<<< HEAD +======= + // Beacon sends a beacon to the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) Beacon(context.Context, *connect.Request[control_plane.BeaconRequest]) (*connect.Response[control_plane.BeaconResponse], error) } @@ -212,13 +281,20 @@ type SegmentCreationServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewSegmentCreationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SegmentCreationServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD segmentCreationServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentCreationService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &segmentCreationServiceClient{ beacon: connect.NewClient[control_plane.BeaconRequest, control_plane.BeaconResponse]( httpClient, baseURL+SegmentCreationServiceBeaconProcedure, +<<<<<<< HEAD connect.WithSchema(segmentCreationServiceMethods.ByName("Beacon")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -236,6 +312,10 @@ func (c *segmentCreationServiceClient) Beacon(ctx context.Context, req *connect. // SegmentCreationServiceHandler is an implementation of the // proto.control_plane.v1.SegmentCreationService service. type SegmentCreationServiceHandler interface { +<<<<<<< HEAD +======= + // Beacon sends a beacon to the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) Beacon(context.Context, *connect.Request[control_plane.BeaconRequest]) (*connect.Response[control_plane.BeaconResponse], error) } @@ -245,12 +325,19 @@ type SegmentCreationServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewSegmentCreationServiceHandler(svc SegmentCreationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD segmentCreationServiceMethods := control_plane.File_proto_control_plane_v1_seg_proto.Services().ByName("SegmentCreationService").Methods() segmentCreationServiceBeaconHandler := connect.NewUnaryHandler( SegmentCreationServiceBeaconProcedure, svc.Beacon, connect.WithSchema(segmentCreationServiceMethods.ByName("Beacon")), connect.WithHandlerOptions(opts...), +======= + segmentCreationServiceBeaconHandler := connect.NewUnaryHandler( + SegmentCreationServiceBeaconProcedure, + svc.Beacon, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.control_plane.v1.SegmentCreationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/daemon/v1/daemonconnect/BUILD.bazel b/pkg/proto/daemon/v1/daemonconnect/BUILD.bazel index 873a53ceab..7500bffa30 100644 --- a/pkg/proto/daemon/v1/daemonconnect/BUILD.bazel +++ b/pkg/proto/daemon/v1/daemonconnect/BUILD.bazel @@ -1,6 +1,20 @@ +<<<<<<< HEAD load("//tools/proto:connect.bzl", "go_connect_library") go_connect_library( name = "go_default_library", proto = "daemon", +======= +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["daemon.connect.go"], + importpath = "github.com/scionproto/scion/pkg/proto/daemon/v1/daemonconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/daemon:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +>>>>>>> 244e9b483 (THE GRAND MERGE) ) diff --git a/pkg/proto/daemon/v1/daemonconnect/daemon.connect.go b/pkg/proto/daemon/v1/daemonconnect/daemon.connect.go index 84e87c3486..2b0afc6f46 100644 --- a/pkg/proto/daemon/v1/daemonconnect/daemon.connect.go +++ b/pkg/proto/daemon/v1/daemonconnect/daemon.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/daemon/v1/daemon.proto @@ -9,7 +26,10 @@ import ( context "context" errors "errors" daemon "github.com/scionproto/scion/pkg/proto/daemon" +<<<<<<< HEAD emptypb "google.golang.org/protobuf/types/known/emptypb" +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) http "net/http" strings "strings" ) @@ -19,7 +39,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // DaemonServiceName is the fully-qualified name of the DaemonService service. @@ -46,8 +70,11 @@ const ( // DaemonServiceNotifyInterfaceDownProcedure is the fully-qualified name of the DaemonService's // NotifyInterfaceDown RPC. DaemonServiceNotifyInterfaceDownProcedure = "/proto.daemon.v1.DaemonService/NotifyInterfaceDown" +<<<<<<< HEAD // DaemonServicePortRangeProcedure is the fully-qualified name of the DaemonService's PortRange RPC. DaemonServicePortRangeProcedure = "/proto.daemon.v1.DaemonService/PortRange" +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) // DaemonServiceDRKeyASHostProcedure is the fully-qualified name of the DaemonService's DRKeyASHost // RPC. DaemonServiceDRKeyASHostProcedure = "/proto.daemon.v1.DaemonService/DRKeyASHost" @@ -61,6 +88,7 @@ const ( // DaemonServiceClient is a client for the proto.daemon.v1.DaemonService service. type DaemonServiceClient interface { +<<<<<<< HEAD Paths(context.Context, *connect.Request[daemon.PathsRequest]) (*connect.Response[daemon.PathsResponse], error) AS(context.Context, *connect.Request[daemon.ASRequest]) (*connect.Response[daemon.ASResponse], error) Interfaces(context.Context, *connect.Request[daemon.InterfacesRequest]) (*connect.Response[daemon.InterfacesResponse], error) @@ -69,6 +97,25 @@ type DaemonServiceClient interface { PortRange(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[daemon.PortRangeResponse], error) DRKeyASHost(context.Context, *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) DRKeyHostAS(context.Context, *connect.Request[daemon.DRKeyHostASRequest]) (*connect.Response[daemon.DRKeyHostASResponse], error) +======= + // Return a set of paths to the requested destination. + Paths(context.Context, *connect.Request[daemon.PathsRequest]) (*connect.Response[daemon.PathsResponse], error) + // Return information about an AS. + AS(context.Context, *connect.Request[daemon.ASRequest]) (*connect.Response[daemon.ASResponse], error) + // Return the underlay addresses associated with + // the specified interfaces. + Interfaces(context.Context, *connect.Request[daemon.InterfacesRequest]) (*connect.Response[daemon.InterfacesResponse], error) + // Return the underlay addresses associated with the + // specified services. + Services(context.Context, *connect.Request[daemon.ServicesRequest]) (*connect.Response[daemon.ServicesResponse], error) + // Inform the SCION Daemon of a revocation. + NotifyInterfaceDown(context.Context, *connect.Request[daemon.NotifyInterfaceDownRequest]) (*connect.Response[daemon.NotifyInterfaceDownResponse], error) + // DRKeyASHost returns a key that matches the request. + DRKeyASHost(context.Context, *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) + // DRKeyHostAS returns a key that matches the request. + DRKeyHostAS(context.Context, *connect.Request[daemon.DRKeyHostASRequest]) (*connect.Response[daemon.DRKeyHostASResponse], error) + // DRKeyHostHost returns a key that matches the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeyHostHost(context.Context, *connect.Request[daemon.DRKeyHostHostRequest]) (*connect.Response[daemon.DRKeyHostHostResponse], error) } @@ -81,35 +128,55 @@ type DaemonServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewDaemonServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DaemonServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD daemonServiceMethods := daemon.File_proto_daemon_v1_daemon_proto.Services().ByName("DaemonService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &daemonServiceClient{ paths: connect.NewClient[daemon.PathsRequest, daemon.PathsResponse]( httpClient, baseURL+DaemonServicePathsProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("Paths")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), aS: connect.NewClient[daemon.ASRequest, daemon.ASResponse]( httpClient, baseURL+DaemonServiceASProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("AS")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), interfaces: connect.NewClient[daemon.InterfacesRequest, daemon.InterfacesResponse]( httpClient, baseURL+DaemonServiceInterfacesProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("Interfaces")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), services: connect.NewClient[daemon.ServicesRequest, daemon.ServicesResponse]( httpClient, baseURL+DaemonServiceServicesProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("Services")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), notifyInterfaceDown: connect.NewClient[daemon.NotifyInterfaceDownRequest, daemon.NotifyInterfaceDownResponse]( httpClient, baseURL+DaemonServiceNotifyInterfaceDownProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("NotifyInterfaceDown")), connect.WithClientOptions(opts...), ), @@ -118,24 +185,39 @@ func NewDaemonServiceClient(httpClient connect.HTTPClient, baseURL string, opts baseURL+DaemonServicePortRangeProcedure, connect.WithSchema(daemonServiceMethods.ByName("PortRange")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyASHost: connect.NewClient[daemon.DRKeyASHostRequest, daemon.DRKeyASHostResponse]( httpClient, baseURL+DaemonServiceDRKeyASHostProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyASHost")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyHostAS: connect.NewClient[daemon.DRKeyHostASRequest, daemon.DRKeyHostASResponse]( httpClient, baseURL+DaemonServiceDRKeyHostASProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyHostAS")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), dRKeyHostHost: connect.NewClient[daemon.DRKeyHostHostRequest, daemon.DRKeyHostHostResponse]( httpClient, baseURL+DaemonServiceDRKeyHostHostProcedure, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyHostHost")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -147,7 +229,10 @@ type daemonServiceClient struct { interfaces *connect.Client[daemon.InterfacesRequest, daemon.InterfacesResponse] services *connect.Client[daemon.ServicesRequest, daemon.ServicesResponse] notifyInterfaceDown *connect.Client[daemon.NotifyInterfaceDownRequest, daemon.NotifyInterfaceDownResponse] +<<<<<<< HEAD portRange *connect.Client[emptypb.Empty, daemon.PortRangeResponse] +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) dRKeyASHost *connect.Client[daemon.DRKeyASHostRequest, daemon.DRKeyASHostResponse] dRKeyHostAS *connect.Client[daemon.DRKeyHostASRequest, daemon.DRKeyHostASResponse] dRKeyHostHost *connect.Client[daemon.DRKeyHostHostRequest, daemon.DRKeyHostHostResponse] @@ -178,11 +263,14 @@ func (c *daemonServiceClient) NotifyInterfaceDown(ctx context.Context, req *conn return c.notifyInterfaceDown.CallUnary(ctx, req) } +<<<<<<< HEAD // PortRange calls proto.daemon.v1.DaemonService.PortRange. func (c *daemonServiceClient) PortRange(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[daemon.PortRangeResponse], error) { return c.portRange.CallUnary(ctx, req) } +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) // DRKeyASHost calls proto.daemon.v1.DaemonService.DRKeyASHost. func (c *daemonServiceClient) DRKeyASHost(ctx context.Context, req *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) { return c.dRKeyASHost.CallUnary(ctx, req) @@ -200,6 +288,7 @@ func (c *daemonServiceClient) DRKeyHostHost(ctx context.Context, req *connect.Re // DaemonServiceHandler is an implementation of the proto.daemon.v1.DaemonService service. type DaemonServiceHandler interface { +<<<<<<< HEAD Paths(context.Context, *connect.Request[daemon.PathsRequest]) (*connect.Response[daemon.PathsResponse], error) AS(context.Context, *connect.Request[daemon.ASRequest]) (*connect.Response[daemon.ASResponse], error) Interfaces(context.Context, *connect.Request[daemon.InterfacesRequest]) (*connect.Response[daemon.InterfacesResponse], error) @@ -208,6 +297,25 @@ type DaemonServiceHandler interface { PortRange(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[daemon.PortRangeResponse], error) DRKeyASHost(context.Context, *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) DRKeyHostAS(context.Context, *connect.Request[daemon.DRKeyHostASRequest]) (*connect.Response[daemon.DRKeyHostASResponse], error) +======= + // Return a set of paths to the requested destination. + Paths(context.Context, *connect.Request[daemon.PathsRequest]) (*connect.Response[daemon.PathsResponse], error) + // Return information about an AS. + AS(context.Context, *connect.Request[daemon.ASRequest]) (*connect.Response[daemon.ASResponse], error) + // Return the underlay addresses associated with + // the specified interfaces. + Interfaces(context.Context, *connect.Request[daemon.InterfacesRequest]) (*connect.Response[daemon.InterfacesResponse], error) + // Return the underlay addresses associated with the + // specified services. + Services(context.Context, *connect.Request[daemon.ServicesRequest]) (*connect.Response[daemon.ServicesResponse], error) + // Inform the SCION Daemon of a revocation. + NotifyInterfaceDown(context.Context, *connect.Request[daemon.NotifyInterfaceDownRequest]) (*connect.Response[daemon.NotifyInterfaceDownResponse], error) + // DRKeyASHost returns a key that matches the request. + DRKeyASHost(context.Context, *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) + // DRKeyHostAS returns a key that matches the request. + DRKeyHostAS(context.Context, *connect.Request[daemon.DRKeyHostASRequest]) (*connect.Response[daemon.DRKeyHostASResponse], error) + // DRKeyHostHost returns a key that matches the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) DRKeyHostHost(context.Context, *connect.Request[daemon.DRKeyHostHostRequest]) (*connect.Response[daemon.DRKeyHostHostResponse], error) } @@ -217,34 +325,54 @@ type DaemonServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewDaemonServiceHandler(svc DaemonServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD daemonServiceMethods := daemon.File_proto_daemon_v1_daemon_proto.Services().ByName("DaemonService").Methods() daemonServicePathsHandler := connect.NewUnaryHandler( DaemonServicePathsProcedure, svc.Paths, connect.WithSchema(daemonServiceMethods.ByName("Paths")), connect.WithHandlerOptions(opts...), +======= + daemonServicePathsHandler := connect.NewUnaryHandler( + DaemonServicePathsProcedure, + svc.Paths, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceASHandler := connect.NewUnaryHandler( DaemonServiceASProcedure, svc.AS, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("AS")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceInterfacesHandler := connect.NewUnaryHandler( DaemonServiceInterfacesProcedure, svc.Interfaces, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("Interfaces")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceServicesHandler := connect.NewUnaryHandler( DaemonServiceServicesProcedure, svc.Services, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("Services")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceNotifyInterfaceDownHandler := connect.NewUnaryHandler( DaemonServiceNotifyInterfaceDownProcedure, svc.NotifyInterfaceDown, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("NotifyInterfaceDown")), connect.WithHandlerOptions(opts...), ) @@ -253,24 +381,39 @@ func NewDaemonServiceHandler(svc DaemonServiceHandler, opts ...connect.HandlerOp svc.PortRange, connect.WithSchema(daemonServiceMethods.ByName("PortRange")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceDRKeyASHostHandler := connect.NewUnaryHandler( DaemonServiceDRKeyASHostProcedure, svc.DRKeyASHost, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyASHost")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceDRKeyHostASHandler := connect.NewUnaryHandler( DaemonServiceDRKeyHostASProcedure, svc.DRKeyHostAS, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyHostAS")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) daemonServiceDRKeyHostHostHandler := connect.NewUnaryHandler( DaemonServiceDRKeyHostHostProcedure, svc.DRKeyHostHost, +<<<<<<< HEAD connect.WithSchema(daemonServiceMethods.ByName("DRKeyHostHost")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.daemon.v1.DaemonService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -284,8 +427,11 @@ func NewDaemonServiceHandler(svc DaemonServiceHandler, opts ...connect.HandlerOp daemonServiceServicesHandler.ServeHTTP(w, r) case DaemonServiceNotifyInterfaceDownProcedure: daemonServiceNotifyInterfaceDownHandler.ServeHTTP(w, r) +<<<<<<< HEAD case DaemonServicePortRangeProcedure: daemonServicePortRangeHandler.ServeHTTP(w, r) +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) case DaemonServiceDRKeyASHostProcedure: daemonServiceDRKeyASHostHandler.ServeHTTP(w, r) case DaemonServiceDRKeyHostASProcedure: @@ -321,10 +467,13 @@ func (UnimplementedDaemonServiceHandler) NotifyInterfaceDown(context.Context, *c return nil, connect.NewError(connect.CodeUnimplemented, errors.New("proto.daemon.v1.DaemonService.NotifyInterfaceDown is not implemented")) } +<<<<<<< HEAD func (UnimplementedDaemonServiceHandler) PortRange(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[daemon.PortRangeResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("proto.daemon.v1.DaemonService.PortRange is not implemented")) } +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) func (UnimplementedDaemonServiceHandler) DRKeyASHost(context.Context, *connect.Request[daemon.DRKeyASHostRequest]) (*connect.Response[daemon.DRKeyASHostResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("proto.daemon.v1.DaemonService.DRKeyASHost is not implemented")) } diff --git a/pkg/proto/discovery/v1/discoveryconnect/BUILD.bazel b/pkg/proto/discovery/v1/discoveryconnect/BUILD.bazel index 22cc8643b8..6ff5addb21 100644 --- a/pkg/proto/discovery/v1/discoveryconnect/BUILD.bazel +++ b/pkg/proto/discovery/v1/discoveryconnect/BUILD.bazel @@ -1,6 +1,20 @@ +<<<<<<< HEAD load("//tools/proto:connect.bzl", "go_connect_library") go_connect_library( name = "go_default_library", proto = "discovery", +======= +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["discovery.connect.go"], + importpath = "github.com/scionproto/scion/pkg/proto/discovery/v1/discoveryconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/discovery:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +>>>>>>> 244e9b483 (THE GRAND MERGE) ) diff --git a/pkg/proto/discovery/v1/discoveryconnect/discovery.connect.go b/pkg/proto/discovery/v1/discoveryconnect/discovery.connect.go index 07928fc12c..1ef6e3c726 100644 --- a/pkg/proto/discovery/v1/discoveryconnect/discovery.connect.go +++ b/pkg/proto/discovery/v1/discoveryconnect/discovery.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/discovery/v1/discovery.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // DiscoveryServiceName is the fully-qualified name of the DiscoveryService service. @@ -43,7 +64,13 @@ const ( // DiscoveryServiceClient is a client for the proto.discovery.v1.DiscoveryService service. type DiscoveryServiceClient interface { +<<<<<<< HEAD + Gateways(context.Context, *connect.Request[discovery.GatewaysRequest]) (*connect.Response[discovery.GatewaysResponse], error) +======= + // Return the remote gateways. Gateways(context.Context, *connect.Request[discovery.GatewaysRequest]) (*connect.Response[discovery.GatewaysResponse], error) + // Return the hidden segment services. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegmentServices(context.Context, *connect.Request[discovery.HiddenSegmentServicesRequest]) (*connect.Response[discovery.HiddenSegmentServicesResponse], error) } @@ -56,19 +83,30 @@ type DiscoveryServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewDiscoveryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DiscoveryServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD discoveryServiceMethods := discovery.File_proto_discovery_v1_discovery_proto.Services().ByName("DiscoveryService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &discoveryServiceClient{ gateways: connect.NewClient[discovery.GatewaysRequest, discovery.GatewaysResponse]( httpClient, baseURL+DiscoveryServiceGatewaysProcedure, +<<<<<<< HEAD connect.WithSchema(discoveryServiceMethods.ByName("Gateways")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), hiddenSegmentServices: connect.NewClient[discovery.HiddenSegmentServicesRequest, discovery.HiddenSegmentServicesResponse]( httpClient, baseURL+DiscoveryServiceHiddenSegmentServicesProcedure, +<<<<<<< HEAD connect.WithSchema(discoveryServiceMethods.ByName("HiddenSegmentServices")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -91,7 +129,13 @@ func (c *discoveryServiceClient) HiddenSegmentServices(ctx context.Context, req // DiscoveryServiceHandler is an implementation of the proto.discovery.v1.DiscoveryService service. type DiscoveryServiceHandler interface { +<<<<<<< HEAD Gateways(context.Context, *connect.Request[discovery.GatewaysRequest]) (*connect.Response[discovery.GatewaysResponse], error) +======= + // Return the remote gateways. + Gateways(context.Context, *connect.Request[discovery.GatewaysRequest]) (*connect.Response[discovery.GatewaysResponse], error) + // Return the hidden segment services. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegmentServices(context.Context, *connect.Request[discovery.HiddenSegmentServicesRequest]) (*connect.Response[discovery.HiddenSegmentServicesResponse], error) } @@ -101,18 +145,29 @@ type DiscoveryServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewDiscoveryServiceHandler(svc DiscoveryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD discoveryServiceMethods := discovery.File_proto_discovery_v1_discovery_proto.Services().ByName("DiscoveryService").Methods() discoveryServiceGatewaysHandler := connect.NewUnaryHandler( DiscoveryServiceGatewaysProcedure, svc.Gateways, connect.WithSchema(discoveryServiceMethods.ByName("Gateways")), connect.WithHandlerOptions(opts...), +======= + discoveryServiceGatewaysHandler := connect.NewUnaryHandler( + DiscoveryServiceGatewaysProcedure, + svc.Gateways, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) discoveryServiceHiddenSegmentServicesHandler := connect.NewUnaryHandler( DiscoveryServiceHiddenSegmentServicesProcedure, svc.HiddenSegmentServices, +<<<<<<< HEAD connect.WithSchema(discoveryServiceMethods.ByName("HiddenSegmentServices")), connect.WithHandlerOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.discovery.v1.DiscoveryService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/gateway/v1/gatewayconnect/BUILD.bazel b/pkg/proto/gateway/v1/gatewayconnect/BUILD.bazel index d69e0d7fbf..f829e2709d 100644 --- a/pkg/proto/gateway/v1/gatewayconnect/BUILD.bazel +++ b/pkg/proto/gateway/v1/gatewayconnect/BUILD.bazel @@ -1,3 +1,4 @@ +<<<<<<< HEAD load("//tools/proto:connect.bzl", "go_connect_library") go_connect_library( @@ -6,4 +7,17 @@ go_connect_library( "prefix.connect.go", ], proto = "gateway", +======= +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["prefix.connect.go"], + importpath = "github.com/scionproto/scion/pkg/proto/gateway/v1/gatewayconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/gateway:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +>>>>>>> 244e9b483 (THE GRAND MERGE) ) diff --git a/pkg/proto/gateway/v1/gatewayconnect/prefix.connect.go b/pkg/proto/gateway/v1/gatewayconnect/prefix.connect.go index e08deb6e32..80e71cce6c 100644 --- a/pkg/proto/gateway/v1/gatewayconnect/prefix.connect.go +++ b/pkg/proto/gateway/v1/gatewayconnect/prefix.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/gateway/v1/prefix.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // IPPrefixesServiceName is the fully-qualified name of the IPPrefixesService service. @@ -40,6 +61,10 @@ const ( // IPPrefixesServiceClient is a client for the proto.gateway.v1.IPPrefixesService service. type IPPrefixesServiceClient interface { +<<<<<<< HEAD +======= + // Prefixes requests the IP prefixes that can be reachable via the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) Prefixes(context.Context, *connect.Request[gateway.PrefixesRequest]) (*connect.Response[gateway.PrefixesResponse], error) } @@ -52,13 +77,20 @@ type IPPrefixesServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewIPPrefixesServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IPPrefixesServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD iPPrefixesServiceMethods := gateway.File_proto_gateway_v1_prefix_proto.Services().ByName("IPPrefixesService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &iPPrefixesServiceClient{ prefixes: connect.NewClient[gateway.PrefixesRequest, gateway.PrefixesResponse]( httpClient, baseURL+IPPrefixesServicePrefixesProcedure, +<<<<<<< HEAD connect.WithSchema(iPPrefixesServiceMethods.ByName("Prefixes")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -75,6 +107,10 @@ func (c *iPPrefixesServiceClient) Prefixes(ctx context.Context, req *connect.Req // IPPrefixesServiceHandler is an implementation of the proto.gateway.v1.IPPrefixesService service. type IPPrefixesServiceHandler interface { +<<<<<<< HEAD +======= + // Prefixes requests the IP prefixes that can be reachable via the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) Prefixes(context.Context, *connect.Request[gateway.PrefixesRequest]) (*connect.Response[gateway.PrefixesResponse], error) } @@ -84,12 +120,19 @@ type IPPrefixesServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewIPPrefixesServiceHandler(svc IPPrefixesServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD iPPrefixesServiceMethods := gateway.File_proto_gateway_v1_prefix_proto.Services().ByName("IPPrefixesService").Methods() iPPrefixesServicePrefixesHandler := connect.NewUnaryHandler( IPPrefixesServicePrefixesProcedure, svc.Prefixes, connect.WithSchema(iPPrefixesServiceMethods.ByName("Prefixes")), connect.WithHandlerOptions(opts...), +======= + iPPrefixesServicePrefixesHandler := connect.NewUnaryHandler( + IPPrefixesServicePrefixesProcedure, + svc.Prefixes, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.gateway.v1.IPPrefixesService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/proto/hidden_segment/v1/hidden_segmentconnect/BUILD.bazel b/pkg/proto/hidden_segment/v1/hidden_segmentconnect/BUILD.bazel index a154f0afdb..2d00e93d1c 100644 --- a/pkg/proto/hidden_segment/v1/hidden_segmentconnect/BUILD.bazel +++ b/pkg/proto/hidden_segment/v1/hidden_segmentconnect/BUILD.bazel @@ -1,6 +1,20 @@ +<<<<<<< HEAD load("//tools/proto:connect.bzl", "go_connect_library") go_connect_library( name = "go_default_library", proto = "hidden_segment", +======= +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["hidden_segment.connect.go"], + importpath = "github.com/scionproto/scion/pkg/proto/hidden_segment/v1/hidden_segmentconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/hidden_segment:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +>>>>>>> 244e9b483 (THE GRAND MERGE) ) diff --git a/pkg/proto/hidden_segment/v1/hidden_segmentconnect/hidden_segment.connect.go b/pkg/proto/hidden_segment/v1/hidden_segmentconnect/hidden_segment.connect.go index b73d020191..715510f55c 100644 --- a/pkg/proto/hidden_segment/v1/hidden_segmentconnect/hidden_segment.connect.go +++ b/pkg/proto/hidden_segment/v1/hidden_segmentconnect/hidden_segment.connect.go @@ -1,3 +1,20 @@ +<<<<<<< HEAD +======= +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +>>>>>>> 244e9b483 (THE GRAND MERGE) // Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: proto/hidden_segment/v1/hidden_segment.proto @@ -18,7 +35,11 @@ import ( // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. +<<<<<<< HEAD const _ = connect.IsAtLeastVersion1_13_0 +======= +const _ = connect.IsAtLeastVersion0_1_0 +>>>>>>> 244e9b483 (THE GRAND MERGE) const ( // HiddenSegmentRegistrationServiceName is the fully-qualified name of the @@ -55,6 +76,10 @@ const ( // HiddenSegmentRegistrationServiceClient is a client for the // proto.hidden_segment.v1.HiddenSegmentRegistrationService service. type HiddenSegmentRegistrationServiceClient interface { +<<<<<<< HEAD +======= + // HiddenSegmentRegistration registers hidden segments at the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegmentRegistration(context.Context, *connect.Request[hidden_segment.HiddenSegmentRegistrationRequest]) (*connect.Response[hidden_segment.HiddenSegmentRegistrationResponse], error) } @@ -68,13 +93,20 @@ type HiddenSegmentRegistrationServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewHiddenSegmentRegistrationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HiddenSegmentRegistrationServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD hiddenSegmentRegistrationServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("HiddenSegmentRegistrationService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &hiddenSegmentRegistrationServiceClient{ hiddenSegmentRegistration: connect.NewClient[hidden_segment.HiddenSegmentRegistrationRequest, hidden_segment.HiddenSegmentRegistrationResponse]( httpClient, baseURL+HiddenSegmentRegistrationServiceHiddenSegmentRegistrationProcedure, +<<<<<<< HEAD connect.WithSchema(hiddenSegmentRegistrationServiceMethods.ByName("HiddenSegmentRegistration")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -93,6 +125,10 @@ func (c *hiddenSegmentRegistrationServiceClient) HiddenSegmentRegistration(ctx c // HiddenSegmentRegistrationServiceHandler is an implementation of the // proto.hidden_segment.v1.HiddenSegmentRegistrationService service. type HiddenSegmentRegistrationServiceHandler interface { +<<<<<<< HEAD +======= + // HiddenSegmentRegistration registers hidden segments at the remote. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegmentRegistration(context.Context, *connect.Request[hidden_segment.HiddenSegmentRegistrationRequest]) (*connect.Response[hidden_segment.HiddenSegmentRegistrationResponse], error) } @@ -102,12 +138,19 @@ type HiddenSegmentRegistrationServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewHiddenSegmentRegistrationServiceHandler(svc HiddenSegmentRegistrationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD hiddenSegmentRegistrationServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("HiddenSegmentRegistrationService").Methods() hiddenSegmentRegistrationServiceHiddenSegmentRegistrationHandler := connect.NewUnaryHandler( HiddenSegmentRegistrationServiceHiddenSegmentRegistrationProcedure, svc.HiddenSegmentRegistration, connect.WithSchema(hiddenSegmentRegistrationServiceMethods.ByName("HiddenSegmentRegistration")), connect.WithHandlerOptions(opts...), +======= + hiddenSegmentRegistrationServiceHiddenSegmentRegistrationHandler := connect.NewUnaryHandler( + HiddenSegmentRegistrationServiceHiddenSegmentRegistrationProcedure, + svc.HiddenSegmentRegistration, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.hidden_segment.v1.HiddenSegmentRegistrationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -129,6 +172,10 @@ func (UnimplementedHiddenSegmentRegistrationServiceHandler) HiddenSegmentRegistr // HiddenSegmentLookupServiceClient is a client for the // proto.hidden_segment.v1.HiddenSegmentLookupService service. type HiddenSegmentLookupServiceClient interface { +<<<<<<< HEAD +======= + // HiddenSegments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegments(context.Context, *connect.Request[hidden_segment.HiddenSegmentsRequest]) (*connect.Response[hidden_segment.HiddenSegmentsResponse], error) } @@ -142,13 +189,20 @@ type HiddenSegmentLookupServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewHiddenSegmentLookupServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HiddenSegmentLookupServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD hiddenSegmentLookupServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("HiddenSegmentLookupService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &hiddenSegmentLookupServiceClient{ hiddenSegments: connect.NewClient[hidden_segment.HiddenSegmentsRequest, hidden_segment.HiddenSegmentsResponse]( httpClient, baseURL+HiddenSegmentLookupServiceHiddenSegmentsProcedure, +<<<<<<< HEAD connect.WithSchema(hiddenSegmentLookupServiceMethods.ByName("HiddenSegments")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -166,6 +220,10 @@ func (c *hiddenSegmentLookupServiceClient) HiddenSegments(ctx context.Context, r // HiddenSegmentLookupServiceHandler is an implementation of the // proto.hidden_segment.v1.HiddenSegmentLookupService service. type HiddenSegmentLookupServiceHandler interface { +<<<<<<< HEAD +======= + // HiddenSegments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) HiddenSegments(context.Context, *connect.Request[hidden_segment.HiddenSegmentsRequest]) (*connect.Response[hidden_segment.HiddenSegmentsResponse], error) } @@ -175,12 +233,19 @@ type HiddenSegmentLookupServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewHiddenSegmentLookupServiceHandler(svc HiddenSegmentLookupServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD hiddenSegmentLookupServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("HiddenSegmentLookupService").Methods() hiddenSegmentLookupServiceHiddenSegmentsHandler := connect.NewUnaryHandler( HiddenSegmentLookupServiceHiddenSegmentsProcedure, svc.HiddenSegments, connect.WithSchema(hiddenSegmentLookupServiceMethods.ByName("HiddenSegments")), connect.WithHandlerOptions(opts...), +======= + hiddenSegmentLookupServiceHiddenSegmentsHandler := connect.NewUnaryHandler( + HiddenSegmentLookupServiceHiddenSegmentsProcedure, + svc.HiddenSegments, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.hidden_segment.v1.HiddenSegmentLookupService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { @@ -202,6 +267,10 @@ func (UnimplementedHiddenSegmentLookupServiceHandler) HiddenSegments(context.Con // AuthoritativeHiddenSegmentLookupServiceClient is a client for the // proto.hidden_segment.v1.AuthoritativeHiddenSegmentLookupService service. type AuthoritativeHiddenSegmentLookupServiceClient interface { +<<<<<<< HEAD +======= + // HiddenSegments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) AuthoritativeHiddenSegments(context.Context, *connect.Request[hidden_segment.AuthoritativeHiddenSegmentsRequest]) (*connect.Response[hidden_segment.AuthoritativeHiddenSegmentsResponse], error) } @@ -215,13 +284,20 @@ type AuthoritativeHiddenSegmentLookupServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewAuthoritativeHiddenSegmentLookupServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthoritativeHiddenSegmentLookupServiceClient { baseURL = strings.TrimRight(baseURL, "/") +<<<<<<< HEAD authoritativeHiddenSegmentLookupServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("AuthoritativeHiddenSegmentLookupService").Methods() +======= +>>>>>>> 244e9b483 (THE GRAND MERGE) return &authoritativeHiddenSegmentLookupServiceClient{ authoritativeHiddenSegments: connect.NewClient[hidden_segment.AuthoritativeHiddenSegmentsRequest, hidden_segment.AuthoritativeHiddenSegmentsResponse]( httpClient, baseURL+AuthoritativeHiddenSegmentLookupServiceAuthoritativeHiddenSegmentsProcedure, +<<<<<<< HEAD connect.WithSchema(authoritativeHiddenSegmentLookupServiceMethods.ByName("AuthoritativeHiddenSegments")), connect.WithClientOptions(opts...), +======= + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ), } } @@ -241,6 +317,10 @@ func (c *authoritativeHiddenSegmentLookupServiceClient) AuthoritativeHiddenSegme // AuthoritativeHiddenSegmentLookupServiceHandler is an implementation of the // proto.hidden_segment.v1.AuthoritativeHiddenSegmentLookupService service. type AuthoritativeHiddenSegmentLookupServiceHandler interface { +<<<<<<< HEAD +======= + // HiddenSegments returns all segments that match the request. +>>>>>>> 244e9b483 (THE GRAND MERGE) AuthoritativeHiddenSegments(context.Context, *connect.Request[hidden_segment.AuthoritativeHiddenSegmentsRequest]) (*connect.Response[hidden_segment.AuthoritativeHiddenSegmentsResponse], error) } @@ -250,12 +330,19 @@ type AuthoritativeHiddenSegmentLookupServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewAuthoritativeHiddenSegmentLookupServiceHandler(svc AuthoritativeHiddenSegmentLookupServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { +<<<<<<< HEAD authoritativeHiddenSegmentLookupServiceMethods := hidden_segment.File_proto_hidden_segment_v1_hidden_segment_proto.Services().ByName("AuthoritativeHiddenSegmentLookupService").Methods() authoritativeHiddenSegmentLookupServiceAuthoritativeHiddenSegmentsHandler := connect.NewUnaryHandler( AuthoritativeHiddenSegmentLookupServiceAuthoritativeHiddenSegmentsProcedure, svc.AuthoritativeHiddenSegments, connect.WithSchema(authoritativeHiddenSegmentLookupServiceMethods.ByName("AuthoritativeHiddenSegments")), connect.WithHandlerOptions(opts...), +======= + authoritativeHiddenSegmentLookupServiceAuthoritativeHiddenSegmentsHandler := connect.NewUnaryHandler( + AuthoritativeHiddenSegmentLookupServiceAuthoritativeHiddenSegmentsProcedure, + svc.AuthoritativeHiddenSegments, + opts..., +>>>>>>> 244e9b483 (THE GRAND MERGE) ) return "/proto.hidden_segment.v1.AuthoritativeHiddenSegmentLookupService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { diff --git a/pkg/snet/squic/BUILD.bazel b/pkg/snet/squic/BUILD.bazel index 45b8b6cc8f..5fa05acf86 100644 --- a/pkg/snet/squic/BUILD.bazel +++ b/pkg/snet/squic/BUILD.bazel @@ -3,11 +3,15 @@ load("//tools:go.bzl", "go_test") go_library( name = "go_default_library", - srcs = ["net.go"], + srcs = [ + "early.go", + "net.go", + ], importpath = "github.com/scionproto/scion/pkg/snet/squic", visibility = ["//visibility:public"], deps = [ "//pkg/log:go_default_library", + "//pkg/private/common:go_default_library", "//pkg/private/serrors:go_default_library", "//pkg/snet:go_default_library", "@com_github_quic_go_quic_go//:go_default_library", diff --git a/pkg/snet/squic/early.go b/pkg/snet/squic/early.go new file mode 100644 index 0000000000..42f42fea8c --- /dev/null +++ b/pkg/snet/squic/early.go @@ -0,0 +1,145 @@ +// Copyright 2020 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package squic + +import ( + "context" + "crypto/tls" + "errors" + mrand "math/rand" + "net" + "time" + + "github.com/quic-go/quic-go" + + "github.com/scionproto/scion/pkg/private/common" + "github.com/scionproto/scion/pkg/private/serrors" + "github.com/scionproto/scion/pkg/snet" +) + +type AddressRewriter interface { + RedirectToQUIC(ctx context.Context, address net.Addr) (net.Addr, bool, error) +} + +type EarlyDialerOptions struct { + Peer chan net.Addr + DialTimeout time.Duration +} + +type EarlyDialerOption func(o *EarlyDialerOptions) + +func WithPeerChannel(peer chan net.Addr) EarlyDialerOption { + return func(o *EarlyDialerOptions) { + o.Peer = peer + } +} + +func WithDialTimeout(to time.Duration) EarlyDialerOption { + return func(o *EarlyDialerOptions) { + o.DialTimeout = to + } +} + +type EarlyDialerFactory struct { + Transport *quic.Transport + TLSConfig *tls.Config + QUICConfig *quic.Config + Rewriter AddressRewriter +} + +func (f *EarlyDialerFactory) NewDialer(a net.Addr, opts ...EarlyDialerOption) EarlyDialer { + var o EarlyDialerOptions + for _, f := range opts { + f(&o) + } + return EarlyDialer{ + Addr: a, + Transport: f.Transport, + TLSConfig: f.TLSConfig, + QUICConfig: f.QUICConfig, + Rewriter: f.Rewriter, + Peer: o.Peer, + DialTimeout: o.DialTimeout, + } +} + +type EarlyDialer struct { + Addr net.Addr + Transport *quic.Transport + TLSConfig *tls.Config + QUICConfig *quic.Config + Rewriter AddressRewriter + + Peer chan net.Addr + DialTimeout time.Duration +} + +func (d *EarlyDialer) DialEarly(ctx context.Context, _ string, _ *tls.Config, _ *quic.Config) (quic.EarlyConnection, error) { + if d.DialTimeout != 0 { + var cancel func() + ctx, cancel = context.WithTimeout(ctx, d.DialTimeout) + defer cancel() + } + + addr, _, err := d.Rewriter.RedirectToQUIC(ctx, d.Addr) + if err != nil { + return nil, serrors.WrapStr("resolving SVC address", err) + } + if _, ok := addr.(*snet.UDPAddr); !ok { + return nil, serrors.New("wrong address type after svc resolution", + "type", common.TypeOf(addr)) + } + if d.Peer != nil { + d.Peer <- addr + } + + serverName := d.TLSConfig.ServerName + if serverName == "" { + serverName = computeServerName(addr) + } + + var session quic.EarlyConnection + for sleep := 2 * time.Millisecond; ctx.Err() == nil; sleep = sleep * 2 { + // Clone TLS config to avoid data races. + tlsConfig := d.TLSConfig.Clone() + tlsConfig.ServerName = serverName + // Clone QUIC config to avoid data races, if it exists. + var quicConfig *quic.Config + if d.QUICConfig != nil { + quicConfig = d.QUICConfig.Clone() + } + + var err error + session, err = d.Transport.DialEarly(ctx, addr, tlsConfig, quicConfig) + if err == nil { + break + } + var transportErr *quic.TransportError + if !errors.As(err, &transportErr) || transportErr.ErrorCode != quic.ConnectionRefused { + return nil, serrors.WrapStr("dialing QUIC/SCION", err) + } + + jitter := time.Duration(mrand.Int63n(int64(5 * time.Millisecond))) + select { + case <-time.After(sleep + jitter): + case <-ctx.Done(): + return nil, serrors.WrapStr("timed out connecting to busy server", err) + } + } + if err := ctx.Err(); err != nil { + return nil, serrors.WrapStr("dialing QUIC/SCION, after loop", err) + } + return session, nil +} diff --git a/pkg/snet/squic/net.go b/pkg/snet/squic/net.go index 2055be958a..afe06fb5f1 100644 --- a/pkg/snet/squic/net.go +++ b/pkg/snet/squic/net.go @@ -46,48 +46,63 @@ const ( // streamAcceptTimeout is the default timeout for accepting connections. const streamAcceptTimeout = 5 * time.Second +// TODO: move this ? // ConnListener wraps a quic.Listener as a net.Listener. type ConnListener struct { - *quic.Listener + Conns <-chan quic.Connection ctx context.Context cancel func() + + addr net.Addr } // NewConnListener constructs a new listener with the appropriate buffers set. -func NewConnListener(l *quic.Listener) *ConnListener { +func NewConnListener(conns <-chan quic.Connection, addr net.Addr) *ConnListener { ctx, cancel := context.WithCancel(context.Background()) c := &ConnListener{ - Listener: l, - ctx: ctx, - cancel: cancel, + Conns: conns, + ctx: ctx, + cancel: cancel, + addr: addr, } return c } +func (l *ConnListener) Addr() net.Addr { + fmt.Println("Addr():", l.addr) + return l.addr +} + // Accept accepts the first stream on a session and wraps it as a net.Conn. func (l *ConnListener) Accept() (net.Conn, error) { - session, err := l.Listener.Accept(l.ctx) - if err != nil { - return nil, err + fmt.Println("accept") + select { + case conn := <-l.Conns: + fmt.Println("conn <-") + return newAcceptingConn(l.ctx, conn), nil + case <-l.ctx.Done(): + return nil, l.ctx.Err() } - return newAcceptingConn(l.ctx, session), nil } // AcceptCtx accepts the first stream on a session and wraps it as a net.Conn. Accepts a context in // case the caller doesn't want this to block indefinitely. func (l *ConnListener) AcceptCtx(ctx context.Context) (net.Conn, error) { - session, err := l.Listener.Accept(ctx) - if err != nil { - return nil, err + fmt.Println("acceptctx") + select { + case conn := <-l.Conns: + fmt.Println("conn ctx <-") + return newAcceptingConn(ctx, conn), nil + case <-ctx.Done(): + return nil, ctx.Err() } - return newAcceptingConn(ctx, session), nil } // Close closes the listener. func (l *ConnListener) Close() error { l.cancel() - return l.Listener.Close() + return nil } // acceptingConn is a net.Conn wrapper for a QUIC stream that is yet to diff --git a/private/app/appnet/infraenv.go b/private/app/appnet/infraenv.go index e196e77a47..ee0403cc3b 100644 --- a/private/app/appnet/infraenv.go +++ b/private/app/appnet/infraenv.go @@ -80,7 +80,7 @@ type NetworkConfig struct { // QUICStack contains everything to run a QUIC based RPC stack. type QUICStack struct { - Listener *squic.ConnListener + Listener *quic.Listener InsecureDialer *squic.ConnDialer Dialer *squic.ConnDialer } @@ -105,7 +105,7 @@ func (nc *NetworkConfig) QUICStack(ctx context.Context) (*QUICStack, error) { InsecureSkipVerify: true, GetCertificate: nc.QUIC.GetCertificate, ClientAuth: tls.RequestClientCert, - NextProtos: []string{"SCION"}, + NextProtos: []string{"h3", "SCION"}, } listener, err := quic.Listen(server, serverTLSConfig, nil) @@ -129,7 +129,7 @@ func (nc *NetworkConfig) QUICStack(ctx context.Context) (*QUICStack, error) { } return &QUICStack{ - Listener: squic.NewConnListener(listener), + Listener: listener, InsecureDialer: &squic.ConnDialer{ Transport: clientTransport, TLSConfig: insecureClientTLSConfig, diff --git a/private/ca/renewal/connect/BUILD.bazel b/private/ca/renewal/connect/BUILD.bazel new file mode 100644 index 0000000000..9008d73e19 --- /dev/null +++ b/private/ca/renewal/connect/BUILD.bazel @@ -0,0 +1,14 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["renewal.go"], + importpath = "github.com/scionproto/scion/private/ca/renewal/connect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/control_plane:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", + "//private/ca/renewal/grpc:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +) diff --git a/private/ca/renewal/connect/renewal.go b/private/ca/renewal/connect/renewal.go new file mode 100644 index 0000000000..f2b77cb85b --- /dev/null +++ b/private/ca/renewal/connect/renewal.go @@ -0,0 +1,24 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + "github.com/scionproto/scion/pkg/proto/control_plane" + "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" + "github.com/scionproto/scion/private/ca/renewal/grpc" +) + +var _ control_planeconnect.ChainRenewalServiceHandler = RenewalServer{} + +type RenewalServer struct { + *grpc.RenewalServer +} + +func (m RenewalServer) ChainRenewal(ctx context.Context, req *connect.Request[control_plane.ChainRenewalRequest]) (*connect.Response[control_plane.ChainRenewalResponse], error) { + rep, err := m.RenewalServer.ChainRenewal(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/private/discovery/connect/BUILD.bazel b/private/discovery/connect/BUILD.bazel new file mode 100644 index 0000000000..16e1083c26 --- /dev/null +++ b/private/discovery/connect/BUILD.bazel @@ -0,0 +1,14 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["toposervice.go"], + importpath = "github.com/scionproto/scion/private/discovery/connect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/proto/discovery:go_default_library", + "//pkg/proto/discovery/v1/discoveryconnect:go_default_library", + "//private/discovery:go_default_library", + "@com_connectrpc_connect//:go_default_library", + ], +) diff --git a/private/discovery/connect/toposervice.go b/private/discovery/connect/toposervice.go new file mode 100644 index 0000000000..3fd056702a --- /dev/null +++ b/private/discovery/connect/toposervice.go @@ -0,0 +1,39 @@ +package connect + +import ( + "context" + + "connectrpc.com/connect" + + dpb "github.com/scionproto/scion/pkg/proto/discovery" + "github.com/scionproto/scion/pkg/proto/discovery/v1/discoveryconnect" + "github.com/scionproto/scion/private/discovery" +) + +var _ discoveryconnect.DiscoveryServiceHandler = Topology{} + +type Topology struct { + discovery.Topology +} + +func (t Topology) Gateways( + ctx context.Context, + req *connect.Request[dpb.GatewaysRequest], +) (*connect.Response[dpb.GatewaysResponse], error) { + rep, err := t.Topology.Gateways(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} + +func (t Topology) HiddenSegmentServices( + ctx context.Context, + req *connect.Request[dpb.HiddenSegmentServicesRequest], +) (*connect.Response[dpb.HiddenSegmentServicesResponse], error) { + rep, err := t.Topology.HiddenSegmentServices(ctx, req.Msg) + if err != nil { + return nil, err + } + return connect.NewResponse(rep), nil +} diff --git a/private/segment/segfetcher/connect/BUILD.bazel b/private/segment/segfetcher/connect/BUILD.bazel new file mode 100644 index 0000000000..42d84deb40 --- /dev/null +++ b/private/segment/segfetcher/connect/BUILD.bazel @@ -0,0 +1,20 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["requester.go"], + importpath = "github.com/scionproto/scion/private/segment/segfetcher/connect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/connect:go_default_library", + "//pkg/private/serrors:go_default_library", + "//pkg/proto/control_plane:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", + "//pkg/segment:go_default_library", + "//pkg/snet/squic:go_default_library", + "//private/segment/segfetcher:go_default_library", + "//private/segment/segfetcher/grpc:go_default_library", + "@com_connectrpc_connect//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", + ], +) diff --git a/private/segment/segfetcher/connect/requester.go b/private/segment/segfetcher/connect/requester.go new file mode 100644 index 0000000000..5b9a03f1f0 --- /dev/null +++ b/private/segment/segfetcher/connect/requester.go @@ -0,0 +1,83 @@ +// Copyright 2023 Anapaya Systems +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "net" + + "connectrpc.com/connect" + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" + + libconnect "github.com/scionproto/scion/pkg/connect" + "github.com/scionproto/scion/pkg/private/serrors" + "github.com/scionproto/scion/pkg/proto/control_plane" + seg "github.com/scionproto/scion/pkg/segment" + "github.com/scionproto/scion/pkg/snet/squic" + "github.com/scionproto/scion/private/segment/segfetcher" + segfetchergrpc "github.com/scionproto/scion/private/segment/segfetcher/grpc" +) + +// Requester fetches segments from a remote using gRPC. +type Requester struct { + Dialer libconnect.Dialer +} + +func (f *Requester) Segments(ctx context.Context, req segfetcher.Request, + server net.Addr) (segfetcher.SegmentsReply, error) { + + peer := make(chan net.Addr, 1) + dialer := f.Dialer(server, squic.WithPeerChannel(peer), squic.WithDialTimeout(segfetchergrpc.DefaultRPCDialTimeout)) + client := control_planeconnect.NewSegmentLookupServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(server), + ) + rep, err := client.Segments(ctx, connect.NewRequest(&control_plane.SegmentsRequest{ + SrcIsdAs: uint64(req.Src), + DstIsdAs: uint64(req.Dst), + })) + if err != nil { + return segfetcher.SegmentsReply{}, err + } + + var resolvedPeer net.Addr + select { + case p := <-peer: + resolvedPeer = p + default: + return segfetcher.SegmentsReply{}, serrors.New("no peer resolved", "server", server) + } + + var segs []*seg.Meta + for segType, segments := range rep.Msg.Segments { + for i, pb := range segments.Segments { + ps, err := seg.SegmentFromPB(pb) + if err != nil { + return segfetcher.SegmentsReply{}, + serrors.WrapStr("parsing segments", err, "index", i) + } + segs = append(segs, &seg.Meta{ + Type: seg.Type(segType), + Segment: ps, + }) + } + } + return segfetcher.SegmentsReply{Segments: segs, Peer: resolvedPeer}, nil +} diff --git a/private/segment/segfetcher/happy/BUILD.bazel b/private/segment/segfetcher/happy/BUILD.bazel new file mode 100644 index 0000000000..b783960a29 --- /dev/null +++ b/private/segment/segfetcher/happy/BUILD.bazel @@ -0,0 +1,12 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["requester.go"], + importpath = "github.com/scionproto/scion/private/segment/segfetcher/happy", + visibility = ["//visibility:public"], + deps = [ + "//pkg/connect/happy:go_default_library", + "//private/segment/segfetcher:go_default_library", + ], +) diff --git a/private/segment/segfetcher/happy/requester.go b/private/segment/segfetcher/happy/requester.go new file mode 100644 index 0000000000..dc8ba2606a --- /dev/null +++ b/private/segment/segfetcher/happy/requester.go @@ -0,0 +1,35 @@ +package happy + +import ( + "context" + "net" + + "github.com/scionproto/scion/pkg/connect/happy" + "github.com/scionproto/scion/private/segment/segfetcher" +) + +// Requester fetches segments from a remote using gRPC. +type Requester struct { + Connect segfetcher.RPC + Grpc segfetcher.RPC +} + +func (f *Requester) Segments(ctx context.Context, req segfetcher.Request, + server net.Addr) (segfetcher.SegmentsReply, error) { + + return happy.Happy( + ctx, + happy.Call2[segfetcher.Request, net.Addr, segfetcher.SegmentsReply]{ + Call: f.Connect.Segments, + Input1: req, + Input2: server, + Typ: "control_plane.v1.SegmentLookupService.Segments", + }, + happy.Call2[segfetcher.Request, net.Addr, segfetcher.SegmentsReply]{ + Call: f.Grpc.Segments, + Input1: req, + Input2: server, + Typ: "control_plane.v1.SegmentLookupService.Segments", + }, + ) +} diff --git a/private/trust/connect/BUILD.bazel b/private/trust/connect/BUILD.bazel new file mode 100644 index 0000000000..9c056751f1 --- /dev/null +++ b/private/trust/connect/BUILD.bazel @@ -0,0 +1,19 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["fetcher.go"], + importpath = "github.com/scionproto/scion/private/trust/connect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/addr:go_default_library", + "//pkg/connect:go_default_library", + "//pkg/private/serrors:go_default_library", + "//pkg/proto/control_plane/v1/control_planeconnect:go_default_library", + "//pkg/scrypto/cppki:go_default_library", + "//private/trust:go_default_library", + "//private/trust/grpc:go_default_library", + "@com_connectrpc_connect//:go_default_library", + "@com_github_quic_go_quic_go//http3:go_default_library", + ], +) diff --git a/private/trust/connect/fetcher.go b/private/trust/connect/fetcher.go new file mode 100644 index 0000000000..df97c060cb --- /dev/null +++ b/private/trust/connect/fetcher.go @@ -0,0 +1,78 @@ +package connect + +import ( + "context" + "crypto/x509" + "net" + + "connectrpc.com/connect" + "github.com/quic-go/quic-go/http3" + "github.com/scionproto/scion/pkg/addr" + libconnect "github.com/scionproto/scion/pkg/connect" + "github.com/scionproto/scion/pkg/private/serrors" + "github.com/scionproto/scion/pkg/proto/control_plane/v1/control_planeconnect" + "github.com/scionproto/scion/pkg/scrypto/cppki" + "github.com/scionproto/scion/private/trust" + "github.com/scionproto/scion/private/trust/grpc" +) + +type Fetcher struct { + // IA is the local ISD-AS. + IA addr.IA + // Dialer dials a new QUIC connection. + Dialer libconnect.Dialer +} + +// Chains fetches certificate chains over the network +func (f Fetcher) Chains(ctx context.Context, query trust.ChainQuery, + server net.Addr) ([][]*x509.Certificate, error) { + + dialer := f.Dialer(server) + client := control_planeconnect.NewTrustMaterialServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(server), + ) + rep, err := client.Chains(ctx, connect.NewRequest(grpc.ChainQueryToReq(query))) + if err != nil { + return nil, serrors.WrapStr("fetching chains over connect", err) + } + chains, _, err := grpc.RepToChains(rep.Msg.Chains) + if err != nil { + return nil, serrors.WrapStr("parsing chains", err) + } + if err := grpc.CheckChainsMatchQuery(query, chains); err != nil { + return nil, serrors.WrapStr("chains do not match query", err) + } + return chains, nil +} + +func (f Fetcher) TRC(ctx context.Context, id cppki.TRCID, + server net.Addr) (cppki.SignedTRC, error) { + + dialer := f.Dialer(server) + client := control_planeconnect.NewTrustMaterialServiceClient( + libconnect.HTTPClient{ + RoundTripper: &http3.RoundTripper{ + Dial: dialer.DialEarly, + }, + }, + libconnect.BaseUrl(server), + ) + rep, err := client.TRC(ctx, connect.NewRequest(grpc.IDToReq(id))) + if err != nil { + return cppki.SignedTRC{}, serrors.WrapStr("fetching chains over connect", err) + } + trc, err := cppki.DecodeSignedTRC(rep.Msg.Trc) + if err != nil { + return cppki.SignedTRC{}, serrors.WrapStr("parse TRC reply", err) + } + if trc.TRC.ID != id { + return cppki.SignedTRC{}, serrors.New("received wrong TRC", "expected", id, + "actual", trc.TRC.ID) + } + return trc, nil +} diff --git a/private/trust/grpc/BUILD.bazel b/private/trust/grpc/BUILD.bazel index 60a86c5026..b85b605068 100644 --- a/private/trust/grpc/BUILD.bazel +++ b/private/trust/grpc/BUILD.bazel @@ -29,15 +29,17 @@ go_library( go_test( name = "go_default_test", srcs = [ - "export_test.go", "fetcher_test.go", "main_test.go", "proto_test.go", ], data = glob(["testdata/**"]), - embed = [":go_default_library"], deps = [ +<<<<<<< HEAD "//pkg/addr:go_default_library", +======= + ":go_default_library", +>>>>>>> 244e9b483 (THE GRAND MERGE) "//pkg/private/serrors:go_default_library", "//pkg/private/xtest:go_default_library", "//pkg/proto/control_plane:go_default_library", diff --git a/private/trust/grpc/export_test.go b/private/trust/grpc/export_test.go deleted file mode 100644 index 0bb09962e2..0000000000 --- a/private/trust/grpc/export_test.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 Anapaya Systems -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package grpc - -var ( - ChainQueryToReq = chainQueryToReq - RepToChains = repToChains - IDToReq = idToReq -) diff --git a/private/trust/grpc/fetcher.go b/private/trust/grpc/fetcher.go index b716ef0992..0bbd2b69ae 100644 --- a/private/trust/grpc/fetcher.go +++ b/private/trust/grpc/fetcher.go @@ -76,13 +76,13 @@ func (f Fetcher) Chains(ctx context.Context, query trust.ChainQuery, } defer conn.Close() client := cppb.NewTrustMaterialServiceClient(conn) - rep, err := client.Chains(ctx, chainQueryToReq(query), grpc.RetryProfile...) + rep, err := client.Chains(ctx, ChainQueryToReq(query), grpc.RetryProfile...) if err != nil { f.updateMetric(span, labels.WithResult(trustmetrics.ErrTransmit), err) return nil, serrors.Wrap("receiving chains", err) } - chains, res, err := repToChains(rep.Chains) + chains, res, err := RepToChains(rep.Chains) if err != nil { f.updateMetric(span, labels.WithResult(res), err) return nil, err @@ -92,7 +92,7 @@ func (f Fetcher) Chains(ctx context.Context, query trust.ChainQuery, "chains", len(chains), ) - if err := checkChainsMatchQuery(query, chains); err != nil { + if err := CheckChainsMatchQuery(query, chains); err != nil { f.updateMetric(span, labels.WithResult(trustmetrics.ErrMismatch), err) return nil, serrors.Wrap("chains do not match query", err) } @@ -122,7 +122,7 @@ func (f Fetcher) TRC(ctx context.Context, id cppki.TRCID, } defer conn.Close() client := cppb.NewTrustMaterialServiceClient(conn) - rep, err := client.TRC(ctx, idToReq(id), grpc.RetryProfile...) + rep, err := client.TRC(ctx, IDToReq(id), grpc.RetryProfile...) if err != nil { f.updateMetric(span, labels.WithResult(trustmetrics.ErrTransmit), err) return cppki.SignedTRC{}, serrors.Wrap("receiving TRC", err) @@ -175,7 +175,7 @@ func addTRCSpan(ctx context.Context, return span, ctx } -func checkChainsMatchQuery(query trust.ChainQuery, chains [][]*x509.Certificate) error { +func CheckChainsMatchQuery(query trust.ChainQuery, chains [][]*x509.Certificate) error { for i, chain := range chains { ia, err := cppki.ExtractIA(chain[0].Subject) if err != nil { diff --git a/private/trust/grpc/proto.go b/private/trust/grpc/proto.go index 6632b85b16..744aacfd18 100644 --- a/private/trust/grpc/proto.go +++ b/private/trust/grpc/proto.go @@ -26,7 +26,7 @@ import ( trustmetrics "github.com/scionproto/scion/private/trust/internal/metrics" ) -func chainQueryToReq(query trust.ChainQuery) *cppb.ChainsRequest { +func ChainQueryToReq(query trust.ChainQuery) *cppb.ChainsRequest { return &cppb.ChainsRequest{ IsdAs: uint64(query.IA), SubjectKeyId: query.SubjectKeyID, @@ -35,7 +35,7 @@ func chainQueryToReq(query trust.ChainQuery) *cppb.ChainsRequest { } } -func repToChains(pbChains []*cppb.Chain) ([][]*x509.Certificate, string, error) { +func RepToChains(pbChains []*cppb.Chain) ([][]*x509.Certificate, string, error) { chains := make([][]*x509.Certificate, 0, len(pbChains)) for _, c := range pbChains { var err error @@ -54,7 +54,7 @@ func repToChains(pbChains []*cppb.Chain) ([][]*x509.Certificate, string, error) return chains, "", nil } -func idToReq(id cppki.TRCID) *cppb.TRCRequest { +func IDToReq(id cppki.TRCID) *cppb.TRCRequest { return &cppb.TRCRequest{ Isd: uint32(id.ISD), Base: uint64(id.Base), diff --git a/private/trust/happy/BUILD.bazel b/private/trust/happy/BUILD.bazel new file mode 100644 index 0000000000..18545d686d --- /dev/null +++ b/private/trust/happy/BUILD.bazel @@ -0,0 +1,13 @@ +load("//tools/lint:go.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["fetcher.go"], + importpath = "github.com/scionproto/scion/private/trust/happy", + visibility = ["//visibility:public"], + deps = [ + "//pkg/connect/happy:go_default_library", + "//pkg/scrypto/cppki:go_default_library", + "//private/trust:go_default_library", + ], +) diff --git a/private/trust/happy/fetcher.go b/private/trust/happy/fetcher.go new file mode 100644 index 0000000000..76e0545d4a --- /dev/null +++ b/private/trust/happy/fetcher.go @@ -0,0 +1,56 @@ +package happy + +import ( + "context" + "crypto/x509" + "net" + + "github.com/scionproto/scion/pkg/connect/happy" + "github.com/scionproto/scion/pkg/scrypto/cppki" + "github.com/scionproto/scion/private/trust" +) + +type Fetcher struct { + Connect trust.Fetcher + Grpc trust.Fetcher +} + +func (f Fetcher) Chains(ctx context.Context, query trust.ChainQuery, + server net.Addr) ([][]*x509.Certificate, error) { + + return happy.Happy( + ctx, + happy.Call2[trust.ChainQuery, net.Addr, [][]*x509.Certificate]{ + Call: f.Connect.Chains, + Input1: query, + Input2: server, + Typ: "control_plane.v1.TrustMaterialService.Chains", + }, + happy.Call2[trust.ChainQuery, net.Addr, [][]*x509.Certificate]{ + Call: f.Grpc.Chains, + Input1: query, + Input2: server, + Typ: "control_plane.v1.TrustMaterialService.Chains", + }, + ) +} + +func (f Fetcher) TRC(ctx context.Context, id cppki.TRCID, + server net.Addr) (cppki.SignedTRC, error) { + + return happy.Happy( + ctx, + happy.Call2[cppki.TRCID, net.Addr, cppki.SignedTRC]{ + Call: f.Connect.TRC, + Input1: id, + Input2: server, + Typ: "control_plane.v1.TrustMaterialService.TRC", + }, + happy.Call2[cppki.TRCID, net.Addr, cppki.SignedTRC]{ + Call: f.Grpc.TRC, + Input1: id, + Input2: server, + Typ: "control_plane.v1.TrustMaterialService.TRC", + }, + ) +}