From 0600615732b17de930e1f36dba31bc6825a8c209 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 27 Oct 2022 11:54:53 -0400 Subject: [PATCH 01/32] refactoring the examples folder + rhai version of forbid anonymous operations --- Cargo.lock | 15 +++- Cargo.toml | 33 +++++---- examples/README.md | 47 +++++++----- .../{ => rhai}/Cargo.toml | 2 +- .../add-timestamp-header/{ => rhai}/README.md | 3 +- .../{ => rhai}/router.yaml | 0 .../{ => rhai}/src/add_timestamp_header.rhai | 0 .../{ => rhai}/src/main.rs | 2 +- .../{ => rust}/.skipconfigvalidation | 0 examples/async-auth/{ => rust}/Cargo.toml | 2 +- examples/async-auth/{ => rust}/README.md | 9 ++- .../{ => rust}/allowedClientIds.json | 0 examples/async-auth/{ => rust}/router.yaml | 0 .../src/allow_client_id_from_file.rs | 0 examples/async-auth/{ => rust}/src/main.rs | 2 +- .../context/{ => rust}/.skipconfigvalidation | 0 examples/context/{ => rust}/Cargo.toml | 2 +- examples/context/{ => rust}/README.md | 17 +++-- examples/context/{ => rust}/router.yaml | 0 .../context/{ => rust}/src/context_data.rs | 0 examples/context/{ => rust}/src/main.rs | 2 +- .../cookies-to-headers/{ => rhai}/Cargo.toml | 2 +- .../cookies-to-headers/{ => rhai}/README.md | 3 +- .../cookies-to-headers/{ => rhai}/router.yaml | 0 .../{ => rhai}/src/cookies_to_headers.rhai | 0 .../cookies-to-headers/{ => rhai}/src/main.rs | 2 +- .../rhai}/Cargo.toml | 2 +- .../rhai}/README.md | 3 +- .../rhai}/router.yaml | 0 .../rhai}/src/main.rs | 2 +- .../rhai}/src/rhai_data_response_mutate.rhai | 0 .../embedded/{ => rust}/.skipconfigvalidation | 0 examples/embedded/{ => rust}/Cargo.toml | 2 +- examples/embedded/{ => rust}/README.md | 0 examples/embedded/{ => rust}/router.yaml | 0 examples/embedded/{ => rust}/src/main.rs | 2 +- .../rhai}/Cargo.toml | 2 +- .../rhai}/README.md | 3 +- .../rhai}/router.yaml | 0 .../rhai}/src/main.rs | 2 +- .../rhai}/src/rhai_error_response_mutate.rhai | 0 .../rhai/Cargo.toml | 14 ++++ .../rhai/README.md | 8 ++ .../rhai/router.yaml | 11 +++ .../rhai/src/forbid_anonymous_operations.rhai | 17 +++++ .../rhai/src/main.rs | 73 +++++++++++++++++++ .../{ => rust}/.skipconfigvalidation | 0 .../{ => rust}/Cargo.toml | 2 +- .../{ => rust}/README.md | 4 +- .../{ => rust}/router.yaml | 0 .../src/forbid_anonymous_operations.rs | 0 .../{ => rust}/src/main.rs | 2 +- .../README.md | 4 +- .../router.yaml | 2 +- examples/header-manipulation/README.md | 11 +-- .../{ => rust}/.skipconfigvalidation | 0 examples/hello-world/{ => rust}/Cargo.toml | 2 +- examples/hello-world/{ => rust}/README.md | 3 +- examples/hello-world/{ => rust}/router.yaml | 0 .../hello-world/{ => rust}/src/hello_world.rs | 0 examples/hello-world/{ => rust}/src/main.rs | 2 +- .../jwt-auth/{ => rust}/.skipconfigvalidation | 0 examples/jwt-auth/{ => rust}/Cargo.toml | 2 +- examples/jwt-auth/{ => rust}/README.md | 6 +- examples/jwt-auth/{ => rust}/router.yaml | 0 examples/jwt-auth/{ => rust}/src/jwt.rs | 0 examples/jwt-auth/{ => rust}/src/main.rs | 2 +- .../{rhai-logging => logging/rhai}/Cargo.toml | 2 +- .../rhai}/README.md | 3 +- .../rhai}/router.yaml | 0 .../rhai}/src/main.rs | 2 +- .../rhai}/src/rhai_logging.rhai | 0 .../op-name-to-header/{ => rhai}/Cargo.toml | 2 +- .../op-name-to-header/{ => rhai}/README.md | 3 +- .../op-name-to-header/{ => rhai}/router.yaml | 0 .../op-name-to-header/{ => rhai}/src/main.rs | 2 +- .../{ => rhai}/src/op_name_to_header.rhai | 0 examples/rhai-surrogate-cache-key/README.md | 8 -- .../{ => rust}/.skipconfigvalidation | 0 .../{ => rust}/Cargo.toml | 2 +- .../{ => rust}/README.md | 17 +++-- .../{ => rust}/router.yaml | 0 .../{ => rust}/src/main.rs | 2 +- .../{ => rust}/src/propagate_status_code.rs | 0 .../rhai}/Cargo.toml | 2 +- .../rhai}/README.md | 3 +- .../rhai}/router.yaml | 0 .../rhai}/src/main.rs | 2 +- .../rhai}/src/rhai_subgraph_request_log.rhai | 0 .../rust}/.skipconfigvalidation | 0 .../rust}/Cargo.toml | 4 +- .../rust}/README.md | 24 +++--- .../rust}/router.yaml | 0 .../rust}/src/main.rs | 2 +- .../rust}/src/supergraph_sdl.rs | 0 .../rhai}/Cargo.toml | 2 +- examples/surrogate-cache-key/rhai/README.md | 9 +++ .../rhai}/router.yaml | 0 .../rhai}/src/main.rs | 2 +- .../rhai}/src/rhai_surrogate_cache_key.rhai | 0 examples/telemetry/README.md | 18 ++--- examples/unix-sockets/README.md | 3 +- 102 files changed, 305 insertions(+), 135 deletions(-) rename examples/add-timestamp-header/{ => rhai}/Cargo.toml (86%) rename examples/add-timestamp-header/{ => rhai}/README.md (59%) rename examples/add-timestamp-header/{ => rhai}/router.yaml (100%) rename examples/add-timestamp-header/{ => rhai}/src/add_timestamp_header.rhai (100%) rename examples/add-timestamp-header/{ => rhai}/src/main.rs (97%) rename examples/async-auth/{ => rust}/.skipconfigvalidation (100%) rename examples/async-auth/{ => rust}/Cargo.toml (89%) rename examples/async-auth/{ => rust}/README.md (89%) rename examples/async-auth/{ => rust}/allowedClientIds.json (100%) rename examples/async-auth/{ => rust}/router.yaml (100%) rename examples/async-auth/{ => rust}/src/allow_client_id_from_file.rs (100%) rename examples/async-auth/{ => rust}/src/main.rs (94%) rename examples/context/{ => rust}/.skipconfigvalidation (100%) rename examples/context/{ => rust}/Cargo.toml (85%) rename examples/context/{ => rust}/README.md (88%) rename examples/context/{ => rust}/router.yaml (100%) rename examples/context/{ => rust}/src/context_data.rs (100%) rename examples/context/{ => rust}/src/main.rs (91%) rename examples/cookies-to-headers/{ => rhai}/Cargo.toml (86%) rename examples/cookies-to-headers/{ => rhai}/README.md (56%) rename examples/cookies-to-headers/{ => rhai}/router.yaml (100%) rename examples/cookies-to-headers/{ => rhai}/src/cookies_to_headers.rhai (100%) rename examples/cookies-to-headers/{ => rhai}/src/main.rs (98%) rename examples/{rhai-data-response-mutate => data-response-mutate/rhai}/Cargo.toml (87%) rename examples/{rhai-error-response-mutate => data-response-mutate/rhai}/README.md (63%) rename examples/{rhai-data-response-mutate => data-response-mutate/rhai}/router.yaml (100%) rename examples/{rhai-data-response-mutate => data-response-mutate/rhai}/src/main.rs (97%) rename examples/{rhai-data-response-mutate => data-response-mutate/rhai}/src/rhai_data_response_mutate.rhai (100%) rename examples/embedded/{ => rust}/.skipconfigvalidation (100%) rename examples/embedded/{ => rust}/Cargo.toml (85%) rename examples/embedded/{ => rust}/README.md (100%) rename examples/embedded/{ => rust}/router.yaml (100%) rename examples/embedded/{ => rust}/src/main.rs (93%) rename examples/{rhai-error-response-mutate => error-response-mutate/rhai}/Cargo.toml (87%) rename examples/{rhai-logging => error-response-mutate/rhai}/README.md (63%) rename examples/{rhai-error-response-mutate => error-response-mutate/rhai}/router.yaml (100%) rename examples/{rhai-error-response-mutate => error-response-mutate/rhai}/src/main.rs (97%) rename examples/{rhai-error-response-mutate => error-response-mutate/rhai}/src/rhai_error_response_mutate.rhai (100%) create mode 100644 examples/forbid-anonymous-operations/rhai/Cargo.toml create mode 100644 examples/forbid-anonymous-operations/rhai/README.md create mode 100644 examples/forbid-anonymous-operations/rhai/router.yaml create mode 100644 examples/forbid-anonymous-operations/rhai/src/forbid_anonymous_operations.rhai create mode 100644 examples/forbid-anonymous-operations/rhai/src/main.rs rename examples/forbid-anonymous-operations/{ => rust}/.skipconfigvalidation (100%) rename examples/forbid-anonymous-operations/{ => rust}/Cargo.toml (88%) rename examples/forbid-anonymous-operations/{ => rust}/README.md (89%) rename examples/forbid-anonymous-operations/{ => rust}/router.yaml (100%) rename examples/forbid-anonymous-operations/{ => rust}/src/forbid_anonymous_operations.rs (100%) rename examples/forbid-anonymous-operations/{ => rust}/src/main.rs (91%) rename examples/{forbid_mutations => forbid-mutations}/README.md (74%) rename examples/{forbid_mutations => forbid-mutations}/router.yaml (79%) rename examples/hello-world/{ => rust}/.skipconfigvalidation (100%) rename examples/hello-world/{ => rust}/Cargo.toml (88%) rename examples/hello-world/{ => rust}/README.md (76%) rename examples/hello-world/{ => rust}/router.yaml (100%) rename examples/hello-world/{ => rust}/src/hello_world.rs (100%) rename examples/hello-world/{ => rust}/src/main.rs (91%) rename examples/jwt-auth/{ => rust}/.skipconfigvalidation (100%) rename examples/jwt-auth/{ => rust}/Cargo.toml (90%) rename examples/jwt-auth/{ => rust}/README.md (85%) rename examples/jwt-auth/{ => rust}/router.yaml (100%) rename examples/jwt-auth/{ => rust}/src/jwt.rs (100%) rename examples/jwt-auth/{ => rust}/src/main.rs (93%) rename examples/{rhai-logging => logging/rhai}/Cargo.toml (86%) rename examples/{rhai-data-response-mutate => logging/rhai}/README.md (63%) rename examples/{rhai-logging => logging/rhai}/router.yaml (100%) rename examples/{rhai-logging => logging/rhai}/src/main.rs (97%) rename examples/{rhai-logging => logging/rhai}/src/rhai_logging.rhai (100%) rename examples/op-name-to-header/{ => rhai}/Cargo.toml (86%) rename examples/op-name-to-header/{ => rhai}/README.md (63%) rename examples/op-name-to-header/{ => rhai}/router.yaml (100%) rename examples/op-name-to-header/{ => rhai}/src/main.rs (97%) rename examples/op-name-to-header/{ => rhai}/src/op_name_to_header.rhai (100%) delete mode 100644 examples/rhai-surrogate-cache-key/README.md rename examples/status-code-propagation/{ => rust}/.skipconfigvalidation (100%) rename examples/status-code-propagation/{ => rust}/Cargo.toml (89%) rename examples/status-code-propagation/{ => rust}/README.md (83%) rename examples/status-code-propagation/{ => rust}/router.yaml (100%) rename examples/status-code-propagation/{ => rust}/src/main.rs (79%) rename examples/status-code-propagation/{ => rust}/src/propagate_status_code.rs (100%) rename examples/{rhai-subgraph-request-log => subgraph-request-log/rhai}/Cargo.toml (87%) rename examples/{rhai-subgraph-request-log => subgraph-request-log/rhai}/README.md (59%) rename examples/{rhai-subgraph-request-log => subgraph-request-log/rhai}/router.yaml (100%) rename examples/{rhai-subgraph-request-log => subgraph-request-log/rhai}/src/main.rs (97%) rename examples/{rhai-subgraph-request-log => subgraph-request-log/rhai}/src/rhai_subgraph_request_log.rhai (100%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/.skipconfigvalidation (100%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/Cargo.toml (82%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/README.md (59%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/router.yaml (100%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/src/main.rs (91%) rename examples/{supergraph_sdl => supergraph-sdl/rust}/src/supergraph_sdl.rs (100%) rename examples/{rhai-surrogate-cache-key => surrogate-cache-key/rhai}/Cargo.toml (86%) create mode 100644 examples/surrogate-cache-key/rhai/README.md rename examples/{rhai-surrogate-cache-key => surrogate-cache-key/rhai}/router.yaml (100%) rename examples/{rhai-surrogate-cache-key => surrogate-cache-key/rhai}/src/main.rs (97%) rename examples/{rhai-surrogate-cache-key => surrogate-cache-key/rhai}/src/rhai_surrogate_cache_key.rhai (100%) diff --git a/Cargo.lock b/Cargo.lock index 06d47feb87..b226e4f1e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1658,6 +1658,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "forbid_anonymous_oeprations_rhai" +version = "0.1.0" +dependencies = [ + "anyhow", + "apollo-router", + "futures", + "http", + "serde_json", + "tokio", + "tower", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -4674,7 +4687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] -name = "supergraph_sdl" +name = "supergraph-sdl" version = "0.1.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 502b8379ec..0a774aab2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,22 +4,23 @@ members = [ "apollo-router", "apollo-router-benchmarks", "apollo-router-scaffold", - "examples/add-timestamp-header", - "examples/async-auth", - "examples/cookies-to-headers", - "examples/embedded", - "examples/context", - "examples/forbid-anonymous-operations", - "examples/hello-world", - "examples/status-code-propagation", - "examples/op-name-to-header", - "examples/rhai-logging", - "examples/rhai-data-response-mutate", - "examples/rhai-error-response-mutate", - "examples/rhai-subgraph-request-log", - "examples/rhai-surrogate-cache-key", - "examples/supergraph_sdl", - "examples/jwt-auth", + "examples/add-timestamp-header/rhai", + "examples/async-auth/rust", + "examples/cookies-to-headers/rhai", + "examples/embedded/rust", + "examples/context/rust", + "examples/forbid-anonymous-operations/rust", + "examples/forbid-anonymous-operations/rhai", + "examples/hello-world/rust", + "examples/status-code-propagation/rust", + "examples/op-name-to-header/rhai", + "examples/logging/rhai", + "examples/data-response-mutate/rhai", + "examples/error-response-mutate/rhai", + "examples/subgraph-request-log/rhai", + "examples/surrogate-cache-key/rhai", + "examples/supergraph-sdl/rust", + "examples/jwt-auth/rust", "fuzz", "xtask", ] diff --git a/examples/README.md b/examples/README.md index 2755bfb0b3..21b9cc0685 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,41 +1,48 @@ # Examples -This directory contains many examples on how to use and extend the Apollo Router. +This directory contains many examples on how to use and extend the Apollo Router. Each folder may contain `rhai` or `rust`, which dictates the kind of plugin it is. For example, [the forbid anonymous operations example](./forbid-anonymous-operations/) has both a Rhai and Rust version available, whereas [the logging example](./logging) is only demonstrated in Rhai. For those without a subfolder, it is intended to be a config-only example, such as the [telemetry samples](./telemetry). Make sure to look at the docs for: ## Yaml configuration ([documentation](https://www.apollographql.com/docs/router/configuration/overview)) + Built in functionality in the Apollo Router. -* [Header manipulation](./header-manipulation) -* [Telemetry](./telemetry) -* [Forbid mutations](./forbid_mutations) -* [Unix sockets](./unix-sockets) +- [Header manipulation](./header-manipulation) +- [Telemetry](./telemetry) +- [Forbid mutations](./forbid-mutations) +- [Unix sockets](./unix-sockets) ## Customization ([documentation](https://www.apollographql.com/docs/router/customizations/overview)) + Extending the functionality of the Apollo Router. ### Rhai + Scripting support. -* [Time request and add to header](./add-timestamp-header) -* [Cookies to headers](./cookies-to-headers) -* [Operation Name to headers](./op-name-to-header) -* [Logging](./rhai-logging) -* [Response data modification](./rhai-data-response-mutate) -* [Response errors modification](./rhai-error-response-mutate) -* [Subgraph request logging](./rhai-subgraph-request-log) -* [Surrogate cache key creation](./rhai-surrogate-cache-key) + +- [Time request and add to header](./add-timestamp-header/rhai) +- [Cookies to headers](./cookies-to-headers/rhai) +- [Operation Name to headers](./op-name-to-header/rhai) +- [Logging](./logging/rhai) +- [Response data modification](./data-response-mutate/rhai) +- [Response errors modification](./error-response-mutate/rhai) +- [Subgraph request logging](./subgraph-request-log/rhai) +- [Surrogate cache key creation](./surrogate-cache-key/rhai) ### Native Rust Plugins + Writing your own plugins in rust! -* [Hello world](./hello-world) -* [Context](./context) -* [Async auth](./async-auth) -* [Jwt auth](./jwt-auth) -* [Forbid mutations](./forbid_mutations) -* [Status code propagation](./status-code-propagation) + +- [Hello world](./hello-world/rust) +- [Context](./context/rust) +- [Async auth](./async-auth/rust) +- [Jwt auth](./jwt-auth/rust) +- [Forbid mutations](./forbid-mutations/rust) +- [Status code propagation](./status-code-propagation/rust) ### Advanced usage + Customize the router for embedding in a different web server. -* [Embedded](./embedded) +- [Embedded](./embedded/rust) diff --git a/examples/add-timestamp-header/Cargo.toml b/examples/add-timestamp-header/rhai/Cargo.toml similarity index 86% rename from examples/add-timestamp-header/Cargo.toml rename to examples/add-timestamp-header/rhai/Cargo.toml index 6bf667ad6c..a7c0d8b430 100644 --- a/examples/add-timestamp-header/Cargo.toml +++ b/examples/add-timestamp-header/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/add-timestamp-header/README.md b/examples/add-timestamp-header/rhai/README.md similarity index 59% rename from examples/add-timestamp-header/README.md rename to examples/add-timestamp-header/rhai/README.md index b2de76f5c2..0562ee228e 100644 --- a/examples/add-timestamp-header/README.md +++ b/examples/add-timestamp-header/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates header and context manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/add-timestamp-header/router.yaml b/examples/add-timestamp-header/rhai/router.yaml similarity index 100% rename from examples/add-timestamp-header/router.yaml rename to examples/add-timestamp-header/rhai/router.yaml diff --git a/examples/add-timestamp-header/src/add_timestamp_header.rhai b/examples/add-timestamp-header/rhai/src/add_timestamp_header.rhai similarity index 100% rename from examples/add-timestamp-header/src/add_timestamp_header.rhai rename to examples/add-timestamp-header/rhai/src/add_timestamp_header.rhai diff --git a/examples/add-timestamp-header/src/main.rs b/examples/add-timestamp-header/rhai/src/main.rs similarity index 97% rename from examples/add-timestamp-header/src/main.rs rename to examples/add-timestamp-header/rhai/src/main.rs index 16529edb64..f4062fb4be 100644 --- a/examples/add-timestamp-header/src/main.rs +++ b/examples/add-timestamp-header/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/async-auth/.skipconfigvalidation b/examples/async-auth/rust/.skipconfigvalidation similarity index 100% rename from examples/async-auth/.skipconfigvalidation rename to examples/async-auth/rust/.skipconfigvalidation diff --git a/examples/async-auth/Cargo.toml b/examples/async-auth/rust/Cargo.toml similarity index 89% rename from examples/async-auth/Cargo.toml rename to examples/async-auth/rust/Cargo.toml index cafcbc298b..83378ba41b 100644 --- a/examples/async-auth/Cargo.toml +++ b/examples/async-auth/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" diff --git a/examples/async-auth/README.md b/examples/async-auth/rust/README.md similarity index 89% rename from examples/async-auth/README.md rename to examples/async-auth/rust/README.md index fdbb41ccb6..16fb648cb1 100644 --- a/examples/async-auth/README.md +++ b/examples/async-auth/rust/README.md @@ -1,14 +1,16 @@ # Async authentication + Demonstrates use of `checkpoint_async` to perform authentication that depends on an asynchronous call. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation -In this example a file is read to check for an ID, but it could be any async call, for example to an external +In this example a file is read to check for an ID, but it could be any async call, for example to an external authentication server. `checkpoint` and `checkpoint_async` allow you to halt request and return immediately. This is particularly useful for authentication. @@ -19,7 +21,7 @@ authentication server. service: router::BoxService, ) -> router::BoxService { ServiceBuilder::new() - .checkpoint_async(...) // Authentication happens here + .checkpoint_async(...) // Authentication happens here .buffer(20_000) // Required, see note below .service(service) .boxed() @@ -28,4 +30,3 @@ authentication server. Note that layers that require a service to be moved across an `await` point, e.g. `checkpoint_async` or `filter_async` must be followed by a call to buffer, as they require the downstream service to be `Clone`. - diff --git a/examples/async-auth/allowedClientIds.json b/examples/async-auth/rust/allowedClientIds.json similarity index 100% rename from examples/async-auth/allowedClientIds.json rename to examples/async-auth/rust/allowedClientIds.json diff --git a/examples/async-auth/router.yaml b/examples/async-auth/rust/router.yaml similarity index 100% rename from examples/async-auth/router.yaml rename to examples/async-auth/rust/router.yaml diff --git a/examples/async-auth/src/allow_client_id_from_file.rs b/examples/async-auth/rust/src/allow_client_id_from_file.rs similarity index 100% rename from examples/async-auth/src/allow_client_id_from_file.rs rename to examples/async-auth/rust/src/allow_client_id_from_file.rs diff --git a/examples/async-auth/src/main.rs b/examples/async-auth/rust/src/main.rs similarity index 94% rename from examples/async-auth/src/main.rs rename to examples/async-auth/rust/src/main.rs index f5eb806e70..c51a24d6e9 100644 --- a/examples/async-auth/src/main.rs +++ b/examples/async-auth/rust/src/main.rs @@ -32,7 +32,7 @@ mod allow_client_id_from_file; use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/context/.skipconfigvalidation b/examples/context/rust/.skipconfigvalidation similarity index 100% rename from examples/context/.skipconfigvalidation rename to examples/context/rust/.skipconfigvalidation diff --git a/examples/context/Cargo.toml b/examples/context/rust/Cargo.toml similarity index 85% rename from examples/context/Cargo.toml rename to examples/context/rust/Cargo.toml index 1cb06d6ca0..807f26d05c 100644 --- a/examples/context/Cargo.toml +++ b/examples/context/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" diff --git a/examples/context/README.md b/examples/context/rust/README.md similarity index 88% rename from examples/context/README.md rename to examples/context/rust/README.md index 2b2fac9a67..34d81595f4 100644 --- a/examples/context/README.md +++ b/examples/context/rust/README.md @@ -3,15 +3,18 @@ Demonstrate use of context to pass information between request lifecycle stages. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation + Context can be used to pass information between services. It's useful for storing things like authentication data or collecting cache control information. The request lifecycle looks like this: + ```mermaid sequenceDiagram actor Client @@ -22,14 +25,14 @@ sequenceDiagram Client->>SupergraphService: request SupergraphService->>QueryPlannerService: plan - QueryPlannerService-->>SupergraphService: + QueryPlannerService-->>SupergraphService: SupergraphService->>ExecutionService: execute ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-->>SupergraphService: response SupergraphService-->>Client: response ``` @@ -37,12 +40,14 @@ sequenceDiagram For each request a single instance of `Context` is created and maintained . In this example we: + 1. Place some information in context at the incoming request of the router service. (world!) 2. Pick up and print it out at subgraph request. (Hello world!) 3. For each subgraph response merge some information into the `Context`. (response_count) 4. Pick up and print it out at router response. (response_count) Context can store anything that is `Serde` compatible. For instance, all simple types or a custom type. + ```rust # Insert context.insert("key1", 1)?; @@ -50,6 +55,7 @@ context.insert("key1", 1)?; Serialization and deserialization happen automatically. You may sometimes need to specify the type in the case where the rust compiler cannot figure it out by itself. + ```rust # Get let value : u32 = context.get("key1")?; @@ -57,6 +63,7 @@ let value : u32 = context.get("key1")?; Upserts are guaranteed to happen serially. This is useful at the subgraph service where multiple requests are happening in parallel. + ```rust # Upsert context.upsert("present", |v| v + 1, || 0)?; diff --git a/examples/context/router.yaml b/examples/context/rust/router.yaml similarity index 100% rename from examples/context/router.yaml rename to examples/context/rust/router.yaml diff --git a/examples/context/src/context_data.rs b/examples/context/rust/src/context_data.rs similarity index 100% rename from examples/context/src/context_data.rs rename to examples/context/rust/src/context_data.rs diff --git a/examples/context/src/main.rs b/examples/context/rust/src/main.rs similarity index 91% rename from examples/context/src/main.rs rename to examples/context/rust/src/main.rs index 643ae5d780..dc70d6a74a 100644 --- a/examples/context/src/main.rs +++ b/examples/context/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod context_data; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/cookies-to-headers/Cargo.toml b/examples/cookies-to-headers/rhai/Cargo.toml similarity index 86% rename from examples/cookies-to-headers/Cargo.toml rename to examples/cookies-to-headers/rhai/Cargo.toml index 268d96b3b6..d1187fc3bc 100644 --- a/examples/cookies-to-headers/Cargo.toml +++ b/examples/cookies-to-headers/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3.21" http = "0.2" serde_json = "1" diff --git a/examples/cookies-to-headers/README.md b/examples/cookies-to-headers/rhai/README.md similarity index 56% rename from examples/cookies-to-headers/README.md rename to examples/cookies-to-headers/rhai/README.md index 91579727b3..a861c069b3 100644 --- a/examples/cookies-to-headers/README.md +++ b/examples/cookies-to-headers/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates header manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/cookies-to-headers/router.yaml b/examples/cookies-to-headers/rhai/router.yaml similarity index 100% rename from examples/cookies-to-headers/router.yaml rename to examples/cookies-to-headers/rhai/router.yaml diff --git a/examples/cookies-to-headers/src/cookies_to_headers.rhai b/examples/cookies-to-headers/rhai/src/cookies_to_headers.rhai similarity index 100% rename from examples/cookies-to-headers/src/cookies_to_headers.rhai rename to examples/cookies-to-headers/rhai/src/cookies_to_headers.rhai diff --git a/examples/cookies-to-headers/src/main.rs b/examples/cookies-to-headers/rhai/src/main.rs similarity index 98% rename from examples/cookies-to-headers/src/main.rs rename to examples/cookies-to-headers/rhai/src/main.rs index 8849151a9a..546080c90d 100644 --- a/examples/cookies-to-headers/src/main.rs +++ b/examples/cookies-to-headers/rhai/src/main.rs @@ -25,7 +25,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-data-response-mutate/Cargo.toml b/examples/data-response-mutate/rhai/Cargo.toml similarity index 87% rename from examples/rhai-data-response-mutate/Cargo.toml rename to examples/data-response-mutate/rhai/Cargo.toml index 0895c205ab..55d22a7d3d 100644 --- a/examples/rhai-data-response-mutate/Cargo.toml +++ b/examples/data-response-mutate/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/rhai-error-response-mutate/README.md b/examples/data-response-mutate/rhai/README.md similarity index 63% rename from examples/rhai-error-response-mutate/README.md rename to examples/data-response-mutate/rhai/README.md index 81960c8a9c..5d15a12d53 100644 --- a/examples/rhai-error-response-mutate/README.md +++ b/examples/data-response-mutate/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/rhai-data-response-mutate/router.yaml b/examples/data-response-mutate/rhai/router.yaml similarity index 100% rename from examples/rhai-data-response-mutate/router.yaml rename to examples/data-response-mutate/rhai/router.yaml diff --git a/examples/rhai-data-response-mutate/src/main.rs b/examples/data-response-mutate/rhai/src/main.rs similarity index 97% rename from examples/rhai-data-response-mutate/src/main.rs rename to examples/data-response-mutate/rhai/src/main.rs index 65df3d4f6f..1772efaa01 100644 --- a/examples/rhai-data-response-mutate/src/main.rs +++ b/examples/data-response-mutate/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-data-response-mutate/src/rhai_data_response_mutate.rhai b/examples/data-response-mutate/rhai/src/rhai_data_response_mutate.rhai similarity index 100% rename from examples/rhai-data-response-mutate/src/rhai_data_response_mutate.rhai rename to examples/data-response-mutate/rhai/src/rhai_data_response_mutate.rhai diff --git a/examples/embedded/.skipconfigvalidation b/examples/embedded/rust/.skipconfigvalidation similarity index 100% rename from examples/embedded/.skipconfigvalidation rename to examples/embedded/rust/.skipconfigvalidation diff --git a/examples/embedded/Cargo.toml b/examples/embedded/rust/Cargo.toml similarity index 85% rename from examples/embedded/Cargo.toml rename to examples/embedded/rust/Cargo.toml index 380bca6382..6e49bf7b8e 100644 --- a/examples/embedded/Cargo.toml +++ b/examples/embedded/rust/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" serde_json = "1" tokio = { version = "1", features = ["full"] } diff --git a/examples/embedded/README.md b/examples/embedded/rust/README.md similarity index 100% rename from examples/embedded/README.md rename to examples/embedded/rust/README.md diff --git a/examples/embedded/router.yaml b/examples/embedded/rust/router.yaml similarity index 100% rename from examples/embedded/router.yaml rename to examples/embedded/rust/router.yaml diff --git a/examples/embedded/src/main.rs b/examples/embedded/rust/src/main.rs similarity index 93% rename from examples/embedded/src/main.rs rename to examples/embedded/rust/src/main.rs index 8231897612..25a919270e 100644 --- a/examples/embedded/src/main.rs +++ b/examples/embedded/rust/src/main.rs @@ -6,7 +6,7 @@ use tower::ServiceExt; async fn main() -> Result<(), tower::BoxError> { // TestHarness creates a GraphQL pipeline to process queries against a supergraph Schema let router = TestHarness::builder() - .schema(include_str!("../../graphql/supergraph.graphql")) + .schema(include_str!("../../../graphql/supergraph.graphql")) .with_subgraph_network_requests() .build() .await?; diff --git a/examples/rhai-error-response-mutate/Cargo.toml b/examples/error-response-mutate/rhai/Cargo.toml similarity index 87% rename from examples/rhai-error-response-mutate/Cargo.toml rename to examples/error-response-mutate/rhai/Cargo.toml index 2715e854e2..1c533fb86f 100644 --- a/examples/rhai-error-response-mutate/Cargo.toml +++ b/examples/error-response-mutate/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/rhai-logging/README.md b/examples/error-response-mutate/rhai/README.md similarity index 63% rename from examples/rhai-logging/README.md rename to examples/error-response-mutate/rhai/README.md index 81960c8a9c..5d15a12d53 100644 --- a/examples/rhai-logging/README.md +++ b/examples/error-response-mutate/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/rhai-error-response-mutate/router.yaml b/examples/error-response-mutate/rhai/router.yaml similarity index 100% rename from examples/rhai-error-response-mutate/router.yaml rename to examples/error-response-mutate/rhai/router.yaml diff --git a/examples/rhai-error-response-mutate/src/main.rs b/examples/error-response-mutate/rhai/src/main.rs similarity index 97% rename from examples/rhai-error-response-mutate/src/main.rs rename to examples/error-response-mutate/rhai/src/main.rs index 6c35f8c4b8..e59020b1ae 100644 --- a/examples/rhai-error-response-mutate/src/main.rs +++ b/examples/error-response-mutate/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-error-response-mutate/src/rhai_error_response_mutate.rhai b/examples/error-response-mutate/rhai/src/rhai_error_response_mutate.rhai similarity index 100% rename from examples/rhai-error-response-mutate/src/rhai_error_response_mutate.rhai rename to examples/error-response-mutate/rhai/src/rhai_error_response_mutate.rhai diff --git a/examples/forbid-anonymous-operations/rhai/Cargo.toml b/examples/forbid-anonymous-operations/rhai/Cargo.toml new file mode 100644 index 0000000000..d87c14209b --- /dev/null +++ b/examples/forbid-anonymous-operations/rhai/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "forbid_anonymous_oeprations_rhai" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dependencies] +anyhow = "1" +apollo-router = { path = "../../../apollo-router" } +futures = "0.3" +http = "0.2" +serde_json = "1" +tokio = { version = "1", features = ["full"] } +tower = { version = "0.4", features = ["full"] } diff --git a/examples/forbid-anonymous-operations/rhai/README.md b/examples/forbid-anonymous-operations/rhai/README.md new file mode 100644 index 0000000000..d418d1b01f --- /dev/null +++ b/examples/forbid-anonymous-operations/rhai/README.md @@ -0,0 +1,8 @@ +# Rhai script + +Demonstrates header and context manipulation via Rhai script. + +Usage: +```bash +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml +``` diff --git a/examples/forbid-anonymous-operations/rhai/router.yaml b/examples/forbid-anonymous-operations/rhai/router.yaml new file mode 100644 index 0000000000..20588a05de --- /dev/null +++ b/examples/forbid-anonymous-operations/rhai/router.yaml @@ -0,0 +1,11 @@ +rhai: + scripts: src + main: forbid_anonymous_operations.rhai +sandbox: + enabled: true +# make sure you enable introspection +supergraph: + introspection: true +# make sure homepage is disabled +homepage: + enabled: false diff --git a/examples/forbid-anonymous-operations/rhai/src/forbid_anonymous_operations.rhai b/examples/forbid-anonymous-operations/rhai/src/forbid_anonymous_operations.rhai new file mode 100644 index 0000000000..a59077c5ed --- /dev/null +++ b/examples/forbid-anonymous-operations/rhai/src/forbid_anonymous_operations.rhai @@ -0,0 +1,17 @@ +// This example illustrates how reject anonymous operations (operations without a name defined). + +// At the supergraph_service stage, register callbacks for processing +// responses. +fn supergraph_service(service){ + const request_callback = Fn("process_request"); + service.map_request(request_callback) +} + +// For each request, we'll check for the existence of an operation name, +// exposed by the request.body.operation_name variable +// If missing, we throw an error; otherwise, the request proceeds as normal. +fn process_request(request){ + if request.body.operation_name == () { + throw "Anonymous operations are not allowed"; + } +} \ No newline at end of file diff --git a/examples/forbid-anonymous-operations/rhai/src/main.rs b/examples/forbid-anonymous-operations/rhai/src/main.rs new file mode 100644 index 0000000000..f4b2bdab4d --- /dev/null +++ b/examples/forbid-anonymous-operations/rhai/src/main.rs @@ -0,0 +1,73 @@ +//! % curl -v \ +//! --header 'content-type: application/json' \ +//! --url 'http://127.0.0.1:4000' \ +//! --data '{"operationName": "", "query":"query Query {\n me {\n name\n }\n}"}' + +use anyhow::Result; + +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +fn main() -> Result<()> { + apollo_router::main() +} + +#[cfg(test)] +mod tests { + use apollo_router::plugin::test; + use apollo_router::services::supergraph; + use http::StatusCode; + use tower::util::ServiceExt; + + #[tokio::test] + async fn test_router_forbids_anonymous_operation() { + let mut mock_service = test::MockSupergraphService::new(); + // create a mock service we will use to test our plugin + + // The expected reply is going to be JSON returned in the SupergraphResponse { data } section. + let expected_mock_response_data = "response created within the mock"; + + // Let's set up our mock to make sure it will be called once + mock_service.expect_clone().return_once(move || { + let mut mock_service = test::MockSupergraphService::new(); + mock_service + .expect_call() + .once() + .returning(move |req: supergraph::Request| { + // Preserve our context from request to response + Ok(supergraph::Response::fake_builder() + .context(req.context) + .data(expected_mock_response_data) + .build() + .unwrap()) + }); + mock_service + }); + + let config = serde_json::json!({ + "rhai": { + "scripts": "src", + "main": "forbid_anonymous_operations.rhai", + } + }); + let test_harness = apollo_router::TestHarness::builder() + .configuration_json(config) + .unwrap() + .supergraph_hook(move |_| mock_service.clone().boxed()) + .build() + .await + .unwrap(); + + // Let's create a request with our operation name + let request_with_no_name = supergraph::Request::canned_builder().build().unwrap(); + + // ...And call our service stack with it + let mut service_response = test_harness.oneshot(request_with_no_name).await.unwrap(); + + let _response = service_response.next_response().await.unwrap(); + println!("RESPONSE: {:?}", _response); + // Rhai should return a 500 + assert_eq!( + StatusCode::INTERNAL_SERVER_ERROR, + service_response.response.status() + ); + } +} diff --git a/examples/forbid-anonymous-operations/.skipconfigvalidation b/examples/forbid-anonymous-operations/rust/.skipconfigvalidation similarity index 100% rename from examples/forbid-anonymous-operations/.skipconfigvalidation rename to examples/forbid-anonymous-operations/rust/.skipconfigvalidation diff --git a/examples/forbid-anonymous-operations/Cargo.toml b/examples/forbid-anonymous-operations/rust/Cargo.toml similarity index 88% rename from examples/forbid-anonymous-operations/Cargo.toml rename to examples/forbid-anonymous-operations/rust/Cargo.toml index cd56902484..889e15c3f0 100644 --- a/examples/forbid-anonymous-operations/Cargo.toml +++ b/examples/forbid-anonymous-operations/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" diff --git a/examples/forbid-anonymous-operations/README.md b/examples/forbid-anonymous-operations/rust/README.md similarity index 89% rename from examples/forbid-anonymous-operations/README.md rename to examples/forbid-anonymous-operations/rust/README.md index ebc75cf65c..99141d5632 100644 --- a/examples/forbid-anonymous-operations/README.md +++ b/examples/forbid-anonymous-operations/rust/README.md @@ -3,8 +3,9 @@ Demonstrates using `checkpoint` to prevent requests with anonymous operations. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation @@ -22,4 +23,3 @@ cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml .boxed() } ``` - diff --git a/examples/forbid-anonymous-operations/router.yaml b/examples/forbid-anonymous-operations/rust/router.yaml similarity index 100% rename from examples/forbid-anonymous-operations/router.yaml rename to examples/forbid-anonymous-operations/rust/router.yaml diff --git a/examples/forbid-anonymous-operations/src/forbid_anonymous_operations.rs b/examples/forbid-anonymous-operations/rust/src/forbid_anonymous_operations.rs similarity index 100% rename from examples/forbid-anonymous-operations/src/forbid_anonymous_operations.rs rename to examples/forbid-anonymous-operations/rust/src/forbid_anonymous_operations.rs diff --git a/examples/forbid-anonymous-operations/src/main.rs b/examples/forbid-anonymous-operations/rust/src/main.rs similarity index 91% rename from examples/forbid-anonymous-operations/src/main.rs rename to examples/forbid-anonymous-operations/rust/src/main.rs index be28cb1a97..898710fd99 100644 --- a/examples/forbid-anonymous-operations/src/main.rs +++ b/examples/forbid-anonymous-operations/rust/src/main.rs @@ -18,7 +18,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod forbid_anonymous_operations; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/forbid_mutations/README.md b/examples/forbid-mutations/README.md similarity index 74% rename from examples/forbid_mutations/README.md rename to examples/forbid-mutations/README.md index 34ff5f859e..6ea3c6fa89 100644 --- a/examples/forbid_mutations/README.md +++ b/examples/forbid-mutations/README.md @@ -5,7 +5,7 @@ Demonstrates forbidding mutations. This is particularly useful for when you are testing the router against an existing Gateway via traffic mirroring. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` - diff --git a/examples/forbid_mutations/router.yaml b/examples/forbid-mutations/router.yaml similarity index 79% rename from examples/forbid_mutations/router.yaml rename to examples/forbid-mutations/router.yaml index 86774fb051..3498e6974d 100644 --- a/examples/forbid_mutations/router.yaml +++ b/examples/forbid-mutations/router.yaml @@ -1,5 +1,5 @@ # run a router with this configuration from the project's root directory: -# ./router -c ./examples/forbid_mutations/router.yaml -s ./examples/graphql/supergraph.graphql +# ./router -c ./examples/forbid-mutations/router.yaml -s ./examples/graphql/supergraph.graphql # You can then open http://localhost:4000 on your browser, # and try to run a Query and a Mutation in apollo studio. forbid_mutations: true diff --git a/examples/header-manipulation/README.md b/examples/header-manipulation/README.md index 240f37968b..62fe1d6aa4 100644 --- a/examples/header-manipulation/README.md +++ b/examples/header-manipulation/README.md @@ -3,12 +3,13 @@ Demonstrates header manipulation can be performed via yaml configuration. Possible operations are: -* Insert -* Propagate (exact, matching, rename, default) -* Remove (exact, matching) + +- Insert +- Propagate (exact, matching, rename, default) +- Remove (exact, matching) ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` - diff --git a/examples/hello-world/.skipconfigvalidation b/examples/hello-world/rust/.skipconfigvalidation similarity index 100% rename from examples/hello-world/.skipconfigvalidation rename to examples/hello-world/rust/.skipconfigvalidation diff --git a/examples/hello-world/Cargo.toml b/examples/hello-world/rust/Cargo.toml similarity index 88% rename from examples/hello-world/Cargo.toml rename to examples/hello-world/rust/Cargo.toml index b9d400d12a..21180a42f1 100644 --- a/examples/hello-world/Cargo.toml +++ b/examples/hello-world/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" schemars = { version = "0.8", features = ["url"] } diff --git a/examples/hello-world/README.md b/examples/hello-world/rust/README.md similarity index 76% rename from examples/hello-world/README.md rename to examples/hello-world/rust/README.md index 12cecef095..9dc0b69b87 100644 --- a/examples/hello-world/README.md +++ b/examples/hello-world/rust/README.md @@ -7,6 +7,7 @@ You can copy it when creating your own plugins. Configuration that your plugin exposes will automatically participate in `router.yaml`. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/hello-world/router.yaml b/examples/hello-world/rust/router.yaml similarity index 100% rename from examples/hello-world/router.yaml rename to examples/hello-world/rust/router.yaml diff --git a/examples/hello-world/src/hello_world.rs b/examples/hello-world/rust/src/hello_world.rs similarity index 100% rename from examples/hello-world/src/hello_world.rs rename to examples/hello-world/rust/src/hello_world.rs diff --git a/examples/hello-world/src/main.rs b/examples/hello-world/rust/src/main.rs similarity index 91% rename from examples/hello-world/src/main.rs rename to examples/hello-world/rust/src/main.rs index 89d7f03567..f29a1aa827 100644 --- a/examples/hello-world/src/main.rs +++ b/examples/hello-world/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yml` mod hello_world; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/jwt-auth/.skipconfigvalidation b/examples/jwt-auth/rust/.skipconfigvalidation similarity index 100% rename from examples/jwt-auth/.skipconfigvalidation rename to examples/jwt-auth/rust/.skipconfigvalidation diff --git a/examples/jwt-auth/Cargo.toml b/examples/jwt-auth/rust/Cargo.toml similarity index 90% rename from examples/jwt-auth/Cargo.toml rename to examples/jwt-auth/rust/Cargo.toml index 1f6abb37e3..d55ebefbd3 100644 --- a/examples/jwt-auth/Cargo.toml +++ b/examples/jwt-auth/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" hex = "0.4" diff --git a/examples/jwt-auth/README.md b/examples/jwt-auth/rust/README.md similarity index 85% rename from examples/jwt-auth/README.md rename to examples/jwt-auth/rust/README.md index a0ac11deda..d1c5d6924e 100644 --- a/examples/jwt-auth/README.md +++ b/examples/jwt-auth/rust/README.md @@ -1,13 +1,14 @@ # JWT authentication -DISCLAIMER: This is an example for illustrative purposes. It has not been security audited and is purely intended as an +DISCLAIMER: This is an example for illustrative purposes. It has not been security audited and is purely intended as an illustration of an approach to JWT verification via a router plugin. Demonstrates using `checkpoint` to perform authentication and reject requests that do not pass auth. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation @@ -25,4 +26,3 @@ cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml .boxed() } ``` - diff --git a/examples/jwt-auth/router.yaml b/examples/jwt-auth/rust/router.yaml similarity index 100% rename from examples/jwt-auth/router.yaml rename to examples/jwt-auth/rust/router.yaml diff --git a/examples/jwt-auth/src/jwt.rs b/examples/jwt-auth/rust/src/jwt.rs similarity index 100% rename from examples/jwt-auth/src/jwt.rs rename to examples/jwt-auth/rust/src/jwt.rs diff --git a/examples/jwt-auth/src/main.rs b/examples/jwt-auth/rust/src/main.rs similarity index 93% rename from examples/jwt-auth/src/main.rs rename to examples/jwt-auth/rust/src/main.rs index c3f9b8a20b..1a236fd4f2 100644 --- a/examples/jwt-auth/src/main.rs +++ b/examples/jwt-auth/rust/src/main.rs @@ -19,7 +19,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod jwt; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-logging/Cargo.toml b/examples/logging/rhai/Cargo.toml similarity index 86% rename from examples/rhai-logging/Cargo.toml rename to examples/logging/rhai/Cargo.toml index 9a34305268..3ce8c1c19e 100644 --- a/examples/rhai-logging/Cargo.toml +++ b/examples/logging/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/rhai-data-response-mutate/README.md b/examples/logging/rhai/README.md similarity index 63% rename from examples/rhai-data-response-mutate/README.md rename to examples/logging/rhai/README.md index 81960c8a9c..5d15a12d53 100644 --- a/examples/rhai-data-response-mutate/README.md +++ b/examples/logging/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/rhai-logging/router.yaml b/examples/logging/rhai/router.yaml similarity index 100% rename from examples/rhai-logging/router.yaml rename to examples/logging/rhai/router.yaml diff --git a/examples/rhai-logging/src/main.rs b/examples/logging/rhai/src/main.rs similarity index 97% rename from examples/rhai-logging/src/main.rs rename to examples/logging/rhai/src/main.rs index ba789a31f5..57e94d17f0 100644 --- a/examples/rhai-logging/src/main.rs +++ b/examples/logging/rhai/src/main.rs @@ -6,7 +6,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-logging/src/rhai_logging.rhai b/examples/logging/rhai/src/rhai_logging.rhai similarity index 100% rename from examples/rhai-logging/src/rhai_logging.rhai rename to examples/logging/rhai/src/rhai_logging.rhai diff --git a/examples/op-name-to-header/Cargo.toml b/examples/op-name-to-header/rhai/Cargo.toml similarity index 86% rename from examples/op-name-to-header/Cargo.toml rename to examples/op-name-to-header/rhai/Cargo.toml index 1a14ee3172..5e98b5a40d 100644 --- a/examples/op-name-to-header/Cargo.toml +++ b/examples/op-name-to-header/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/op-name-to-header/README.md b/examples/op-name-to-header/rhai/README.md similarity index 63% rename from examples/op-name-to-header/README.md rename to examples/op-name-to-header/rhai/README.md index 81960c8a9c..5d15a12d53 100644 --- a/examples/op-name-to-header/README.md +++ b/examples/op-name-to-header/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/op-name-to-header/router.yaml b/examples/op-name-to-header/rhai/router.yaml similarity index 100% rename from examples/op-name-to-header/router.yaml rename to examples/op-name-to-header/rhai/router.yaml diff --git a/examples/op-name-to-header/src/main.rs b/examples/op-name-to-header/rhai/src/main.rs similarity index 97% rename from examples/op-name-to-header/src/main.rs rename to examples/op-name-to-header/rhai/src/main.rs index 109044a30c..17ec0d1b1c 100644 --- a/examples/op-name-to-header/src/main.rs +++ b/examples/op-name-to-header/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/op-name-to-header/src/op_name_to_header.rhai b/examples/op-name-to-header/rhai/src/op_name_to_header.rhai similarity index 100% rename from examples/op-name-to-header/src/op_name_to_header.rhai rename to examples/op-name-to-header/rhai/src/op_name_to_header.rhai diff --git a/examples/rhai-surrogate-cache-key/README.md b/examples/rhai-surrogate-cache-key/README.md deleted file mode 100644 index 81960c8a9c..0000000000 --- a/examples/rhai-surrogate-cache-key/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Rhai script - -Demonstrates extracting body details and header manipulation via Rhai script. - -Usage: -```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml -``` diff --git a/examples/status-code-propagation/.skipconfigvalidation b/examples/status-code-propagation/rust/.skipconfigvalidation similarity index 100% rename from examples/status-code-propagation/.skipconfigvalidation rename to examples/status-code-propagation/rust/.skipconfigvalidation diff --git a/examples/status-code-propagation/Cargo.toml b/examples/status-code-propagation/rust/Cargo.toml similarity index 89% rename from examples/status-code-propagation/Cargo.toml rename to examples/status-code-propagation/rust/Cargo.toml index 13adce0237..101407778b 100644 --- a/examples/status-code-propagation/Cargo.toml +++ b/examples/status-code-propagation/rust/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" diff --git a/examples/status-code-propagation/README.md b/examples/status-code-propagation/rust/README.md similarity index 83% rename from examples/status-code-propagation/README.md rename to examples/status-code-propagation/rust/README.md index 4dc9a94ea2..cc529e3dae 100644 --- a/examples/status-code-propagation/README.md +++ b/examples/status-code-propagation/rust/README.md @@ -4,15 +4,18 @@ Demonstrates propagation of http status code from subgraph services to the overa For instance, if a subgraph service fails and returns non 200 status code then it is propagated to the client. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation + This implementation makes use of `map_response` and `Context` to pass information from subgraph requests to the overall `router_response` service. The request lifecycle looks like this: + ```mermaid sequenceDiagram actor Client @@ -23,17 +26,17 @@ sequenceDiagram Client->>SupergraphService: request SupergraphService->>QueryPlannerService: plan - QueryPlannerService-->>SupergraphService: + QueryPlannerService-->>SupergraphService: SupergraphService->>ExecutionService: execute par ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: - and + SubgraphService(s)--)ExecutionService: + and ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: - and + SubgraphService(s)--)ExecutionService: + and ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: end ExecutionService-->>SupergraphService: response SupergraphService-->>Client: response diff --git a/examples/status-code-propagation/router.yaml b/examples/status-code-propagation/rust/router.yaml similarity index 100% rename from examples/status-code-propagation/router.yaml rename to examples/status-code-propagation/rust/router.yaml diff --git a/examples/status-code-propagation/src/main.rs b/examples/status-code-propagation/rust/src/main.rs similarity index 79% rename from examples/status-code-propagation/src/main.rs rename to examples/status-code-propagation/rust/src/main.rs index a63a222751..90c6ed7076 100644 --- a/examples/status-code-propagation/src/main.rs +++ b/examples/status-code-propagation/rust/src/main.rs @@ -6,7 +6,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod propagate_status_code; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/status-code-propagation/src/propagate_status_code.rs b/examples/status-code-propagation/rust/src/propagate_status_code.rs similarity index 100% rename from examples/status-code-propagation/src/propagate_status_code.rs rename to examples/status-code-propagation/rust/src/propagate_status_code.rs diff --git a/examples/rhai-subgraph-request-log/Cargo.toml b/examples/subgraph-request-log/rhai/Cargo.toml similarity index 87% rename from examples/rhai-subgraph-request-log/Cargo.toml rename to examples/subgraph-request-log/rhai/Cargo.toml index 4331128b45..b703adf341 100644 --- a/examples/rhai-subgraph-request-log/Cargo.toml +++ b/examples/subgraph-request-log/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/rhai-subgraph-request-log/README.md b/examples/subgraph-request-log/rhai/README.md similarity index 59% rename from examples/rhai-subgraph-request-log/README.md rename to examples/subgraph-request-log/rhai/README.md index 774e1e34e0..5cf3cf8b66 100644 --- a/examples/rhai-subgraph-request-log/README.md +++ b/examples/subgraph-request-log/rhai/README.md @@ -3,6 +3,7 @@ Demonstrates logging subgraph request details via Rhai script. Usage: + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` diff --git a/examples/rhai-subgraph-request-log/router.yaml b/examples/subgraph-request-log/rhai/router.yaml similarity index 100% rename from examples/rhai-subgraph-request-log/router.yaml rename to examples/subgraph-request-log/rhai/router.yaml diff --git a/examples/rhai-subgraph-request-log/src/main.rs b/examples/subgraph-request-log/rhai/src/main.rs similarity index 97% rename from examples/rhai-subgraph-request-log/src/main.rs rename to examples/subgraph-request-log/rhai/src/main.rs index 55cb2d2c63..79fbbbafff 100644 --- a/examples/rhai-subgraph-request-log/src/main.rs +++ b/examples/subgraph-request-log/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-subgraph-request-log/src/rhai_subgraph_request_log.rhai b/examples/subgraph-request-log/rhai/src/rhai_subgraph_request_log.rhai similarity index 100% rename from examples/rhai-subgraph-request-log/src/rhai_subgraph_request_log.rhai rename to examples/subgraph-request-log/rhai/src/rhai_subgraph_request_log.rhai diff --git a/examples/supergraph_sdl/.skipconfigvalidation b/examples/supergraph-sdl/rust/.skipconfigvalidation similarity index 100% rename from examples/supergraph_sdl/.skipconfigvalidation rename to examples/supergraph-sdl/rust/.skipconfigvalidation diff --git a/examples/supergraph_sdl/Cargo.toml b/examples/supergraph-sdl/rust/Cargo.toml similarity index 82% rename from examples/supergraph_sdl/Cargo.toml rename to examples/supergraph-sdl/rust/Cargo.toml index da23fc416f..5743ed42d8 100644 --- a/examples/supergraph_sdl/Cargo.toml +++ b/examples/supergraph-sdl/rust/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "supergraph_sdl" +name = "supergraph-sdl" version = "0.1.0" edition = "2021" @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1" apollo-compiler = "0.1.0" apollo-parser = "0.2.8" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" diff --git a/examples/supergraph_sdl/README.md b/examples/supergraph-sdl/rust/README.md similarity index 59% rename from examples/supergraph_sdl/README.md rename to examples/supergraph-sdl/rust/README.md index ec6d27b85d..0f0c7b7392 100644 --- a/examples/supergraph_sdl/README.md +++ b/examples/supergraph-sdl/rust/README.md @@ -1,17 +1,20 @@ # Context -Demonstrate use of supergraph sdl (schema definition language) applied in various request lifecycle stages. +Demonstrate use of supergraph sdl (schema definition language) applied in various request lifecycle stages. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml ``` ## Implementation -A plugin receives the supergraph sdl at startup (when `new` is invoked). + +A plugin receives the supergraph sdl at startup (when `new` is invoked). The schema may then be used in various plugin lifecycle hooks. The request lifecycle looks like this: + ```mermaid sequenceDiagram actor Client @@ -22,19 +25,20 @@ sequenceDiagram Client->>SupergraphService: request SupergraphService->>QueryPlannerService: plan - QueryPlannerService-->>SupergraphService: + QueryPlannerService-->>SupergraphService: SupergraphService->>ExecutionService: execute ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-)SubgraphService(s): sub-request - SubgraphService(s)--)ExecutionService: + SubgraphService(s)--)ExecutionService: ExecutionService-->>SupergraphService: response SupergraphService-->>Client: response ``` In this example we: - - Store the supplied supergraph in our main struct - - Use it to create a compiler context with apollo-rs ApolloCompiler - - Log out any diagnostic errors or warning from the compiled supergraph + +- Store the supplied supergraph in our main struct +- Use it to create a compiler context with apollo-rs ApolloCompiler +- Log out any diagnostic errors or warning from the compiled supergraph diff --git a/examples/supergraph_sdl/router.yaml b/examples/supergraph-sdl/rust/router.yaml similarity index 100% rename from examples/supergraph_sdl/router.yaml rename to examples/supergraph-sdl/rust/router.yaml diff --git a/examples/supergraph_sdl/src/main.rs b/examples/supergraph-sdl/rust/src/main.rs similarity index 91% rename from examples/supergraph_sdl/src/main.rs rename to examples/supergraph-sdl/rust/src/main.rs index c19acf52a1..be5bf58ae4 100644 --- a/examples/supergraph_sdl/src/main.rs +++ b/examples/supergraph-sdl/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod supergraph_sdl; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/supergraph_sdl/src/supergraph_sdl.rs b/examples/supergraph-sdl/rust/src/supergraph_sdl.rs similarity index 100% rename from examples/supergraph_sdl/src/supergraph_sdl.rs rename to examples/supergraph-sdl/rust/src/supergraph_sdl.rs diff --git a/examples/rhai-surrogate-cache-key/Cargo.toml b/examples/surrogate-cache-key/rhai/Cargo.toml similarity index 86% rename from examples/rhai-surrogate-cache-key/Cargo.toml rename to examples/surrogate-cache-key/rhai/Cargo.toml index 168ab45e43..8f9e65c551 100644 --- a/examples/rhai-surrogate-cache-key/Cargo.toml +++ b/examples/surrogate-cache-key/rhai/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-router = { path = "../../apollo-router" } +apollo-router = { path = "../../../apollo-router" } futures = "0.3" http = "0.2" serde_json = "1" diff --git a/examples/surrogate-cache-key/rhai/README.md b/examples/surrogate-cache-key/rhai/README.md new file mode 100644 index 0000000000..5d15a12d53 --- /dev/null +++ b/examples/surrogate-cache-key/rhai/README.md @@ -0,0 +1,9 @@ +# Rhai script + +Demonstrates extracting body details and header manipulation via Rhai script. + +Usage: + +```bash +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +``` diff --git a/examples/rhai-surrogate-cache-key/router.yaml b/examples/surrogate-cache-key/rhai/router.yaml similarity index 100% rename from examples/rhai-surrogate-cache-key/router.yaml rename to examples/surrogate-cache-key/rhai/router.yaml diff --git a/examples/rhai-surrogate-cache-key/src/main.rs b/examples/surrogate-cache-key/rhai/src/main.rs similarity index 97% rename from examples/rhai-surrogate-cache-key/src/main.rs rename to examples/surrogate-cache-key/rhai/src/main.rs index 980aefd288..92000f0d5f 100644 --- a/examples/rhai-surrogate-cache-key/src/main.rs +++ b/examples/surrogate-cache-key/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../graphql/supergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/rhai-surrogate-cache-key/src/rhai_surrogate_cache_key.rhai b/examples/surrogate-cache-key/rhai/src/rhai_surrogate_cache_key.rhai similarity index 100% rename from examples/rhai-surrogate-cache-key/src/rhai_surrogate_cache_key.rhai rename to examples/surrogate-cache-key/rhai/src/rhai_surrogate_cache_key.rhai diff --git a/examples/telemetry/README.md b/examples/telemetry/README.md index 8cfd22096d..dd0192a062 100644 --- a/examples/telemetry/README.md +++ b/examples/telemetry/README.md @@ -2,19 +2,19 @@ Demonstrates configuring of the router for: -* OpenTelemetry - * Jaeger - * OpenTelemetry Collector -* Spaceport (Apollo Studio) - +- OpenTelemetry + - Jaeger + - OpenTelemetry Collector +- Spaceport (Apollo Studio) ## OpenTelemetry + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./jaeger.router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./jaeger.router.yaml ``` + ## OpenTelemetry Collector + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./oltp.router.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./oltp.router.yaml ``` - - diff --git a/examples/unix-sockets/README.md b/examples/unix-sockets/README.md index abd9de1d25..b9354222f1 100644 --- a/examples/unix-sockets/README.md +++ b/examples/unix-sockets/README.md @@ -3,6 +3,7 @@ Demonstrates configuring of the router to listen to a unix socket. ## Usage + ```bash -cargo run -- -s ../graphql/supergraph.graphql -c ./router_unix.yaml +cargo run -- -s ../../graphqlsupergraph.graphql -c ./router_unix.yaml ``` From b003e36804632105d1f003e99fc7a3cca8529592 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 27 Oct 2022 11:56:54 -0400 Subject: [PATCH 02/32] fixing bad replace --- examples/add-timestamp-header/rhai/README.md | 2 +- examples/add-timestamp-header/rhai/src/main.rs | 2 +- examples/async-auth/rust/README.md | 2 +- examples/async-auth/rust/src/main.rs | 2 +- examples/context/rust/README.md | 2 +- examples/context/rust/src/main.rs | 2 +- examples/cookies-to-headers/rhai/README.md | 2 +- examples/cookies-to-headers/rhai/src/main.rs | 2 +- examples/data-response-mutate/rhai/README.md | 2 +- examples/data-response-mutate/rhai/src/main.rs | 2 +- examples/error-response-mutate/rhai/README.md | 2 +- examples/error-response-mutate/rhai/src/main.rs | 2 +- examples/forbid-anonymous-operations/rhai/src/main.rs | 2 +- examples/forbid-anonymous-operations/rust/README.md | 2 +- examples/forbid-anonymous-operations/rust/src/main.rs | 2 +- examples/forbid-mutations/README.md | 2 +- examples/header-manipulation/README.md | 2 +- examples/hello-world/rust/README.md | 2 +- examples/hello-world/rust/src/main.rs | 2 +- examples/jwt-auth/rust/README.md | 2 +- examples/jwt-auth/rust/src/main.rs | 2 +- examples/logging/rhai/README.md | 2 +- examples/logging/rhai/src/main.rs | 2 +- examples/op-name-to-header/rhai/README.md | 2 +- examples/op-name-to-header/rhai/src/main.rs | 2 +- examples/status-code-propagation/rust/README.md | 2 +- examples/status-code-propagation/rust/src/main.rs | 2 +- examples/subgraph-request-log/rhai/README.md | 2 +- examples/subgraph-request-log/rhai/src/main.rs | 2 +- examples/supergraph-sdl/rust/README.md | 2 +- examples/supergraph-sdl/rust/src/main.rs | 2 +- examples/surrogate-cache-key/rhai/README.md | 2 +- examples/surrogate-cache-key/rhai/src/main.rs | 2 +- examples/telemetry/README.md | 4 ++-- examples/unix-sockets/README.md | 2 +- 35 files changed, 36 insertions(+), 36 deletions(-) diff --git a/examples/add-timestamp-header/rhai/README.md b/examples/add-timestamp-header/rhai/README.md index 0562ee228e..980126d1f5 100644 --- a/examples/add-timestamp-header/rhai/README.md +++ b/examples/add-timestamp-header/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates header and context manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/add-timestamp-header/rhai/src/main.rs b/examples/add-timestamp-header/rhai/src/main.rs index f4062fb4be..735070d2a0 100644 --- a/examples/add-timestamp-header/rhai/src/main.rs +++ b/examples/add-timestamp-header/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/async-auth/rust/README.md b/examples/async-auth/rust/README.md index 16fb648cb1..a056476066 100644 --- a/examples/async-auth/rust/README.md +++ b/examples/async-auth/rust/README.md @@ -5,7 +5,7 @@ Demonstrates use of `checkpoint_async` to perform authentication that depends on ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/async-auth/rust/src/main.rs b/examples/async-auth/rust/src/main.rs index c51a24d6e9..98681f4b1b 100644 --- a/examples/async-auth/rust/src/main.rs +++ b/examples/async-auth/rust/src/main.rs @@ -32,7 +32,7 @@ mod allow_client_id_from_file; use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/context/rust/README.md b/examples/context/rust/README.md index 34d81595f4..2692801075 100644 --- a/examples/context/rust/README.md +++ b/examples/context/rust/README.md @@ -5,7 +5,7 @@ Demonstrate use of context to pass information between request lifecycle stages. ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/context/rust/src/main.rs b/examples/context/rust/src/main.rs index dc70d6a74a..77d57ead11 100644 --- a/examples/context/rust/src/main.rs +++ b/examples/context/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod context_data; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/cookies-to-headers/rhai/README.md b/examples/cookies-to-headers/rhai/README.md index a861c069b3..a6a5c72999 100644 --- a/examples/cookies-to-headers/rhai/README.md +++ b/examples/cookies-to-headers/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/cookies-to-headers/rhai/src/main.rs b/examples/cookies-to-headers/rhai/src/main.rs index 546080c90d..84e2a91b75 100644 --- a/examples/cookies-to-headers/rhai/src/main.rs +++ b/examples/cookies-to-headers/rhai/src/main.rs @@ -25,7 +25,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/data-response-mutate/rhai/README.md b/examples/data-response-mutate/rhai/README.md index 5d15a12d53..7195d827fa 100644 --- a/examples/data-response-mutate/rhai/README.md +++ b/examples/data-response-mutate/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/data-response-mutate/rhai/src/main.rs b/examples/data-response-mutate/rhai/src/main.rs index 1772efaa01..5b75920026 100644 --- a/examples/data-response-mutate/rhai/src/main.rs +++ b/examples/data-response-mutate/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/error-response-mutate/rhai/README.md b/examples/error-response-mutate/rhai/README.md index 5d15a12d53..7195d827fa 100644 --- a/examples/error-response-mutate/rhai/README.md +++ b/examples/error-response-mutate/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/error-response-mutate/rhai/src/main.rs b/examples/error-response-mutate/rhai/src/main.rs index e59020b1ae..3e96337ca2 100644 --- a/examples/error-response-mutate/rhai/src/main.rs +++ b/examples/error-response-mutate/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/forbid-anonymous-operations/rhai/src/main.rs b/examples/forbid-anonymous-operations/rhai/src/main.rs index f4b2bdab4d..2c384ea32c 100644 --- a/examples/forbid-anonymous-operations/rhai/src/main.rs +++ b/examples/forbid-anonymous-operations/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/forbid-anonymous-operations/rust/README.md b/examples/forbid-anonymous-operations/rust/README.md index 99141d5632..46bbf57482 100644 --- a/examples/forbid-anonymous-operations/rust/README.md +++ b/examples/forbid-anonymous-operations/rust/README.md @@ -5,7 +5,7 @@ Demonstrates using `checkpoint` to prevent requests with anonymous operations. ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/forbid-anonymous-operations/rust/src/main.rs b/examples/forbid-anonymous-operations/rust/src/main.rs index 898710fd99..3f3fb95eb2 100644 --- a/examples/forbid-anonymous-operations/rust/src/main.rs +++ b/examples/forbid-anonymous-operations/rust/src/main.rs @@ -18,7 +18,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod forbid_anonymous_operations; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/forbid-mutations/README.md b/examples/forbid-mutations/README.md index 6ea3c6fa89..5a30118833 100644 --- a/examples/forbid-mutations/README.md +++ b/examples/forbid-mutations/README.md @@ -7,5 +7,5 @@ This is particularly useful for when you are testing the router against an exist ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/header-manipulation/README.md b/examples/header-manipulation/README.md index 62fe1d6aa4..d8618aa7bb 100644 --- a/examples/header-manipulation/README.md +++ b/examples/header-manipulation/README.md @@ -11,5 +11,5 @@ Possible operations are: ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/hello-world/rust/README.md b/examples/hello-world/rust/README.md index 9dc0b69b87..0ae95d6a8d 100644 --- a/examples/hello-world/rust/README.md +++ b/examples/hello-world/rust/README.md @@ -9,5 +9,5 @@ Configuration that your plugin exposes will automatically participate in `router ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/hello-world/rust/src/main.rs b/examples/hello-world/rust/src/main.rs index f29a1aa827..e972b2b997 100644 --- a/examples/hello-world/rust/src/main.rs +++ b/examples/hello-world/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yml` mod hello_world; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/jwt-auth/rust/README.md b/examples/jwt-auth/rust/README.md index d1c5d6924e..2e1298180e 100644 --- a/examples/jwt-auth/rust/README.md +++ b/examples/jwt-auth/rust/README.md @@ -8,7 +8,7 @@ Demonstrates using `checkpoint` to perform authentication and reject requests th ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/jwt-auth/rust/src/main.rs b/examples/jwt-auth/rust/src/main.rs index 1a236fd4f2..4038bc89d9 100644 --- a/examples/jwt-auth/rust/src/main.rs +++ b/examples/jwt-auth/rust/src/main.rs @@ -19,7 +19,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod jwt; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/logging/rhai/README.md b/examples/logging/rhai/README.md index 5d15a12d53..7195d827fa 100644 --- a/examples/logging/rhai/README.md +++ b/examples/logging/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/logging/rhai/src/main.rs b/examples/logging/rhai/src/main.rs index 57e94d17f0..05906d3fc3 100644 --- a/examples/logging/rhai/src/main.rs +++ b/examples/logging/rhai/src/main.rs @@ -6,7 +6,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/op-name-to-header/rhai/README.md b/examples/op-name-to-header/rhai/README.md index 5d15a12d53..7195d827fa 100644 --- a/examples/op-name-to-header/rhai/README.md +++ b/examples/op-name-to-header/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/op-name-to-header/rhai/src/main.rs b/examples/op-name-to-header/rhai/src/main.rs index 17ec0d1b1c..20997bed7d 100644 --- a/examples/op-name-to-header/rhai/src/main.rs +++ b/examples/op-name-to-header/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/status-code-propagation/rust/README.md b/examples/status-code-propagation/rust/README.md index cc529e3dae..7c4f478cfc 100644 --- a/examples/status-code-propagation/rust/README.md +++ b/examples/status-code-propagation/rust/README.md @@ -6,7 +6,7 @@ For instance, if a subgraph service fails and returns non 200 status code then i ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/status-code-propagation/rust/src/main.rs b/examples/status-code-propagation/rust/src/main.rs index 90c6ed7076..0b0a694bfd 100644 --- a/examples/status-code-propagation/rust/src/main.rs +++ b/examples/status-code-propagation/rust/src/main.rs @@ -6,7 +6,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod propagate_status_code; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/subgraph-request-log/rhai/README.md b/examples/subgraph-request-log/rhai/README.md index 5cf3cf8b66..939cb94fdc 100644 --- a/examples/subgraph-request-log/rhai/README.md +++ b/examples/subgraph-request-log/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates logging subgraph request details via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/subgraph-request-log/rhai/src/main.rs b/examples/subgraph-request-log/rhai/src/main.rs index 79fbbbafff..81f0506b9a 100644 --- a/examples/subgraph-request-log/rhai/src/main.rs +++ b/examples/subgraph-request-log/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/supergraph-sdl/rust/README.md b/examples/supergraph-sdl/rust/README.md index 0f0c7b7392..1d9ce150f4 100644 --- a/examples/supergraph-sdl/rust/README.md +++ b/examples/supergraph-sdl/rust/README.md @@ -5,7 +5,7 @@ Demonstrate use of supergraph sdl (schema definition language) applied in variou ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` ## Implementation diff --git a/examples/supergraph-sdl/rust/src/main.rs b/examples/supergraph-sdl/rust/src/main.rs index be5bf58ae4..2e68d1a3a9 100644 --- a/examples/supergraph-sdl/rust/src/main.rs +++ b/examples/supergraph-sdl/rust/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Result; // you can use the plugin by adding it to `router.yaml` mod supergraph_sdl; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/surrogate-cache-key/rhai/README.md b/examples/surrogate-cache-key/rhai/README.md index 5d15a12d53..7195d827fa 100644 --- a/examples/surrogate-cache-key/rhai/README.md +++ b/examples/surrogate-cache-key/rhai/README.md @@ -5,5 +5,5 @@ Demonstrates extracting body details and header manipulation via Rhai script. Usage: ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml ``` diff --git a/examples/surrogate-cache-key/rhai/src/main.rs b/examples/surrogate-cache-key/rhai/src/main.rs index 92000f0d5f..84a37e9891 100644 --- a/examples/surrogate-cache-key/rhai/src/main.rs +++ b/examples/surrogate-cache-key/rhai/src/main.rs @@ -5,7 +5,7 @@ use anyhow::Result; -// `cargo run -- -s ../../graphqlsupergraph.graphql -c ./router.yaml` +// `cargo run -- -s ../../graphql/supergraph.graphql -c ./router.yaml` fn main() -> Result<()> { apollo_router::main() } diff --git a/examples/telemetry/README.md b/examples/telemetry/README.md index dd0192a062..12d137ae1d 100644 --- a/examples/telemetry/README.md +++ b/examples/telemetry/README.md @@ -10,11 +10,11 @@ Demonstrates configuring of the router for: ## OpenTelemetry ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./jaeger.router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./jaeger.router.yaml ``` ## OpenTelemetry Collector ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./oltp.router.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./oltp.router.yaml ``` diff --git a/examples/unix-sockets/README.md b/examples/unix-sockets/README.md index b9354222f1..f1d2040348 100644 --- a/examples/unix-sockets/README.md +++ b/examples/unix-sockets/README.md @@ -5,5 +5,5 @@ Demonstrates configuring of the router to listen to a unix socket. ## Usage ```bash -cargo run -- -s ../../graphqlsupergraph.graphql -c ./router_unix.yaml +cargo run -- -s ../../graphql/supergraph.graphql -c ./router_unix.yaml ``` From a7c279f8be9a471a1aa43b4fea738fe06c119380 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 27 Oct 2022 12:01:52 -0400 Subject: [PATCH 03/32] adding sample to list --- examples/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/README.md b/examples/README.md index 21b9cc0685..fca48c3e1e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -23,6 +23,7 @@ Scripting support. - [Time request and add to header](./add-timestamp-header/rhai) - [Cookies to headers](./cookies-to-headers/rhai) +- [Forbid anonymous operations](./forbid-anonymous-operations/rhai) - [Operation Name to headers](./op-name-to-header/rhai) - [Logging](./logging/rhai) - [Response data modification](./data-response-mutate/rhai) @@ -40,6 +41,7 @@ Writing your own plugins in rust! - [Jwt auth](./jwt-auth/rust) - [Forbid mutations](./forbid-mutations/rust) - [Status code propagation](./status-code-propagation/rust) +- [Forbid anonymous operations](./forbid-anonymous-operations/rust) ### Advanced usage From 88dbd024a79554733a23c8d7276fc6b8cfe0aa68 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:44:40 -0400 Subject: [PATCH 04/32] Update examples/README.md Co-authored-by: Gary Pennington --- examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/README.md b/examples/README.md index fca48c3e1e..3805b29c12 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,6 @@ # Examples -This directory contains many examples on how to use and extend the Apollo Router. Each folder may contain `rhai` or `rust`, which dictates the kind of plugin it is. For example, [the forbid anonymous operations example](./forbid-anonymous-operations/) has both a Rhai and Rust version available, whereas [the logging example](./logging) is only demonstrated in Rhai. For those without a subfolder, it is intended to be a config-only example, such as the [telemetry samples](./telemetry). +This directory contains many examples on how to use and extend the Apollo Router. Each folder may contain `rhai` and/or `rust`, which dictates the kind of plugin it is. For example, [the forbid anonymous operations example](./forbid-anonymous-operations/) has both a Rhai and Rust version available, whereas [the logging example](./logging) is only demonstrated in Rhai. For those without a subfolder, it is intended to be a config-only example, such as the [telemetry samples](./telemetry). Make sure to look at the docs for: From e19556cdb685e6200fd2d36296d40711832cb362 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:24:43 -0500 Subject: [PATCH 05/32] pulling in new supergraph_sdl cargo.toml --- Cargo.lock | 38 ++++++++++++++++--------- examples/supergraph-sdl/rust/Cargo.toml | 8 +++--- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7ff0f8c13..609d75b5a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,16 +107,17 @@ checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "apollo-compiler" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619d54da02587ebced191b1000e3d8b31060cf7c77c5800c53d33d88faaeff30" +checksum = "8469cb8f7f42ad9b062e70f1148320e6cb7d727d2e87ca46635633ca6b2e6e4d" dependencies = [ - "apollo-parser", + "apollo-parser 0.3.1", "miette 4.7.1", "ordered-float 2.10.0", + "rowan", "salsa", "thiserror", - "uuid 0.8.2", + "uuid 1.2.1", ] [[package]] @@ -134,6 +135,15 @@ dependencies = [ "rowan", ] +[[package]] +name = "apollo-parser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a8f6cc3fa1313e045538ed2ce72ba916d52b501cd81e636a0bd5cdc703a0c73" +dependencies = [ + "rowan", +] + [[package]] name = "apollo-router" version = "1.2.1" @@ -141,7 +151,7 @@ dependencies = [ "access-json", "ansi_term", "anyhow", - "apollo-parser", + "apollo-parser 0.2.12", "askama", "async-compression", "async-trait", @@ -280,7 +290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66fba27e21f40315a0e8abfd2998632b3d1670ae5a16d069c8ff652ea79992d" dependencies = [ "apollo-encoder", - "apollo-parser", + "apollo-parser 0.2.12", "arbitrary", "once_cell", ] @@ -933,6 +943,7 @@ dependencies = [ "lazy_static", "libc", "terminal_size", + "unicode-width", "winapi 0.3.9", ] @@ -1836,8 +1847,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -2268,7 +2281,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" dependencies = [ - "console 0.12.0", + "console 0.15.2", "lazy_static", "number_prefix", "regex", @@ -4016,7 +4029,7 @@ dependencies = [ name = "router-fuzz" version = "0.0.0" dependencies = [ - "apollo-parser", + "apollo-parser 0.2.12", "apollo-smith", "env_logger", "libfuzzer-sys", @@ -4686,12 +4699,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] -name = "supergraph-sdl" +name = "supergraph_sdl" version = "0.1.0" dependencies = [ "anyhow", "apollo-compiler", - "apollo-parser", + "apollo-parser 0.3.1", "apollo-router", "async-trait", "futures", @@ -5557,10 +5570,6 @@ name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde", -] [[package]] name = "uuid" @@ -5570,6 +5579,7 @@ checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom", "serde", + "wasm-bindgen", ] [[package]] diff --git a/examples/supergraph-sdl/rust/Cargo.toml b/examples/supergraph-sdl/rust/Cargo.toml index 5743ed42d8..e81e73ae1a 100644 --- a/examples/supergraph-sdl/rust/Cargo.toml +++ b/examples/supergraph-sdl/rust/Cargo.toml @@ -1,17 +1,17 @@ [package] -name = "supergraph-sdl" +name = "supergraph_sdl" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" -apollo-compiler = "0.1.0" -apollo-parser = "0.2.8" +apollo-compiler = "0.3.0" +apollo-parser = "0.3.0" apollo-router = { path = "../../../apollo-router" } async-trait = "0.1" futures = "0.3" http = "0.2" once_cell = "1.13.0" tower = { version = "0.4", features = ["full"] } -tracing = "0.1" +tracing = "0.1" \ No newline at end of file From 1da9778b9989fb784be68e39ef8de18a72281004 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Thu, 27 Oct 2022 17:10:22 +0100 Subject: [PATCH 06/32] improve the deduplication logic (#2014) Close examination revealed that some judicious tweaking of the locking and spawning would improve the behaviour. In performance testing this performs the same as current (dev) or using the deduplicate crate. I can't reproduce the hanging problem with dev with this set of changes. The rationale for the changes are as follows: - We need to spawn the sentinel **before** we insert the waiter entry or failure after inserting, but before spawning a sentinel, will cause issues. - Notification of waiters from the "first" entry **must be synchronised** under the "wait_map" lock, or else that becomes racy and subscribers may be missed. That notification must be immediately preceded by the removal of the wait_map entry. fixes: #1984 --- NEXT_CHANGELOG.md | 6 ++++++ apollo-router/src/cache/mod.rs | 39 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 9ff18f2bdc..0078045ac7 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -50,6 +50,12 @@ By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router ## 🐛 Fixes +### Fix the deduplication logic in deduplication caching [Issue #1984](https://github.com/apollographql/router/issues/1984)) + +Under load, it is possible to break the router deduplication logic and leave orphaned entries in the waiter map. This fixes the logic to prevent this from occurring. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2014 + ### Follow directives from Uplink ([Issue #1494](https://github.com/apollographql/router/issues/1494) [Issue #1539](https://github.com/apollographql/router/issues/1539)) The Uplink API returns actionable info in its responses: diff --git a/apollo-router/src/cache/mod.rs b/apollo-router/src/cache/mod.rs index 2cf7559b81..e76411cf37 100644 --- a/apollo-router/src/cache/mod.rs +++ b/apollo-router/src/cache/mod.rs @@ -55,6 +55,18 @@ where None => { let (sender, _receiver) = broadcast::channel(1); + let k = key.clone(); + // when _drop_signal is dropped, either by getting out of the block, returning + // the error from ready_oneshot or by cancellation, the drop_sentinel future will + // return with Err(), then we remove the entry from the wait map + let (_drop_signal, drop_sentinel) = oneshot::channel::<()>(); + let wait_map = self.wait_map.clone(); + tokio::task::spawn(async move { + let _ = drop_sentinel.await; + let mut locked_wait_map = wait_map.lock().await; + let _ = locked_wait_map.remove(&k); + }); + locked_wait_map.insert(key.clone(), sender.clone()); // we must not hold a lock over the wait map while we are waiting for a value from the @@ -63,27 +75,13 @@ where drop(locked_wait_map); if let Some(value) = self.storage.get(key).await { - let mut locked_wait_map = self.wait_map.lock().await; - let _ = locked_wait_map.remove(key); - let _ = sender.send(value.clone()); + self.send(sender, key, value.clone()).await; return Entry { inner: EntryInner::Value(value), }; } - let k = key.clone(); - // when _drop_signal is dropped, either by getting out of the block, returning - // the error from ready_oneshot or by cancellation, the drop_sentinel future will - // return with Err(), then we remove the entry from the wait map - let (_drop_signal, drop_sentinel) = oneshot::channel::<()>(); - let wait_map = self.wait_map.clone(); - tokio::task::spawn(async move { - let _ = drop_sentinel.await; - let mut locked_wait_map = wait_map.lock().await; - let _ = locked_wait_map.remove(&k); - }); - Entry { inner: EntryInner::First { sender, @@ -100,9 +98,12 @@ where self.storage.insert(key, value.clone()).await; } - pub(crate) async fn remove_wait(&self, key: &K) { + async fn send(&self, sender: broadcast::Sender, key: &K, value: V) { + // Lock the wait map to prevent more subscribers racing with our send + // notification let mut locked_wait_map = self.wait_map.lock().await; let _ = locked_wait_map.remove(key); + let _ = sender.send(value); } } @@ -157,8 +158,7 @@ where } = self.inner { cache.insert(key.clone(), value.clone()).await; - cache.remove_wait(&key).await; - let _ = sender.send(value); + cache.send(sender, &key, value).await; } } @@ -169,8 +169,7 @@ where sender, cache, key, .. } = self.inner { - let _ = sender.send(value); - cache.remove_wait(&key).await; + cache.send(sender, &key, value).await; } } } From 25cc762277dd8723d8daae69a8d30ab718c1ca19 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:28:05 +0000 Subject: [PATCH 07/32] fix(deps): update rust crate miette to 5.4.1 --- Cargo.lock | 12 ++++++------ apollo-router/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 609d75b5a1..5921c80f75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -192,7 +192,7 @@ dependencies = [ "maplit", "mediatype", "memchr", - "miette 5.3.0", + "miette 5.4.1", "mime", "mockall", "multimap", @@ -2720,13 +2720,13 @@ dependencies = [ [[package]] name = "miette" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" +checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" dependencies = [ "atty", "backtrace", - "miette-derive 5.3.0", + "miette-derive 5.4.1", "once_cell", "owo-colors", "supports-color", @@ -2751,9 +2751,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" +checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" dependencies = [ "proc-macro2", "quote", diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index c0f6168c14..75fc0d91f1 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -84,7 +84,7 @@ libc = "0.2.134" lru = "0.7.8" mediatype = "0.19.9" mockall = "0.11.2" -miette = { version = "5.3.0", features = ["fancy"] } +miette = { version = "5.4.1", features = ["fancy"] } mime = "0.3.16" multimap = "0.8.3" # To avoid tokio issues From 5c72335d382636f5e958a1ec2ef4573ec34607ac Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 31 Oct 2022 11:12:45 +0000 Subject: [PATCH 08/32] fix logic in argument processing for diy docker build script (#2032) The last change introduced a bug which meant you can't use the script to build a docker image from released code. This fixes it. --- dockerfiles/diy/build_docker_image.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dockerfiles/diy/build_docker_image.sh b/dockerfiles/diy/build_docker_image.sh index ae8e8e994a..60389a6b38 100755 --- a/dockerfiles/diy/build_docker_image.sh +++ b/dockerfiles/diy/build_docker_image.sh @@ -1,7 +1,7 @@ #! /bin/sh ### -# Build docker images from git commit hash or tag or from released tarballs. +# Build docker images from git commit hash or tag or from released version. # # See the usage message for more help # docker_build_image.sh -h @@ -22,7 +22,7 @@ ### usage () { printf "Usage: build_docker_image.sh [-b [-r ]] []\n" - printf "\t-b build docker image from the default repo, if not present build from a released tarball\n" + printf "\t-b build docker image from the default repo, if not present build from a released version\n" printf "\t-r build docker image from a specified repo, only valid with -b flag\n" printf "\t a valid release. If [-b] is specified, this is optional\n" printf "\tExample 1: Building HEAD from the repo\n" @@ -33,7 +33,7 @@ usage () { printf "\t\tbuild_docker_image.sh -b v0.9.1\n" printf "\tExample 4: Building commit hash from the repo\n" printf "\t\tbuild_docker_image.sh -b 7f7d223f42af34fad35b898d976bc07d0f5440c5\n" - printf "\tExample 5: Building tag v0.9.1 from the released tarball\n" + printf "\tExample 5: Building tag v0.9.1 from the released version\n" printf "\t\tbuild_docker_image.sh v0.9.1\n" exit 2 } @@ -57,6 +57,7 @@ terminate () { ROUTER_VERSION= BUILD_IMAGE=false DEFAULT_REPO="https://github.com/apollographql/router.git" +GIT_REPO= ### # Process Command Line @@ -98,7 +99,7 @@ fi # If we aren't building, we need a ROUTER_VERSION if [ $# -gt 0 ]; then - if [ "${BUILD_IMAGE}" = false ] && [ "${GIT_REPO}" != "${DEFAULT_REPO}" ]; then + if [ "${BUILD_IMAGE}" = false ] && [ -n "${GIT_REPO}" ]; then usage fi ROUTER_VERSION="${1}" @@ -145,7 +146,7 @@ if [ "${BUILD_IMAGE}" = true ]; then || terminate "Couldn't build router image" else # Let the user know what we are going to do - echo "Building image: ${ROUTER_VERSION}" from released tarballs"" + echo "Building image: ${ROUTER_VERSION}" from released version"" docker build -q -t "router:${ROUTER_VERSION}" \ --build-arg ROUTER_RELEASE="${ROUTER_VERSION}" \ --no-cache -f Dockerfile.release . \ From 2539c8fd33919dfd323747634bcafc12bbfa2fdc Mon Sep 17 00:00:00 2001 From: Dariusz Kuc <9501705+dariuszkuc@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:53:59 -0500 Subject: [PATCH 09/32] fixing router healthcheck formatting adding missing escape chars to the code block --- docs/source/configuration/health-checks.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/configuration/health-checks.mdx b/docs/source/configuration/health-checks.mdx index f688f7d4e5..e0d6863b3b 100644 --- a/docs/source/configuration/health-checks.mdx +++ b/docs/source/configuration/health-checks.mdx @@ -35,6 +35,7 @@ $ curl -v "http://127.0.0.1:8088/health" < * Connection #0 to host 127.0.0.1 left intact {"status":"UP"} +``` ## Using with Kubernetes In Kubernetes, you can configure health checks by setting `readinessProbe` and `livenessProbe` on the `containers` object of the resource definition: From cd19ce79c3f3b73be9b8f8ba0fd52bfd7eaaa5e5 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Tue, 1 Nov 2022 10:56:49 +0000 Subject: [PATCH 10/32] allow router installer to install aarch64 binaries (#2033) In the past, we didn't have aarch64 binaries. We hacked our install script so that we downloaded x86_64 binaries and relied on magic (aka chip emulation) to run the binary. We build aarch64 binaries now, so we need to update the installer to install them and give a performance boost to our linux on aarch64 user base. I manually tested the change by running a debian docker image on my M1 laptop and using the modified script to install a router into it. --- scripts/install.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 5353b2973e..680b4b647d 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -105,15 +105,6 @@ get_architecture() { fi - # If we are building a linux container on an M1 chip, let's - # download a86_64 binaries and assume the docker image is - # for amd64. We do this because we don't have router binaries - # for aarch64 for any OS right now. If this changes in the - # future, we'll need to re-visit this hack. - if [ "$_ostype" = "Linux" ] && [ "$_cputype" = "aarch64" ]; then - _cputype="x86_64" - fi - case "$_ostype" in Linux) _ostype=unknown-linux-gnu @@ -133,7 +124,7 @@ get_architecture() { esac case "$_cputype" in - x86_64 | x86-64 | x64 | amd64) + x86_64 | x86-64 | x64 | amd64 | aarch64) ;; *) err "no precompiled binaries available for CPU architecture: $_cputype" From fa07b85b0985db9c411b0525996a6a5681739ec2 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Tue, 1 Nov 2022 10:58:38 +0000 Subject: [PATCH 11/32] add dhat features to help resolving memory issues (#1829) Add support for DHAT heap profiling via dhat features: `dhat-heap` and `dhat-ad-hoc`. This isn't intended for "general" consumption, but for router developers who are trying to understand and resolve potential memory issues. Co-authored-by: Simon Sapin Co-authored-by: Jesse Rosenberger --- Cargo.lock | 33 +++++++++++++++++ Cargo.toml | 7 ++++ DEVELOPMENT.md | 25 ++++++++++++- NEXT_CHANGELOG.md | 6 ++++ apollo-router/Cargo.toml | 4 +++ apollo-router/src/executable.rs | 63 +++++++++++++++++++++++++++++++++ licenses.html | 2 ++ 7 files changed, 139 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 5921c80f75..b1ca3c2f64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,6 +168,7 @@ dependencies = [ "deadpool", "derivative", "derive_more", + "dhat", "directories", "displaydoc", "flate2", @@ -1388,6 +1389,22 @@ dependencies = [ "syn", ] +[[package]] +name = "dhat" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2aaf837aaf456f6706cb46386ba8dffd4013a757e36f4ea05c20dd46b209a3" +dependencies = [ + "backtrace", + "lazy_static", + "mintex", + "parking_lot 0.12.0", + "rustc-hash", + "serde", + "serde_json", + "thousands", +] + [[package]] name = "dialoguer" version = "0.6.2" @@ -2791,6 +2808,16 @@ dependencies = [ "adler", ] +[[package]] +name = "mintex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7c5ba1c3b5a23418d7bbf98c71c3d4946a0125002129231da8d6b723d559cb" +dependencies = [ + "once_cell", + "sys-info", +] + [[package]] name = "mio" version = "0.8.4" @@ -4935,6 +4962,12 @@ dependencies = [ "syn", ] +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + [[package]] name = "thread_local" version = "1.1.4" diff --git a/Cargo.toml b/Cargo.toml index 0a774aab2d..af9d6fb0ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,10 @@ members = [ # debug = false strip = "debuginfo" incremental = false + +# If building a dhat feature, you must use this profile +# e.g. heap allocation tracing: cargo build --profile release-dhat --features dhat-heap +# e.g. heap and ad-hoc allocation tracing: cargo build --profile release-dhat --features dhat-heap,dhat-ad-hoc +[profile.release-dhat] +inherits = "release" +debug = 1 diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 922a6782d4..6562683868 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -57,7 +57,6 @@ docker-compose up -d have issues and you want to see the logs or if you want to run the service in foreground. - ### Run Apollo Router against the docker-compose or Node.js setup Once the subgraphs are up and running, run Apollo Router with this command: @@ -86,6 +85,30 @@ The CI checks require `cargo-deny` and `cargo-about` which can both be installed They also need you to have the federation-demo project up and running, as explained in the Getting started section above. +### Investigating memory usage + +There are two features: `dhat-heap` and `dhat-ad-hoc` which may be enabled for investigating memory issues +with the router. You may enable either or both, depending on the kind of problem you are investigating. + +You have to build the router with your choice of feature flags and you must use the `release-dhat` profile. + +e.g.: heap and ad-hoc allocation tracing +```shell +# e.g. heap and ad-hoc allocation tracing: cargo build --profile release-dhat --features dhat-heap,dhat-ad-hoc +``` + +e.g.: heap allocation tracing +```shell +cargo build --profile release-dhat --features dhat-heap +``` + +This will create a router in `./target/release-dhat`. + +When you run your binary, on termination you will get `dhat-heap.json` and/or `dhat-ad-hoc.json` files which can +be examined using standard DHAT tooling. + +For more details on interpreting these files and running tests, see the [dhat-rs](https://docs.rs/dhat/latest/dhat/#running) crate documentation. + ### Troubleshoot + If you have an issue with rust-analyzer reporting an unresolved import about `derivative::Derivative` [check this solution](https://github.com/rust-analyzer/rust-analyzer/issues/7459#issuecomment-876796459) found in a rust-analyzer issue. diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 0078045ac7..ab206de188 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -28,6 +28,12 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/ ## ❗ BREAKING ❗ ## 🚀 Features +### Add support for dhat based heap profiling [PR #XXXX](https://github.com/apollographql/router/pull/XXXX)) + +[dhat-rs](https://github.com/nnethercote/dhat-rs) provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html) style heap profiling. We have added two compile features, dhat-heap and dhat-ad-hoc, which leverage this ability. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/XXXX + ### Add `trace_id` in logs to identify all logs related to a specific request [Issue #1981](https://github.com/apollographql/router/issues/1981)) It automatically adds a `trace_id` on logs to identify which log is related to a specific request. Also adds `apollo_trace_id` in response headers to help the client to identify logs for this request. diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 75fc0d91f1..25c71d7efa 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -17,6 +17,9 @@ name = "router" path = "src/main.rs" [features] +# if you are doing heap profiling +dhat-heap = ["dhat"] +dhat-ad-hoc = ["dhat"] # Prevents the query execution to continue if any error occurs while fetching # the data of a subgraph. This is useful in development as you want to be # alerted early when something is wrong instead of receiving an invalid result. @@ -64,6 +67,7 @@ derive_more = { version = "0.99.17", default-features = false, features = [ "from", "display", ] } +dhat = { version = "0.3.2", optional = true } directories = "4.0.1" displaydoc = "0.2" flate2 = "1.0.24" diff --git a/apollo-router/src/executable.rs b/apollo-router/src/executable.rs index 37ded3959d..cef3b3bf61 100644 --- a/apollo-router/src/executable.rs +++ b/apollo-router/src/executable.rs @@ -31,9 +31,72 @@ use crate::router::RouterHttpServer; use crate::router::SchemaSource; use crate::router::ShutdownSource; +// Note: the dhat-heap and dhat-ad-hoc features should not be both enabled. We name our functions +// and variables identically to prevent this from happening. + +#[cfg(feature = "dhat-heap")] +#[global_allocator] +pub(crate) static ALLOC: dhat::Alloc = dhat::Alloc; + +#[cfg(feature = "dhat-heap")] +pub(crate) static mut DHAT_HEAP_PROFILER: OnceCell = OnceCell::new(); + +#[cfg(feature = "dhat-ad-hoc")] +pub(crate) static mut DHAT_AD_HOC_PROFILER: OnceCell = OnceCell::new(); + pub(crate) static GLOBAL_ENV_FILTER: OnceCell = OnceCell::new(); pub(crate) const APOLLO_ROUTER_DEV_ENV: &str = "APOLLO_ROUTER_DEV"; +// Note: Constructor/Destructor functions may not play nicely with tracing, since they run after +// main completes, so don't use tracing, use println!() and eprintln!().. +#[cfg(feature = "dhat-heap")] +#[crate::_private::ctor::ctor] +fn create_heap_profiler() { + unsafe { + match DHAT_HEAP_PROFILER.set(dhat::Profiler::new_heap()) { + Ok(p) => { + println!("heap profiler installed: {:?}", p); + libc::atexit(drop_heap_profiler); + } + Err(e) => eprintln!("heap profiler install failed: {:?}", e), + } + } +} + +#[cfg(feature = "dhat-heap")] +#[no_mangle] +extern "C" fn drop_heap_profiler() { + unsafe { + if let Some(p) = DHAT_HEAP_PROFILER.take() { + drop(p); + } + } +} + +#[cfg(feature = "dhat-ad-hoc")] +#[crate::_private::ctor::ctor] +fn create_ad_hoc_profiler() { + unsafe { + match DHAT_AD_HOC_PROFILER.set(dhat::Profiler::new_ad_hoc()) { + Ok(p) => { + println!("ad-hoc profiler installed: {:?}", p); + libc::atexit(drop_ad_hoc_profiler); + } + Err(e) => eprintln!("ad-hoc profiler install failed: {:?}", e), + } + } +} + +#[cfg(feature = "dhat-ad-hoc")] +#[no_mangle] +extern "C" fn drop_ad_hoc_profiler() { + unsafe { + if let Some(p) = DHAT_AD_HOC_PROFILER.take() { + drop(p); + } + } +} + /// Options for the router #[derive(Parser, Debug)] #[clap( diff --git a/licenses.html b/licenses.html index c6c8d53dd0..a77f255df5 100644 --- a/licenses.html +++ b/licenses.html @@ -3350,6 +3350,7 @@

Used by:

Apache License 2.0

Used by:

@@ -6191,6 +6192,7 @@

Used by:

  • text-size
  • thiserror
  • thiserror-impl
  • +
  • thousands
  • thread_local
  • threadpool
  • toml
  • From 89826a8cf781cf598f9f50be2b6e5b8d6d9c27bc Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Tue, 1 Nov 2022 14:20:45 +0000 Subject: [PATCH 12/32] reduce CI bill and improve build speed (#2037) The long pole on our build is the arm build/test step. Also, running everything in parallel is expensive. Let's address both of those problems: - require lint to succeed before starting build/test jobs - give more resources to arm jobs to allow them to complete faster - tweak the build setting for both arm and amd to use resources more effectively Result: - total build time is reduced by ~15% in my test runs (even with waiting for lint first) - billing should be reduced by less renovate waste-fullness when lint fails --- .circleci/config.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9961ee04ee..dd64a73ed6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,11 +17,11 @@ executors: arm_linux_build: &arm_linux_build_executor machine: image: ubuntu-2004:2022.04.1 - resource_class: arm.medium + resource_class: arm.large arm_linux_test: &arm_linux_test_executor machine: image: ubuntu-2004:2022.04.1 - resource_class: arm.large + resource_class: arm.xlarge macos_build: &macos_build_executor macos: # See https://circleci.com/docs/xcode-policy along with the support matrix @@ -248,11 +248,14 @@ commands: # As of rustc 1.61.0, must limit the number of linux jobs or we run out of memory (large executor/8GB) - when: condition: - or: - - equal: [linux_amd, << parameters.os >>] - - equal: [linux_arm, << parameters.os >>] + equal: [linux_amd, << parameters.os >>] + steps: + - run: cargo test --jobs 4 --workspace --locked << parameters.cargo_test_args >> --test-threads=6 + - when: + condition: + equal: [linux_arm, << parameters.os >>] steps: - - run: cargo test --jobs 4 --workspace --locked << parameters.cargo_test_args >> --test-threads=4 + - run: cargo test --jobs 8 --workspace --locked << parameters.cargo_test_args >> --test-threads=8 - when: condition: equal: [macos, << parameters.os >>] @@ -525,8 +528,12 @@ workflows: # parameters: # platform: [linux] - - test_updated + - test_updated: + requires: + - lint - test: + requires: + - lint matrix: parameters: platform: From 6da850e2b9faf37d80d85005a5a277de50560c6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:31:35 +0000 Subject: [PATCH 13/32] fix(deps): update all non-major packages >= 1.0 --- Cargo.lock | 4 ++-- apollo-router/Cargo.toml | 4 ++-- dockerfiles/fed2-demo-gateway/package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1ca3c2f64..14d1015c70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3054,9 +3054,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "oorandom" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 25c71d7efa..9e4878360b 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -93,7 +93,7 @@ mime = "0.3.16" multimap = "0.8.3" # To avoid tokio issues notify = { version = "5.0.0", default-features = false, features=["macos_kqueue"] } -once_cell = "1.15.0" +once_cell = "1.16.0" # Any package that starts with `opentelemetry` needs to be updated with care # because it is tightly intertwined with the `tracing` packages on account of @@ -209,7 +209,7 @@ jsonpath_lib = "0.3.0" maplit = "1.0.2" memchr = { version = "2.5.0", default-features = false } mockall = "0.11.2" -once_cell = "1.15.0" +once_cell = "1.16.0" reqwest = { version = "0.11.12", default-features = false, features = [ "json", "stream", diff --git a/dockerfiles/fed2-demo-gateway/package.json b/dockerfiles/fed2-demo-gateway/package.json index 30ab2e5a2a..251379a6a3 100644 --- a/dockerfiles/fed2-demo-gateway/package.json +++ b/dockerfiles/fed2-demo-gateway/package.json @@ -7,7 +7,7 @@ "start": "node gateway.js" }, "dependencies": { - "@apollo/server": "4.0.4", + "@apollo/server": "4.0.5", "@apollo/gateway": "2.1.4", "supergraph-demo-opentelemetry": "0.2.4", "graphql": "16.6.0" From e2a6542dc86474c814aebbbb506cf8eedf3cc1d3 Mon Sep 17 00:00:00 2001 From: scottdouglas1989 Date: Wed, 2 Nov 2022 09:54:28 +0000 Subject: [PATCH 14/32] Exports `Endpoint` struct (#2009) Allows router plugins to utilize `web_endpoints` by making the `Endpoint` struct public --- NEXT_CHANGELOG.md | 4 ++++ apollo-router/src/lib.rs | 1 + apollo-router/src/router_factory.rs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index ab206de188..c483b5b6be 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -76,6 +76,10 @@ A recent change to the way we provide the SDL to plugins broke the rhai SDL prin By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/apollographql/router/pull/2007 +### Exports a missing strut (`router_factory::Endpoint`) that was preventing the `web_endpoints` trait from being implemented by Plugins + +By [@scottdouglas1989](https://github.com/scottdouglas1989) in https://github.com/apollographql/router/pull/2007 + ## 🛠 Maintenance ### Split the configuration file management in multiple modules [Issue #1790](https://github.com/apollographql/router/issues/1790)) diff --git a/apollo-router/src/lib.rs b/apollo-router/src/lib.rs index 3e6324c31a..c13e088331 100644 --- a/apollo-router/src/lib.rs +++ b/apollo-router/src/lib.rs @@ -83,6 +83,7 @@ pub use crate::router::ConfigurationSource; pub use crate::router::RouterHttpServer; pub use crate::router::SchemaSource; pub use crate::router::ShutdownSource; +pub use crate::router_factory::Endpoint; pub use crate::test_harness::MockedSubgraphs; pub use crate::test_harness::TestHarness; diff --git a/apollo-router/src/router_factory.rs b/apollo-router/src/router_factory.rs index a82e79e590..9c9147a41b 100644 --- a/apollo-router/src/router_factory.rs +++ b/apollo-router/src/router_factory.rs @@ -30,6 +30,7 @@ use crate::PluggableSupergraphServiceBuilder; use crate::Schema; #[derive(Clone)] +/// A path and a handler to be exposed as a web_endpoint for plugins pub struct Endpoint { pub(crate) path: String, // Plugins need to be Send + Sync @@ -46,6 +47,7 @@ impl std::fmt::Debug for Endpoint { } impl Endpoint { + /// Creates an Endpoint given a path and a Boxed Service pub fn new(path: String, handler: transport::BoxService) -> Self { Self { path, From bc144acfd4507cccbc5e3219bd76bf1486420d47 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Wed, 2 Nov 2022 14:12:59 +0100 Subject: [PATCH 15/32] validate default values for input object fields (#2003) Fix #1979 When validating variables, we should use default values for object fields if applicable --- NEXT_CHANGELOG.md | 6 ++++++ apollo-router/src/spec/query.rs | 2 +- apollo-router/src/spec/query/tests.rs | 26 ++++++++++++++++++++++++++ apollo-router/src/spec/schema.rs | 15 ++++++++++----- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index c483b5b6be..23c5aaa945 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -80,6 +80,12 @@ By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/ By [@scottdouglas1989](https://github.com/scottdouglas1989) in https://github.com/apollographql/router/pull/2007 +### Validate default values for input object fields ([Issue #1979](https://github.com/apollographql/router/issues/1979)) + +When validating variables, we should use default values for object fields if applicable. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2003 + ## 🛠 Maintenance ### Split the configuration file management in multiple modules [Issue #1790](https://github.com/apollographql/router/issues/1790)) diff --git a/apollo-router/src/spec/query.rs b/apollo-router/src/spec/query.rs index db570ca3be..1144b6f3d2 100644 --- a/apollo-router/src/spec/query.rs +++ b/apollo-router/src/spec/query.rs @@ -995,7 +995,7 @@ fn parse_default_value(definition: &ast::VariableDefinition) -> Option { .and_then(|value| parse_value(&value)) } -fn parse_value(value: &ast::Value) -> Option { +pub(crate) fn parse_value(value: &ast::Value) -> Option { match value { ast::Value::Variable(_) => None, ast::Value::StringValue(s) => Some(s.to_string().into()), diff --git a/apollo-router/src/spec/query/tests.rs b/apollo-router/src/spec/query/tests.rs index d21f58ffbe..594194b405 100644 --- a/apollo-router/src/spec/query/tests.rs +++ b/apollo-router/src/spec/query/tests.rs @@ -1235,6 +1235,32 @@ fn variable_validation() { "author": "Me" }}) ); + + assert_validation!( + "type Mutation{ + foo(input: FooInput!): FooResponse! + } + type Query{ + data: String + } + + input FooInput { + enumWithDefault: EnumWithDefault! = WEB + } + type FooResponse { + id: ID! + } + + enum EnumWithDefault { + WEB + MOBILE + }", + "mutation foo($input: FooInput!) { + foo (input: $input) { + __typename + }}", + json!({"input":{}}) + ); } #[test] diff --git a/apollo-router/src/spec/schema.rs b/apollo-router/src/spec/schema.rs index 54ec7f0bc1..d2553f62c0 100644 --- a/apollo-router/src/spec/schema.rs +++ b/apollo-router/src/spec/schema.rs @@ -17,6 +17,7 @@ use crate::error::SchemaError; use crate::json_ext::Object; use crate::json_ext::Value; use crate::query_planner::OperationKind; +use crate::spec::query::parse_value; use crate::*; /// A GraphQL schema. @@ -616,7 +617,7 @@ macro_rules! implement_input_object_type_or_interface { #[derive(Debug, Clone)] $visibility struct $name { name: String, - fields: HashMap, + fields: HashMap)>, } impl $name { @@ -625,11 +626,14 @@ macro_rules! implement_input_object_type_or_interface { object: &Object, schema: &Schema, ) -> Result<(), InvalidObject> { - self + self .fields .iter() - .try_for_each(|(name, ty)| { - let value = object.get(name.as_str()).unwrap_or(&Value::Null); + .try_for_each(|(name, (ty, default_value))| { + let value = match object.get(name.as_str()) { + Some(&Value::Null) | None => default_value.as_ref().unwrap_or(&Value::Null), + Some(value) => value, + }; ty.validate_input_value(value, schema) }) .map_err(|_| InvalidObject) @@ -672,7 +676,8 @@ macro_rules! implement_input_object_type_or_interface { ) })? .try_into()?; - Ok((name, ty)) + let default = x.default_value().and_then(|v| v.value()).as_ref().and_then(parse_value); + Ok((name, (ty, default))) }) .collect::>()?; From 6eb1306037ddc15ab919b3885ee1d26fcd15e57c Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Wed, 2 Nov 2022 14:41:14 +0100 Subject: [PATCH 16/32] reload the configuration when receiving the SIGHUP signal (#2015) Fix #35 This adds support for reloading configuration when receiving the SIGHUP signal. This only works on unix-like platforms, and only with the configuration file Co-authored-by: Gary Pennington --- NEXT_CHANGELOG.md | 7 ++++++ apollo-router/src/router.rs | 47 +++++++++++++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 23c5aaa945..17da7bb187 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -54,6 +54,13 @@ Example of logs in JSON: By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1982 +### Reload the configuration when receiving the SIGHUP signal [Issue #35](https://github.com/apollographql/router/issues/35)) + +This adds support for reloading configuration when receiving the SIGHUP signal. This only works on unix-like platforms, +and only with the configuration file. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2015 + ## 🐛 Fixes ### Fix the deduplication logic in deduplication caching [Issue #1984](https://github.com/apollographql/router/issues/1984)) diff --git a/apollo-router/src/router.rs b/apollo-router/src/router.rs index db6ff01c0c..b671274241 100644 --- a/apollo-router/src/router.rs +++ b/apollo-router/src/router.rs @@ -318,10 +318,49 @@ impl ConfigurationSource { .boxed() } else { match ConfigurationSource::read_config(&path) { - Ok(configuration) => stream::once(future::ready(UpdateConfiguration( - Box::new(configuration), - ))) - .boxed(), + Ok(configuration) => { + #[cfg(any(test, not(unix)))] + { + stream::once(future::ready(UpdateConfiguration(Box::new( + configuration, + )))) + .boxed() + } + + #[cfg(all(not(test), unix))] + { + let mut sighup_stream = tokio::signal::unix::signal( + tokio::signal::unix::SignalKind::hangup(), + ) + .expect("Failed to install SIGHUP signal handler"); + + let (mut tx, rx) = futures::channel::mpsc::channel(1); + tokio::task::spawn(async move { + while let Some(()) = sighup_stream.recv().await { + tx.send(()).await.unwrap(); + } + }); + futures::stream::select( + stream::once(future::ready(UpdateConfiguration(Box::new( + configuration, + )))) + .boxed(), + rx.filter_map( + move |()| match ConfigurationSource::read_config(&path) { + Ok(configuration) => future::ready(Some( + UpdateConfiguration(Box::new(configuration)), + )), + Err(err) => { + tracing::error!("{}", err); + future::ready(None) + } + }, + ) + .boxed(), + ) + .boxed() + } + } Err(err) => { tracing::error!("{}", err); stream::empty().boxed() From f20665dcd41f77a296b0b0aa230487784ce331d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Nov 2022 15:04:23 +0100 Subject: [PATCH 17/32] chore(deps): update openzipkin/zipkin docker tag to v2.23.19 (#1969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | openzipkin/zipkin | patch | `2.23.18` -> `2.23.19` | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/apollographql/router). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Geoffroy Couprie --- dockerfiles/tracing/docker-compose.zipkin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/tracing/docker-compose.zipkin.yml b/dockerfiles/tracing/docker-compose.zipkin.yml index 1c27eecc00..5a77e29bb7 100644 --- a/dockerfiles/tracing/docker-compose.zipkin.yml +++ b/dockerfiles/tracing/docker-compose.zipkin.yml @@ -36,6 +36,6 @@ services: zipkin: container_name: zipkin - image: openzipkin/zipkin:2.23.18 + image: openzipkin/zipkin:2.23.19 ports: - 9411:9411 From 67835513e3cd6ccd0743d730cae5a1bc28432760 Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Wed, 2 Nov 2022 16:43:44 +0000 Subject: [PATCH 18/32] apply tower best practices to services when cloning inner services (#2030) When I was investigating connection resets I noted that we weren't following tower documentation with respect to [cloning inner services](https://docs.rs/tower/latest/tower/trait.Service.html#be-careful-when-cloning-inner-services). This PR addresses that. The change to the supergraph seems to be most invasive. I have run the tests manually many times and the change seems good, but probably worth closer examination. --- NEXT_CHANGELOG.md | 10 ++++++++-- apollo-router/src/services/execution_service.rs | 5 ++++- apollo-router/src/services/subgraph_service.rs | 4 +++- apollo-router/src/services/supergraph_service.rs | 13 ++++--------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 17da7bb187..5341c6f46f 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -28,11 +28,11 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/ ## ❗ BREAKING ❗ ## 🚀 Features -### Add support for dhat based heap profiling [PR #XXXX](https://github.com/apollographql/router/pull/XXXX)) +### Add support for dhat based heap profiling [PR #1829](https://github.com/apollographql/router/pull/1829)) [dhat-rs](https://github.com/nnethercote/dhat-rs) provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html) style heap profiling. We have added two compile features, dhat-heap and dhat-ad-hoc, which leverage this ability. -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/XXXX +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/1829 ### Add `trace_id` in logs to identify all logs related to a specific request [Issue #1981](https://github.com/apollographql/router/issues/1981)) @@ -95,6 +95,12 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🛠 Maintenance +### Apply tower best practice to inner service cloning [PR #2030](https://github.com/apollographql/router/pull/2030)) + +Our service readiness checking can be improved by following tower project recommendations for cloning inner services. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2030 + ### Split the configuration file management in multiple modules [Issue #1790](https://github.com/apollographql/router/issues/1790)) The file is becoming large and hard to modify. diff --git a/apollo-router/src/services/execution_service.rs b/apollo-router/src/services/execution_service.rs index 3460c27bc4..3b3fa67ede 100644 --- a/apollo-router/src/services/execution_service.rs +++ b/apollo-router/src/services/execution_service.rs @@ -56,7 +56,10 @@ where } fn call(&mut self, req: ExecutionRequest) -> Self::Future { - let this = self.clone(); + let clone = self.clone(); + + let this = std::mem::replace(self, clone); + let fut = async move { let context = req.context; let ctx = context.clone(); diff --git a/apollo-router/src/services/subgraph_service.rs b/apollo-router/src/services/subgraph_service.rs index 47403313d8..81fcc32651 100644 --- a/apollo-router/src/services/subgraph_service.rs +++ b/apollo-router/src/services/subgraph_service.rs @@ -108,7 +108,9 @@ impl tower::Service for SubgraphService { .. } = request; - let mut client = self.client.clone(); + let clone = self.client.clone(); + + let mut client = std::mem::replace(&mut self.client, clone); let service_name = (*self.service).to_owned(); Box::pin(async move { diff --git a/apollo-router/src/services/supergraph_service.rs b/apollo-router/src/services/supergraph_service.rs index 450943c5cf..3aa1dd0386 100644 --- a/apollo-router/src/services/supergraph_service.rs +++ b/apollo-router/src/services/supergraph_service.rs @@ -57,7 +57,6 @@ pub(crate) type Plugins = IndexMap>; pub(crate) struct SupergraphService { execution_service_factory: ExecutionFactory, query_planner_service: CachingQueryPlanner, - ready_query_planner_service: Option>, schema: Arc, } @@ -72,7 +71,6 @@ impl SupergraphService { SupergraphService { query_planner_service, execution_service_factory, - ready_query_planner_service: None, schema, } } @@ -87,19 +85,16 @@ where type Future = BoxFuture<'static, Result>; fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) -> Poll> { - // We need to obtain references to two hot services for use in call. - // The reason for us to clone here is that the async block needs to own the hot services, - // and cloning will produce a cold service. Therefore cloning in `SupergraphService#call` is not - // a valid course of action. - self.ready_query_planner_service - .get_or_insert_with(|| self.query_planner_service.clone()) + self.query_planner_service .poll_ready(cx) .map_err(|err| err.into()) } fn call(&mut self, req: SupergraphRequest) -> Self::Future { // Consume our cloned services and allow ownership to be transferred to the async block. - let planning = self.ready_query_planner_service.take().unwrap(); + let clone = self.query_planner_service.clone(); + + let planning = std::mem::replace(&mut self.query_planner_service, clone); let execution = self.execution_service_factory.new_service(); let schema = self.schema.clone(); From bf5184ea970124c4ebd6192b56bb7653e71e7056 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Nov 2022 19:50:31 +0000 Subject: [PATCH 19/32] fix(deps): update dependency @apollo/server to v4.1.0 [security] --- dockerfiles/fed2-demo-gateway/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/fed2-demo-gateway/package.json b/dockerfiles/fed2-demo-gateway/package.json index 251379a6a3..40ad440a99 100644 --- a/dockerfiles/fed2-demo-gateway/package.json +++ b/dockerfiles/fed2-demo-gateway/package.json @@ -7,7 +7,7 @@ "start": "node gateway.js" }, "dependencies": { - "@apollo/server": "4.0.5", + "@apollo/server": "4.1.0", "@apollo/gateway": "2.1.4", "supergraph-demo-opentelemetry": "0.2.4", "graphql": "16.6.0" From fae1ef044115bb06dfb08b21de669aab2189a87c Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Thu, 3 Nov 2022 17:40:01 +0000 Subject: [PATCH 20/32] remove references to git submodules from DEVELOPMENT.md (#2045) also: fix bracketing in NEXT_CHANGELOG.md fixes: #2012 --- DEVELOPMENT.md | 9 +-------- NEXT_CHANGELOG.md | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 6562683868..66b203c412 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -40,14 +40,7 @@ Use `cargo build --all-targets` to build the project. Some tests run against the existing Node.js implementation of the Apollo Router. This requires that the `federation-demo` project is running. -First, initialize and update required git submodules. - -``` -git submodule init -git submodule update -``` - -Then, start the service: +Start the service: ``` docker-compose up -d diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 5341c6f46f..99bbeee91b 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -28,13 +28,13 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/ ## ❗ BREAKING ❗ ## 🚀 Features -### Add support for dhat based heap profiling [PR #1829](https://github.com/apollographql/router/pull/1829)) +### Add support for dhat based heap profiling ([PR #1829](https://github.com/apollographql/router/pull/1829)) [dhat-rs](https://github.com/nnethercote/dhat-rs) provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html) style heap profiling. We have added two compile features, dhat-heap and dhat-ad-hoc, which leverage this ability. By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/1829 -### Add `trace_id` in logs to identify all logs related to a specific request [Issue #1981](https://github.com/apollographql/router/issues/1981)) +### Add `trace_id` in logs to identify all logs related to a specific request ([Issue #1981](https://github.com/apollographql/router/issues/1981)) It automatically adds a `trace_id` on logs to identify which log is related to a specific request. Also adds `apollo_trace_id` in response headers to help the client to identify logs for this request. @@ -54,7 +54,7 @@ Example of logs in JSON: By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1982 -### Reload the configuration when receiving the SIGHUP signal [Issue #35](https://github.com/apollographql/router/issues/35)) +### Reload the configuration when receiving the SIGHUP signal ([Issue #35](https://github.com/apollographql/router/issues/35)) This adds support for reloading configuration when receiving the SIGHUP signal. This only works on unix-like platforms, and only with the configuration file. @@ -63,7 +63,7 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🐛 Fixes -### Fix the deduplication logic in deduplication caching [Issue #1984](https://github.com/apollographql/router/issues/1984)) +### Fix the deduplication logic in deduplication caching ([Issue #1984](https://github.com/apollographql/router/issues/1984)) Under load, it is possible to break the router deduplication logic and leave orphaned entries in the waiter map. This fixes the logic to prevent this from occurring. @@ -77,7 +77,7 @@ The Uplink API returns actionable info in its responses: By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2001 -### Fix the rhai SDL print function [Issue #2005](https://github.com/apollographql/router/issues/2005)) +### Fix the rhai SDL print function ([Issue #2005](https://github.com/apollographql/router/issues/2005)) A recent change to the way we provide the SDL to plugins broke the rhai SDL print. This fixes it. @@ -95,16 +95,23 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🛠 Maintenance -### Apply tower best practice to inner service cloning [PR #2030](https://github.com/apollographql/router/pull/2030)) +### Apply tower best practice to inner service cloning ([PR #2030](https://github.com/apollographql/router/pull/2030)) Our service readiness checking can be improved by following tower project recommendations for cloning inner services. By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2030 -### Split the configuration file management in multiple modules [Issue #1790](https://github.com/apollographql/router/issues/1790)) +### Split the configuration file management in multiple modules ([Issue #1790](https://github.com/apollographql/router/issues/1790)) The file is becoming large and hard to modify. By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/1996 ## 📚 Documentation + +### Remove references to git submodules from DEVELOPMENT.md ([Issue #2012](https://github.com/apollographql/router/issues/2012)) + +We don't need instructions about submodules since #1856. Let's remove them. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2045 + From 3e8856c735f04be999afa5a680ec6427f0861f5b Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 3 Nov 2022 22:13:43 +0200 Subject: [PATCH 21/32] chore: Remove unused docs infrastructure (#1894) --- renovate.json5 | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index ba7609bf01..023aa8f0d0 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -94,27 +94,5 @@ "groupSlug": "cargo-tracing-packages", "dependencyDashboardApproval": true }, - { - "matchPaths": [ - "docs/package.json" - ], - "extends": [ - "apollo-docs" - ], - // "Past" major version branches, preserved as - // "version-[0-9]" branches, should be added here! - // See Apollo Server or Apollo Client repos for examples. - "baseBranches": [ - "main" - ], - // The current Apollo Gatsby theme does not support a version of Gatsby - // that supports React 17. - "packageRules": [ - { - "matchPackageNames": ["react", "react-dom"], - "allowedVersions": "16.x", - }, - ], - }, ] } From b51297a68bbb09aac20d7c297b8f9529141c5f35 Mon Sep 17 00:00:00 2001 From: Bryn Cooke Date: Mon, 7 Nov 2022 09:04:19 +0000 Subject: [PATCH 22/32] (fix) #2036 Otel default endpoint incorrectly uses https. (#2048) There is a bug in otel https://github.com/open-telemetry/opentelemetry-rust/issues/908 that did not manifest until `tls-roots` was enabled on `tonic`. This PR introduces a workaround until this is fixed upstream. default endpoint is now configured to use http rather than https. In addition, tls domain will only be set if the endpoint scheme is https. If the endpoint port is 443 ta warning is displayed if TLS has not been configured. Co-authored-by: bryn --- NEXT_CHANGELOG.md | 13 +++++++++ apollo-router/src/plugins/telemetry/otlp.rs | 32 +++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 99bbeee91b..2ad45776a9 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -93,6 +93,19 @@ When validating variables, we should use default values for object fields if app By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2003 +### ([Issue #2036](https://github.com/apollographql/router/issues/2036)) + +Work around for [opentelemetry-rust#908](https://github.com/open-telemetry/opentelemetry-rust/issues/908) +The default URL currently incorrectly uses https causing errors when connecting to a default localhost OTel Collector. + +The router will detect and work around this by explicitly setting the correct endpoint URLs when not specified in config. + +In addition: +* basic TLS defaulting will occur when the endpoint scheme uses `https`. +* a warning will be raised if the endpoint port is 443 but no TLS config is specified. + +By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographql/router/pull/#2048 + ## 🛠 Maintenance ### Apply tower best practice to inner service cloning ([PR #2030](https://github.com/apollographql/router/pull/2030)) diff --git a/apollo-router/src/plugins/telemetry/otlp.rs b/apollo-router/src/plugins/telemetry/otlp.rs index 174959d695..29801f56d2 100644 --- a/apollo-router/src/plugins/telemetry/otlp.rs +++ b/apollo-router/src/plugins/telemetry/otlp.rs @@ -39,9 +39,19 @@ impl Config { pub(crate) fn exporter + From>( &self, ) -> Result { - let endpoint = match &self.endpoint { - Endpoint::Default(_) => None, - Endpoint::Url(s) => Some(s), + let endpoint = match (self.endpoint.clone(), &self.protocol) { + // # https://github.com/apollographql/router/issues/2036 + // Opentelemetry rust incorrectly defaults to https + // This will override the defaults to that of the spec + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md + (Endpoint::Default(_), Some(Protocol::Http)) => { + Some(Url::parse("http://localhost:4318").expect("default url is valid")) + } + // Default is GRPC + (Endpoint::Default(_), _) => { + Some(Url::parse("http://localhost:4317").expect("default url is valid")) + } + (Endpoint::Url(s), _) => Some(s), }; match self.protocol.clone().unwrap_or_default() { Protocol::Grpc => { @@ -51,7 +61,7 @@ impl Config { .with_env() .with(&self.timeout, |b, t| b.with_timeout(*t)) .with(&endpoint, |b, e| b.with_endpoint(e.as_str())) - .try_with(&grpc.tls_config.defaulted(endpoint), |b, t| { + .try_with(&grpc.tls_config.defaulted(endpoint.as_ref()), |b, t| { Ok(b.with_tls_config(t.try_into()?)) })? .with(&grpc.metadata, |b, m| b.with_metadata(m.clone())) @@ -139,7 +149,13 @@ impl TlsConfig { pub(crate) fn defaulted(mut self, endpoint: Option<&Url>) -> Option { if let Some(endpoint) = endpoint { if self.domain_name.is_none() { - self.domain_name = endpoint.host_str().map(|s| s.to_string()) + // If the URL contains the https scheme then default the tls config to use the domain from the URL. We know it's TLS. + // If the URL contains no scheme and the port is 443 emit a warning suggesting that they may have forgotten to configure TLS domain. + if endpoint.scheme() == "https" { + self.domain_name = endpoint.host_str().map(|s| s.to_string()) + } else if endpoint.port() == Some(443) && endpoint.scheme() != "http" { + tracing::warn!("telemetry otlp exporter has been configured with port 443 but TLS domain has not been set. This is likely a configuration error") + } } } @@ -297,6 +313,12 @@ mod tests { assert_eq!(tls, None); } + #[test] + fn default_endpoint() { + let tls = TlsConfig::default().defaulted(None); + assert_eq!(tls, None); + } + #[test] fn endpoint_grpc_defaulting_scheme() { let url = Url::parse("https://api.apm.com:433").unwrap(); From 0e1223695b061456f88b924a2dcbd4dd8a54337a Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 7 Nov 2022 11:16:39 +0100 Subject: [PATCH 23/32] Update apollo-parser to 0.3 (#2051) --- Cargo.lock | 16 ++++++++++------ apollo-router/Cargo.toml | 2 +- apollo-router/src/spec/query.rs | 20 ++++---------------- apollo-router/src/spec/query/tests.rs | 4 ++-- fuzz/Cargo.toml | 4 ++-- fuzz/src/lib.rs | 3 ++- 6 files changed, 21 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14d1015c70..0422333bd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,15 +122,19 @@ dependencies = [ [[package]] name = "apollo-encoder" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344a1afec31ce0273dc2061105b04e5c4ab620fe0748a76244338aa893db42f3" +checksum = "8b17d38f06e92256e9b0b271b878e20309822a587b2acfa234a60d36d92b6b43" +dependencies = [ + "apollo-parser", + "thiserror", +] [[package]] name = "apollo-parser" -version = "0.2.12" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f901785c93a542be795c2703370ddb5f84d4e38606357fc56fefa4b42ab25151" +checksum = "7a8f6cc3fa1313e045538ed2ce72ba916d52b501cd81e636a0bd5cdc703a0c73" dependencies = [ "rowan", ] @@ -286,9 +290,9 @@ dependencies = [ [[package]] name = "apollo-smith" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66fba27e21f40315a0e8abfd2998632b3d1670ae5a16d069c8ff652ea79992d" +checksum = "005d27ddeb774d8059040d00f5a5fee276458b57a22414256e74269b30b7b3ea" dependencies = [ "apollo-encoder", "apollo-parser 0.2.12", diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 9e4878360b..46f9dfbd8c 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -39,7 +39,7 @@ features = ["docs_rs"] access-json = "0.1.0" anyhow = "1.0.66" ansi_term = "0.12" -apollo-parser = "0.2.12" +apollo-parser = "0.3.0" async-compression = { version = "0.3.14", features = [ "tokio", "brotli", diff --git a/apollo-router/src/spec/query.rs b/apollo-router/src/spec/query.rs index 1144b6f3d2..4a48871548 100644 --- a/apollo-router/src/spec/query.rs +++ b/apollo-router/src/spec/query.rs @@ -998,22 +998,10 @@ fn parse_default_value(definition: &ast::VariableDefinition) -> Option { pub(crate) fn parse_value(value: &ast::Value) -> Option { match value { ast::Value::Variable(_) => None, - ast::Value::StringValue(s) => Some(s.to_string().into()), - ast::Value::FloatValue(f) => f.to_string().parse::().ok().map(Into::into), - ast::Value::IntValue(i) => { - let s = i.to_string(); - s.parse::() - .ok() - .map(Into::into) - .or_else(|| s.parse::().ok().map(Into::into)) - } - ast::Value::BooleanValue(b) => { - match (b.true_token().is_some(), b.false_token().is_some()) { - (true, false) => Some(Value::Bool(true)), - (false, true) => Some(Value::Bool(false)), - _ => None, - } - } + ast::Value::StringValue(s) => Some(String::from(s).into()), + ast::Value::FloatValue(f) => Some(f64::from(f).into()), + ast::Value::IntValue(i) => Some(i32::from(i).into()), + ast::Value::BooleanValue(b) => Some(bool::from(b).into()), ast::Value::NullValue(_) => Some(Value::Null), ast::Value::EnumValue(e) => e.name().map(|n| n.text().to_string().into()), ast::Value::ListValue(l) => l diff --git a/apollo-router/src/spec/query/tests.rs b/apollo-router/src/spec/query/tests.rs index 594194b405..f2344e43df 100644 --- a/apollo-router/src/spec/query/tests.rs +++ b/apollo-router/src/spec/query/tests.rs @@ -3657,7 +3657,7 @@ fn check_fragment_on_interface() { name } } - }}", + }", ) .response(json! {{ "get": { @@ -4648,7 +4648,7 @@ fn parse_introspection_query() { } } } - }}"; + }"; assert!(Query::parse(query, api_schema, &Default::default()) .unwrap() .operations diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 47e1ae8d4d..e2df6fcb8b 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -11,8 +11,8 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -apollo-smith = { version = "0.1.3", features = ["parser-impl"] } -apollo-parser = "0.2.12" +apollo-smith = { version = "0.1.4", features = ["parser-impl"] } +apollo-parser = "0.3.0" env_logger = "0.9.1" log = "0.4" reqwest = { version = "0.11", features = ["json", "blocking"] } diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index eac9c3f7e4..ed5415c334 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -13,7 +13,8 @@ use log::debug; pub fn generate_valid_operation(input: &[u8], schema_path: &'static str) -> Result { drop(env_logger::try_init()); - let parser = Parser::new(&fs::read_to_string(schema_path).expect("cannot read file")); + let contents = fs::read_to_string(schema_path).expect("cannot read file"); + let parser = Parser::new(&contents); let tree = parser.parse(); if tree.errors().len() > 0 { From f654f58aee790356ee4aca423d8f3f4a00ec8974 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Mon, 7 Nov 2022 11:38:27 +0100 Subject: [PATCH 24/32] apply traffic shaping on subgraph directly (#2034) The plugin infrastructure works on `BoxService` instances, and makes no guarantee on plugin ordering. The traffic shaping plugin needs a clonable inner service, and should run right before calling the underlying service. So this changes the traffic plugin application so it can work directly on the underlying service. It is still a plugin though, so it keeps the same configuration. --- NEXT_CHANGELOG.md | 9 + apollo-router/src/plugin/mod.rs | 4 +- .../src/plugins/traffic_shaping/mod.rs | 192 ++++++++++++------ .../src/plugins/traffic_shaping/rate/mod.rs | 4 +- .../plugins/traffic_shaping/rate/service.rs | 2 +- .../plugins/traffic_shaping/timeout/layer.rs | 2 +- .../plugins/traffic_shaping/timeout/mod.rs | 61 ++---- apollo-router/src/router_factory.rs | 24 ++- .../src/services/supergraph_service.rs | 43 ++-- 9 files changed, 205 insertions(+), 136 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 2ad45776a9..efc3638410 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -120,6 +120,15 @@ The file is becoming large and hard to modify. By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/1996 +### Apply traffic shaping on supergraph and subgraph directly [PR #2034](https://github.com/apollographql/router/issues/2034)) + +The plugin infrastructure works on `BoxService` instances, and makes no guarantee on plugin ordering. +The traffic shaping plugin needs a clonable inner service, and should run right before calling +the underlying service. So this changes the traffic plugin application so it can work directly +on the underlying service. It is still a plugin though, so it keeps the same configuration. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2034 + ## 📚 Documentation ### Remove references to git submodules from DEVELOPMENT.md ([Issue #2012](https://github.com/apollographql/router/issues/2012)) diff --git a/apollo-router/src/plugin/mod.rs b/apollo-router/src/plugin/mod.rs index d7eee329b2..1a5484e869 100644 --- a/apollo-router/src/plugin/mod.rs +++ b/apollo-router/src/plugin/mod.rs @@ -256,7 +256,6 @@ pub(crate) trait DynPlugin: Send + Sync + 'static { /// Return one or several `Endpoint`s and `ListenAddr` and the router will serve your custom web Endpoint(s). fn web_endpoints(&self) -> MultiMap; - #[cfg(test)] fn as_any(&self) -> &dyn std::any::Any; } @@ -287,9 +286,8 @@ where self.web_endpoints() } - #[cfg(test)] fn as_any(&self) -> &dyn std::any::Any { - self.as_any() + self } } diff --git a/apollo-router/src/plugins/traffic_shaping/mod.rs b/apollo-router/src/plugins/traffic_shaping/mod.rs index d1b21c5ef2..4b06322ee7 100644 --- a/apollo-router/src/plugins/traffic_shaping/mod.rs +++ b/apollo-router/src/plugins/traffic_shaping/mod.rs @@ -7,12 +7,13 @@ //! * Rate limiting //! -pub(crate) mod deduplication; +mod deduplication; mod rate; mod timeout; use std::collections::HashMap; use std::num::NonZeroU64; +use std::pin::Pin; use std::sync::Mutex; use std::time::Duration; @@ -21,10 +22,14 @@ use http::header::CONTENT_ENCODING; use http::HeaderValue; use schemars::JsonSchema; use serde::Deserialize; +use tower::util::Either; +use tower::util::Oneshot; use tower::BoxError; +use tower::Service; use tower::ServiceBuilder; use tower::ServiceExt; +use self::deduplication::QueryDeduplicationLayer; use self::rate::RateLimitLayer; pub(crate) use self::rate::RateLimited; pub(crate) use self::timeout::Elapsed; @@ -40,6 +45,8 @@ use crate::Configuration; use crate::SubgraphRequest; const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30); +pub(crate) const APOLLO_TRAFFIC_SHAPING: &str = "apollo.traffic_shaping"; + trait Merge { fn merge(&self, fallback: Option<&Self>) -> Self; } @@ -172,8 +179,39 @@ impl Plugin for TrafficShaping { rate_limit_subgraphs: Mutex::new(HashMap::new()), }) } +} + +impl TrafficShaping { + fn merge_config( + all_config: Option<&T>, + subgraph_config: Option<&T>, + ) -> Option { + let merged_subgraph_config = subgraph_config.map(|c| c.merge(all_config)); + merged_subgraph_config.or_else(|| all_config.cloned()) + } - fn supergraph_service(&self, service: supergraph::BoxService) -> supergraph::BoxService { + pub(crate) fn supergraph_service_internal( + &self, + service: S, + ) -> impl Service< + supergraph::Request, + Response = supergraph::Response, + Error = BoxError, + Future = timeout::future::ResponseFuture< + Oneshot, S>, supergraph::Request>, + >, + > + Clone + + Send + + Sync + + 'static + where + S: Service + + Clone + + Send + + Sync + + 'static, + >::Future: std::marker::Send, + { ServiceBuilder::new() .layer(TimeoutLayer::new( self.config @@ -184,10 +222,52 @@ impl Plugin for TrafficShaping { )) .option_layer(self.rate_limit_router.clone()) .service(service) - .boxed() } - fn subgraph_service(&self, name: &str, service: subgraph::BoxService) -> subgraph::BoxService { + pub(crate) fn subgraph_service_internal( + &self, + name: &str, + service: S, + ) -> impl Service< + subgraph::Request, + Response = subgraph::Response, + Error = BoxError, + Future = tower::util::Either< + tower::util::Either< + Pin< + Box< + (dyn futures::Future< + Output = std::result::Result< + subgraph::Response, + Box< + (dyn std::error::Error + + std::marker::Send + + std::marker::Sync + + 'static), + >, + >, + > + std::marker::Send + + 'static), + >, + >, + timeout::future::ResponseFuture< + Oneshot, S>, subgraph::Request>, + >, + >, + >::Future, + >, + > + Clone + + Send + + Sync + + 'static + where + S: Service + + Clone + + Send + + Sync + + 'static, + >::Future: std::marker::Send, + { // Either we have the subgraph config and we merge it with the all config, or we just have the all config or we have nothing. let all_config = self.config.all.as_ref(); let subgraph_config = self.config.subgraphs.get(name); @@ -204,7 +284,10 @@ impl Plugin for TrafficShaping { }) .clone() }); - ServiceBuilder::new() + Either::A(ServiceBuilder::new() + .option_layer(config.deduplicate_query.unwrap_or_default().then( + QueryDeduplicationLayer::default + )) .layer(TimeoutLayer::new( config .timeout @@ -220,42 +303,22 @@ impl Plugin for TrafficShaping { } req - }) - .boxed() + })) } else { - service + Either::B(service) } } } -impl TrafficShaping { - fn merge_config( - all_config: Option<&T>, - subgraph_config: Option<&T>, - ) -> Option { - let merged_subgraph_config = subgraph_config.map(|c| c.merge(all_config)); - merged_subgraph_config.or_else(|| all_config.cloned()) - } -} - impl TrafficShaping { pub(crate) fn get_configuration_deduplicate_variables(configuration: &Configuration) -> bool { configuration - .plugin_configuration("apollo.traffic_shaping") + .plugin_configuration(APOLLO_TRAFFIC_SHAPING) .map(|conf| conf.get("deduplicate_variables") == Some(&serde_json::Value::Bool(true))) .unwrap_or_default() } } -pub(crate) fn is_deduplicate_query_enabled(conf: &Configuration) -> bool { - conf.plugins() - .iter() - .find(|(name, _)| name == "apollo.traffic_shaping") - .and_then(|(_, shaping)| shaping.get("all")) - .and_then(|all_shaping| all_shaping.get("deduplicate_query")) - == Some(&serde_json::Value::Bool(true)) -} - register_plugin!("apollo", "traffic_shaping", TrafficShaping); #[cfg(test)] @@ -363,7 +426,7 @@ mod test { .with_configuration(Arc::new(config)); let builder = builder - .with_dyn_plugin("apollo.traffic_shaping".to_string(), plugin) + .with_dyn_plugin(APOLLO_TRAFFIC_SHAPING.to_string(), plugin) .with_subgraph_service("accounts", account_service.clone()) .with_subgraph_service("reviews", review_service.clone()) .with_subgraph_service("products", product_service.clone()); @@ -374,7 +437,7 @@ mod test { async fn get_traffic_shaping_plugin(config: &serde_json::Value) -> Box { // Build a traffic shaping plugin crate::plugin::plugins() - .get("apollo.traffic_shaping") + .get(APOLLO_TRAFFIC_SHAPING) .expect("Plugin not found") .create_instance_without_schema(config) .await @@ -429,7 +492,10 @@ mod test { }); let _response = plugin - .subgraph_service("test", test_service.boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .subgraph_service_internal("test", test_service) .oneshot(request) .await .unwrap(); @@ -484,17 +550,26 @@ mod test { let test_service = MockSubgraph::new(HashMap::new()); let _response = plugin - .subgraph_service("test", test_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .subgraph_service_internal("test", test_service.clone()) .oneshot(SubgraphRequest::fake_builder().build()) .await .unwrap(); let _response = plugin - .subgraph_service("test", test_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .subgraph_service_internal("test", test_service.clone()) .oneshot(SubgraphRequest::fake_builder().build()) .await .expect_err("should be in error due to a timeout and rate limit"); let _response = plugin - .subgraph_service("another", test_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .subgraph_service_internal("another", test_service.clone()) .oneshot(SubgraphRequest::fake_builder().build()) .await .unwrap(); @@ -504,7 +579,10 @@ mod test { .await .is_err()); let _response = plugin - .subgraph_service("test", test_service.boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .subgraph_service_internal("test", test_service.clone()) .oneshot(SubgraphRequest::fake_builder().build()) .await .unwrap(); @@ -528,17 +606,24 @@ mod test { mock_service.expect_clone().returning(|| { let mut mock_service = MockSupergraphService::new(); - mock_service.expect_call().times(0..2).returning(move |_| { - Ok(SupergraphResponse::fake_builder() - .data(json!({ "test": 1234_u32 })) - .build() - .unwrap()) + mock_service.expect_clone().returning(|| { + let mut mock_service = MockSupergraphService::new(); + mock_service.expect_call().times(0..2).returning(move |_| { + Ok(SupergraphResponse::fake_builder() + .data(json!({ "test": 1234_u32 })) + .build() + .unwrap()) + }); + mock_service }); mock_service }); let _response = plugin - .supergraph_service(mock_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .supergraph_service_internal(mock_service.clone()) .oneshot(SupergraphRequest::fake_builder().build().unwrap()) .await .unwrap() @@ -547,7 +632,10 @@ mod test { .unwrap(); assert!(plugin - .supergraph_service(mock_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .supergraph_service_internal(mock_service.clone()) .oneshot(SupergraphRequest::fake_builder().build().unwrap()) .await .is_err()); @@ -557,7 +645,10 @@ mod test { .await .is_err()); let _response = plugin - .supergraph_service(mock_service.clone().boxed()) + .as_any() + .downcast_ref::() + .unwrap() + .supergraph_service_internal(mock_service.clone()) .oneshot(SupergraphRequest::fake_builder().build().unwrap()) .await .unwrap() @@ -565,19 +656,4 @@ mod test { .await .unwrap(); } - - // This test is useful for supergraph service - #[tokio::test] - async fn test_is_deduplicated_query_enabled() { - let config: Configuration = serde_yaml::from_str( - r#" - plugins: - apollo.traffic_shaping: - all: - deduplicate_query: true - "#, - ) - .unwrap(); - assert!(is_deduplicate_query_enabled(&config)); - } } diff --git a/apollo-router/src/plugins/traffic_shaping/rate/mod.rs b/apollo-router/src/plugins/traffic_shaping/rate/mod.rs index 6a2288a7c0..53c16998d0 100644 --- a/apollo-router/src/plugins/traffic_shaping/rate/mod.rs +++ b/apollo-router/src/plugins/traffic_shaping/rate/mod.rs @@ -1,11 +1,11 @@ //! Limit the rate at which requests are processed. mod error; -mod future; +pub(crate) mod future; mod layer; #[allow(clippy::module_inception)] mod rate; -mod service; +pub(crate) mod service; pub(crate) use self::error::RateLimited; pub(crate) use self::layer::RateLimitLayer; diff --git a/apollo-router/src/plugins/traffic_shaping/rate/service.rs b/apollo-router/src/plugins/traffic_shaping/rate/service.rs index cc762f1e7d..f826723b0a 100644 --- a/apollo-router/src/plugins/traffic_shaping/rate/service.rs +++ b/apollo-router/src/plugins/traffic_shaping/rate/service.rs @@ -14,7 +14,7 @@ use super::future::ResponseFuture; use super::Rate; use crate::plugins::traffic_shaping::rate::error::RateLimited; -#[derive(Debug)] +#[derive(Debug, Clone)] pub(crate) struct RateLimit { pub(crate) inner: T, pub(crate) rate: Rate, diff --git a/apollo-router/src/plugins/traffic_shaping/timeout/layer.rs b/apollo-router/src/plugins/traffic_shaping/timeout/layer.rs index 8dab116c11..fd1b5ea59e 100644 --- a/apollo-router/src/plugins/traffic_shaping/timeout/layer.rs +++ b/apollo-router/src/plugins/traffic_shaping/timeout/layer.rs @@ -17,7 +17,7 @@ impl TimeoutLayer { } } -impl Layer for TimeoutLayer { +impl Layer for TimeoutLayer { type Service = Timeout; fn layer(&self, service: S) -> Self::Service { diff --git a/apollo-router/src/plugins/traffic_shaping/timeout/mod.rs b/apollo-router/src/plugins/traffic_shaping/timeout/mod.rs index b766437ea5..6b7cb9abce 100644 --- a/apollo-router/src/plugins/traffic_shaping/timeout/mod.rs +++ b/apollo-router/src/plugins/traffic_shaping/timeout/mod.rs @@ -9,85 +9,52 @@ pub(crate) mod error; pub(crate) mod future; mod layer; -use std::pin::Pin; use std::task::Context; use std::task::Poll; use std::time::Duration; -use futures::Future; -use tokio::time::Sleep; +use tower::util::Oneshot; use tower::Service; +use tower::ServiceExt; use self::future::ResponseFuture; pub(crate) use self::layer::TimeoutLayer; pub(crate) use crate::plugins::traffic_shaping::timeout::error::Elapsed; /// Applies a timeout to requests. -#[derive(Debug)] -pub(crate) struct Timeout { +#[derive(Debug, Clone)] +pub(crate) struct Timeout { inner: T, timeout: Duration, - sleep: Option>>, } // ===== impl Timeout ===== -impl Timeout { +impl Timeout { /// Creates a new [`Timeout`] pub(crate) fn new(inner: T, timeout: Duration) -> Self { - Timeout { - inner, - timeout, - sleep: None, - } + Timeout { inner, timeout } } } impl Service for Timeout where - S: Service, + S: Service + Clone, S::Error: Into, { type Response = S::Response; type Error = tower::BoxError; - type Future = ResponseFuture; + type Future = ResponseFuture>; - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - if self.sleep.is_none() { - self.sleep = Some(Box::pin(tokio::time::sleep(self.timeout))); - } - match self.inner.poll_ready(cx) { - Poll::Pending => {} - Poll::Ready(r) => return Poll::Ready(r.map_err(Into::into)), - }; - - // Checking if we don't timeout on `poll_ready` - if Pin::new( - &mut self - .sleep - .as_mut() - .expect("we can unwrap because we set it just before"), - ) - .poll(cx) - .is_ready() - { - tracing::trace!("timeout exceeded."); - self.sleep = None; - - return Poll::Ready(Err(Elapsed::new().into())); - } - - Poll::Pending + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) } fn call(&mut self, request: Request) -> Self::Future { - let response = self.inner.call(request); + let service = self.inner.clone(); + + let response = service.oneshot(request); - ResponseFuture::new( - response, - self.sleep - .take() - .expect("poll_ready must been called before"), - ) + ResponseFuture::new(response, Box::pin(tokio::time::sleep(self.timeout))) } } diff --git a/apollo-router/src/router_factory.rs b/apollo-router/src/router_factory.rs index 9c9147a41b..333aae551a 100644 --- a/apollo-router/src/router_factory.rs +++ b/apollo-router/src/router_factory.rs @@ -7,9 +7,8 @@ use multimap::MultiMap; use serde_json::Map; use serde_json::Value; use tower::service_fn; -use tower::util::option_layer; +use tower::util::Either; use tower::BoxError; -use tower::Layer; use tower::ServiceExt; use tower_service::Service; @@ -17,8 +16,8 @@ use crate::configuration::Configuration; use crate::configuration::ConfigurationError; use crate::plugin::DynPlugin; use crate::plugin::Handler; -use crate::plugins::traffic_shaping::deduplication::QueryDeduplicationLayer; -use crate::plugins::traffic_shaping::is_deduplicate_query_enabled; +use crate::plugins::traffic_shaping::TrafficShaping; +use crate::plugins::traffic_shaping::APOLLO_TRAFFIC_SHAPING; use crate::services::new_service::NewService; use crate::services::RouterCreator; use crate::services::SubgraphService; @@ -120,17 +119,22 @@ impl SupergraphServiceConfigurator for YamlSupergraphServiceFactory { ) -> Result { // Process the plugins. let plugins = create_plugins(&configuration, &schema, extra_plugins).await?; - let deduplicate_queries = is_deduplicate_query_enabled(configuration.as_ref()); let mut builder = PluggableSupergraphServiceBuilder::new(schema.clone()); builder = builder.with_configuration(configuration); for (name, _) in schema.subgraphs() { - builder = builder.with_subgraph_service( - name, - option_layer(deduplicate_queries.then(QueryDeduplicationLayer::default)) - .layer(SubgraphService::new(name)), - ); + let subgraph_service = match plugins + .iter() + .find(|i| i.0.as_str() == APOLLO_TRAFFIC_SHAPING) + .and_then(|plugin| (&*plugin.1).as_any().downcast_ref::()) + { + Some(shaping) => { + Either::A(shaping.subgraph_service_internal(name, SubgraphService::new(name))) + } + None => Either::B(SubgraphService::new(name)), + }; + builder = builder.with_subgraph_service(name, subgraph_service); } for (plugin_name, plugin) in plugins { diff --git a/apollo-router/src/services/supergraph_service.rs b/apollo-router/src/services/supergraph_service.rs index 3aa1dd0386..5f3c1b431e 100644 --- a/apollo-router/src/services/supergraph_service.rs +++ b/apollo-router/src/services/supergraph_service.rs @@ -13,6 +13,7 @@ use indexmap::IndexMap; use multimap::MultiMap; use opentelemetry::trace::SpanKind; use tower::util::BoxService; +use tower::util::Either; use tower::BoxError; use tower::ServiceBuilder; use tower::ServiceExt; @@ -32,6 +33,8 @@ use crate::graphql; use crate::graphql::IntoGraphQLErrors; use crate::introspection::Introspection; use crate::plugin::DynPlugin; +use crate::plugins::traffic_shaping::TrafficShaping; +use crate::plugins::traffic_shaping::APOLLO_TRAFFIC_SHAPING; use crate::query_planner::BridgeQueryPlanner; use crate::query_planner::CachingQueryPlanner; use crate::router_factory::Endpoint; @@ -403,23 +406,35 @@ impl RouterCreator { Error = BoxError, Future = BoxFuture<'static, Result>, > + Send { + let supergraph_service = SupergraphService::builder() + .query_planner_service(self.query_planner_service.clone()) + .execution_service_factory(ExecutionCreator { + schema: self.schema.clone(), + plugins: self.plugins.clone(), + subgraph_creator: self.subgraph_creator.clone(), + }) + .schema(self.schema.clone()) + .build(); + + let supergraph_service = match self + .plugins + .iter() + .find(|i| i.0.as_str() == APOLLO_TRAFFIC_SHAPING) + .and_then(|plugin| plugin.1.as_any().downcast_ref::()) + { + Some(shaping) => Either::A(shaping.supergraph_service_internal(supergraph_service)), + None => Either::B(supergraph_service), + }; + ServiceBuilder::new() .layer(EnsureQueryPresence::default()) .service( - self.plugins.iter().rev().fold( - BoxService::new( - SupergraphService::builder() - .query_planner_service(self.query_planner_service.clone()) - .execution_service_factory(ExecutionCreator { - schema: self.schema.clone(), - plugins: self.plugins.clone(), - subgraph_creator: self.subgraph_creator.clone(), - }) - .schema(self.schema.clone()) - .build(), - ), - |acc, (_, e)| e.supergraph_service(acc), - ), + self.plugins + .iter() + .rev() + .fold(BoxService::new(supergraph_service), |acc, (_, e)| { + e.supergraph_service(acc) + }), ) } From 6d4a293b623cbe62033d5343674b51d48012cce7 Mon Sep 17 00:00:00 2001 From: Lenny Burdette Date: Mon, 7 Nov 2022 05:58:24 -0500 Subject: [PATCH 25/32] docs: add a note about --dev mode config equivalent (#1940) To actively discourage folks from using `--dev` in production, this explains how to cherry-pick parts of dev mode for a production config. --- docs/source/quickstart.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/source/quickstart.mdx b/docs/source/quickstart.mdx index f1fe60dc5f..7c218afa08 100644 --- a/docs/source/quickstart.mdx +++ b/docs/source/quickstart.mdx @@ -195,6 +195,27 @@ That's it! Running the Router with the `--dev` flag enables a development mode t Visit `http://127.0.0.1:4000` to open Apollo Sandbox, inspect your entire supergraph, and run your first queries! +
    + + +**⚠️ Do not use the `--dev` flag in production!** If you want to replicate any development mode functionality in production, modify your YAML configuration file instead. + +Using `--dev` is equivalent to running `./router --hot-reload` with the following configuration: + +```yaml +sandbox: + enabled: true +supergraph: + introspection: true +include_subgraph_errors: + all: true +plugins: + experimental.expose_query_plan: true +``` + + +
    + ## Next steps Now that you know how to run Apollo Router with a supergraph schema, you can: From a39e51dd3b5d869a9dca96abf30d56961ad76ff2 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 8 Nov 2022 14:26:38 +0100 Subject: [PATCH 26/32] Update to apollo-smith 0.2 (#2062) Avoid staying on a yanked version: https://github.com/apollographql/apollo-rs/issues/351 --- Cargo.lock | 4 ++-- fuzz/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0422333bd5..c958eda838 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "apollo-smith" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005d27ddeb774d8059040d00f5a5fee276458b57a22414256e74269b30b7b3ea" +checksum = "796458df9954e3f7ad451dd231d3d369296d349371878a31b9641470989bb112" dependencies = [ "apollo-encoder", "apollo-parser 0.2.12", diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index e2df6fcb8b..9fdf9734b7 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -11,7 +11,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -apollo-smith = { version = "0.1.4", features = ["parser-impl"] } +apollo-smith = { version = "0.2.0", features = ["parser-impl"] } apollo-parser = "0.3.0" env_logger = "0.9.1" log = "0.4" From 5f29eca9a499a76220ea10bc4025342ccaf59a2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 14:45:10 +0000 Subject: [PATCH 27/32] fix(deps): update all non-major packages >= 1.0 --- Cargo.lock | 4 ++-- apollo-router/Cargo.toml | 2 +- dockerfiles/fed2-demo-gateway/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c958eda838..01e88d2444 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,9 +3825,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 46f9dfbd8c..02ecd4c961 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -140,7 +140,7 @@ prost = "0.9.0" prost-types = "0.9.0" rand = "0.8.5" rhai = { version = "1.10.1", features = ["sync", "serde", "internals"] } -regex = "1.6.0" +regex = "1.7.0" reqwest = { version = "0.11.12", default-features = false, features = [ "rustls-tls", "json", diff --git a/dockerfiles/fed2-demo-gateway/package.json b/dockerfiles/fed2-demo-gateway/package.json index 40ad440a99..d7241ba418 100644 --- a/dockerfiles/fed2-demo-gateway/package.json +++ b/dockerfiles/fed2-demo-gateway/package.json @@ -7,7 +7,7 @@ "start": "node gateway.js" }, "dependencies": { - "@apollo/server": "4.1.0", + "@apollo/server": "4.1.1", "@apollo/gateway": "2.1.4", "supergraph-demo-opentelemetry": "0.2.4", "graphql": "16.6.0" From 69413d6cc3446e597c6b80a00f6fa42b24395a25 Mon Sep 17 00:00:00 2001 From: Coenen Benjamin Date: Tue, 8 Nov 2022 18:33:21 +0100 Subject: [PATCH 28/32] do not expose the trace_id in response header right now (#2061) Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- NEXT_CHANGELOG.md | 2 +- .../telemetry/tracing/apollo_telemetry.rs | 17 +++++----- .../src/services/supergraph_service.rs | 32 +++++++++---------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index efc3638410..7259d46ee1 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -36,7 +36,7 @@ By [@garypen](https://github.com/garypen) in https://github.com/apollographql/ro ### Add `trace_id` in logs to identify all logs related to a specific request ([Issue #1981](https://github.com/apollographql/router/issues/1981)) -It automatically adds a `trace_id` on logs to identify which log is related to a specific request. Also adds `apollo_trace_id` in response headers to help the client to identify logs for this request. +It automatically adds a `trace_id` on logs to identify which log is related to a specific request. Example of logs in text: diff --git a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs index 2c812cc5d2..41800f6578 100644 --- a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs +++ b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs @@ -427,17 +427,18 @@ impl Exporter { .map(|(header_name, value)| (header_name.to_lowercase(), Values { value })) .collect(); // For now, only trace_id - let mut response_headers = HashMap::with_capacity(1); - response_headers.insert( - String::from("apollo_trace_id"), - Values { - value: vec![span.span_context.trace_id().to_string()], - }, - ); + // let mut response_headers = HashMap::with_capacity(1); + // FIXME: uncomment later + // response_headers.insert( + // String::from("apollo_trace_id"), + // Values { + // value: vec![span.span_context.trace_id().to_string()], + // }, + // ); Http { method: method.into(), request_headers, - response_headers, + response_headers: HashMap::new(), status_code: 0, } } diff --git a/apollo-router/src/services/supergraph_service.rs b/apollo-router/src/services/supergraph_service.rs index 5f3c1b431e..47b6994b1a 100644 --- a/apollo-router/src/services/supergraph_service.rs +++ b/apollo-router/src/services/supergraph_service.rs @@ -3,11 +3,9 @@ use std::sync::Arc; use std::task::Poll; -use axum::headers::HeaderName; use futures::future::BoxFuture; use futures::stream::StreamExt; use futures::TryFutureExt; -use http::HeaderValue; use http::StatusCode; use indexmap::IndexMap; use multimap::MultiMap; @@ -40,7 +38,6 @@ use crate::query_planner::CachingQueryPlanner; use crate::router_factory::Endpoint; use crate::router_factory::SupergraphServiceFactory; use crate::services::layers::ensure_query_presence::EnsureQueryPresence; -use crate::tracer::TraceId; use crate::Configuration; use crate::Context; use crate::ExecutionRequest; @@ -103,8 +100,8 @@ where let schema = self.schema.clone(); let context_cloned = req.context.clone(); - let fut = service_call(planning, execution, schema, req) - .or_else(|error: BoxError| async move { + let fut = + service_call(planning, execution, schema, req).or_else(|error: BoxError| async move { let errors = vec![crate::error::Error { message: error.to_string(), extensions: serde_json_bytes::json!({ @@ -122,19 +119,20 @@ where .context(context_cloned) .build() .expect("building a response like this should not fail")) - }) - .and_then(|mut res| async move { - if let Some(trace_id) = TraceId::maybe_new().map(|t| t.to_string()) { - let header_value = HeaderValue::from_str(trace_id.as_str()); - if let Ok(header_value) = header_value { - res.response - .headers_mut() - .insert(HeaderName::from_static("apollo_trace_id"), header_value); - } - } - - Ok(res) }); + // FIXME: Enable it later + // .and_then(|mut res| async move { + // if let Some(trace_id) = TraceId::maybe_new().map(|t| t.to_string()) { + // let header_value = HeaderValue::from_str(trace_id.as_str()); + // if let Ok(header_value) = header_value { + // res.response + // .headers_mut() + // .insert(HeaderName::from_static("apollo_trace_id"), header_value); + // } + // } + + // Ok(res) + // }); Box::pin(fut) } From 1bde0a8fe980029618ca299beace930b21beb46e Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Wed, 9 Nov 2022 12:54:16 +0200 Subject: [PATCH 29/32] Prepare for v1.3.0 (#2065) This PR makes the appropriate changes in preparation for releasing: 1. Bumps versions in preparation for release 2. Does a straight copy of `NEXT_CHANGELOG.md` to top of `CHANGELOG.md` 3. Does initial editorial on `CHANGELOG.md` prior to initial review (the bulk of the work) Co-authored-by: Gary Pennington --- CHANGELOG.md | 117 ++++++++++++++++++ Cargo.lock | 8 +- NEXT_CHANGELOG.md | 107 ---------------- apollo-router-benchmarks/Cargo.toml | 2 +- apollo-router-scaffold/Cargo.toml | 2 +- .../templates/base/Cargo.toml | 2 +- .../templates/base/xtask/Cargo.toml | 2 +- apollo-router/Cargo.toml | 2 +- .../tracing/docker-compose.datadog.yml | 2 +- dockerfiles/tracing/docker-compose.jaeger.yml | 2 +- dockerfiles/tracing/docker-compose.zipkin.yml | 2 +- docs/source/containerization/docker.mdx | 8 +- docs/source/containerization/kubernetes.mdx | 28 ++--- helm/chart/router/Chart.yaml | 4 +- helm/chart/router/README.md | 6 +- scripts/install.sh | 2 +- xtask/Cargo.toml | 2 +- 17 files changed, 154 insertions(+), 144 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b231d9f0b9..f8b53650ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,123 @@ All notable changes to Router will be documented in this file. This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html). +# [1.3.0] - 2022-11-09 + +## 🚀 Features + +### Add support for DHAT-based heap profiling ([PR #1829](https://github.com/apollographql/router/pull/1829)) + +The [dhat-rs](https://github.com/nnethercote/dhat-rs) crate provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html)-style heap profiling. We have added two compile-time features, `dhat-heap` and `dhat-ad-hoc`, which leverage this ability. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/1829 + +### Add `trace_id` in logs to correlate entries from the same request ([Issue #1981](https://github.com/apollographql/router/issues/1981)) + +A `trace_id` is now added to each log line to help correlate log entries to specific requests. The value for this property will be automatically inherited from any enabled distributed tracing headers, such as those listed in our [Tracing propagation header](https://www.apollographql.com/docs/router/configuration/tracing/#propagation) documentation (e.g., Jaeger, Zipkin, Datadog, etc.). + +In the event that a `trace_id` was not inherited from a propagated header, the Router will originate a `trace_id` and propagate that ID to subgraphs if header propagation (see link above) is enabled. + +Here is an example of the `trace_id` appearing in plain-text log output: + +``` +2022-10-21T15:17:45.562553Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::services::subgraph_service: fetch_error="hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))" +2022-10-21T15:17:45.565768Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::query_planner::execution: Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111) +``` + +And an example of the `trace_id` appearing in JSON-formatted log output in a similar scenario: + +```json +{"timestamp":"2022-10-26T15:39:01.078260Z","level":"ERROR","fetch_error":"hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))","target":"apollo_router::services::subgraph_service","filename":"apollo-router/src/services/subgraph_service.rs","line_number":182,"span":{"name":"subgraph"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"},{"name":"fetch"},{"name":"subgraph"}]} +{"timestamp":"2022-10-26T15:39:01.080259Z","level":"ERROR","message":"Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111)","target":"apollo_router::query_planner::execution","filename":"apollo-router/src/query_planner/execution.rs","line_number":188,"span":{"name":"parallel"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"}]} +``` + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1982 + +### Reload configuration when receiving the SIGHUP signal ([Issue #35](https://github.com/apollographql/router/issues/35)) + +The Router will now reload its configuration when receiving the SIGHUP signal. This signal is only supported on *nix platforms, +and only when a configuration file was passed to the Router initially at startup. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2015 + +## 🐛 Fixes + +### Fix the deduplication logic in deduplication caching ([Issue #1984](https://github.com/apollographql/router/issues/1984)) + +Under load, we found it was possible to break the router de-duplication logic and leave orphaned entries in the waiter map. This fixes the de-duplication logic to prevent this from occurring. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2014 + +### Follow back-off instructions from Studio Uplink ([Issue #1494](https://github.com/apollographql/router/issues/1494) [Issue #1539](https://github.com/apollographql/router/issues/1539)) + +When operating in a [Managed Federation configuration](https://www.apollographql.com/docs/federation/managed-federation/overview/) and fetching the supergraph from Apollo Uplink, the Router will now react differently depending on the response from Apollo Uplink, rather than retrying incessantly: + +- Not attempt to retry when met with unrecoverable conditions (e.g., a Graph that does not exist). +- Back-off on retries when the infrastructure asks for a longer retry interval. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2001 + +### Fix the rhai SDL `print` function ([Issue #2005](https://github.com/apollographql/router/issues/2005)) + +Fixes the `print` function exposed to rhai which was broken due to a recent change that was made in the way we pass SDL (schema definition language) to plugins. + +By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/apollographql/router/pull/2007 + +### Export `router_factory::Endpoint` ([PR #2007](https://github.com/apollographql/router/pull/2007)) + +We now export the `router_factory::Endpoint` struct that was inadvertently unexposed. Without access to this struct, it was not possible to implement the `web_endpoints` trait in plugins. + +By [@scottdouglas1989](https://github.com/scottdouglas1989) in https://github.com/apollographql/router/pull/2007 + +### Validate default values for input object fields ([Issue #1979](https://github.com/apollographql/router/issues/1979)) + +When validating variables, the Router now uses graph-specified default values for object fields, if applicable. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2003 + +### Address regression when sending gRPC to `localhost` ([Issue #2036](https://github.com/apollographql/router/issues/2036)) + +We again support sending unencrypted gRPC tracing and metrics data to `localhost`. This follows-up on a regression which occurred in the previous release which addressed a limitation which prevented sending gRPC to TLS-secured endpoints. + +Applying a proper fix was complicated by an upstream issue ([opentelemetry-rust#908](https://github.com/open-telemetry/opentelemetry-rust/issues/908)) which incorrectly assumes `https` in the absence of a more-specific protocol/schema, contrary to the OpenTelmetry specification which indicates otherwise. + +The Router will now detect and work-around this upstream issue by explicitly setting the full, correct endpoint URLs when not specified in config. + +In addition: + +- Basic TLS-encyrption will be enabled when the endpoint scheme is explicitly `https`. +- A _warning_ will be emitted if the endpoint port is 443 but *no* TLS config is specified since _most_ traffic on port 443 is expected to be encrypted. + +By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographql/router/pull/#2048 + +## 🛠 Maintenance + +### Apply Tower best-practice to "inner" Service cloning ([PR #2030](https://github.com/apollographql/router/pull/2030)) + +We found our `Service` readiness checks could be improved by following the Tower project's [recommendations](https://docs.rs/tower/latest/tower/trait.Service.html#be-careful-when-cloning-inner-services) for cloning inner Services. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2030 + +### Split the configuration file implementation into modules ([Issue #1790](https://github.com/apollographql/router/issues/1790)) + +The internals of the implementation for the configuration have been modularized to facilitate on-going development. There should be no impact to end-users who are only using YAML to configure their Router. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/1996 + +### Apply traffic-shaping directly to `supergraph` and `subgraph` ([PR #2034](https://github.com/apollographql/router/issues/2034)) + +The plugin infrastructure works on `BoxService` instances and makes no guarantee on plugin ordering. The traffic shaping plugin needs a clonable inner service, and should run right before calling the underlying service. We'e changed the traffic plugin application so it can work directly on the underlying service. The configuration remains the same since this is still implemented as a plugin. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2034 + +## 📚 Documentation + +### Remove references to Git submodules from `DEVELOPMENT.md` ([Issue #2012](https://github.com/apollographql/router/issues/2012)) + +We've removed the instructions from our development documentation which guide users to familiarize themselves with and clone Git submodules when working on the Router source itself. This follows-up on the removal of the modules themselves in [PR #1856](https://github.com/apollographql/router/pull/1856). + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2045 + # [1.2.1] - 2022-10-25 ## 🐛 Fixes diff --git a/Cargo.lock b/Cargo.lock index 01e88d2444..4f59ea59c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.2.1" +version = "1.3.0" dependencies = [ "access-json", "ansi_term", @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.2.1" +version = "1.3.0" dependencies = [ "apollo-router", "async-trait", @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.2.1" +version = "1.3.0" dependencies = [ "anyhow", "cargo-scaffold", @@ -5927,7 +5927,7 @@ dependencies = [ [[package]] name = "xtask" -version = "1.2.1" +version = "1.3.0" dependencies = [ "ansi_term", "anyhow", diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 7259d46ee1..942a264d7b 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -27,113 +27,6 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/ ## ❗ BREAKING ❗ ## 🚀 Features - -### Add support for dhat based heap profiling ([PR #1829](https://github.com/apollographql/router/pull/1829)) - -[dhat-rs](https://github.com/nnethercote/dhat-rs) provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html) style heap profiling. We have added two compile features, dhat-heap and dhat-ad-hoc, which leverage this ability. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/1829 - -### Add `trace_id` in logs to identify all logs related to a specific request ([Issue #1981](https://github.com/apollographql/router/issues/1981)) - -It automatically adds a `trace_id` on logs to identify which log is related to a specific request. - -Example of logs in text: - -```logs -2022-10-21T15:17:45.562553Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::services::subgraph_service: fetch_error="hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))" -2022-10-21T15:17:45.565768Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::query_planner::execution: Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111) -``` - -Example of logs in JSON: - -```logs -{"timestamp":"2022-10-26T15:39:01.078260Z","level":"ERROR","fetch_error":"hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))","target":"apollo_router::services::subgraph_service","filename":"apollo-router/src/services/subgraph_service.rs","line_number":182,"span":{"name":"subgraph"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"},{"name":"fetch"},{"name":"subgraph"}]} -{"timestamp":"2022-10-26T15:39:01.080259Z","level":"ERROR","message":"Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111)","target":"apollo_router::query_planner::execution","filename":"apollo-router/src/query_planner/execution.rs","line_number":188,"span":{"name":"parallel"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"}]} -``` - -By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/1982 - -### Reload the configuration when receiving the SIGHUP signal ([Issue #35](https://github.com/apollographql/router/issues/35)) - -This adds support for reloading configuration when receiving the SIGHUP signal. This only works on unix-like platforms, -and only with the configuration file. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2015 - ## 🐛 Fixes - -### Fix the deduplication logic in deduplication caching ([Issue #1984](https://github.com/apollographql/router/issues/1984)) - -Under load, it is possible to break the router deduplication logic and leave orphaned entries in the waiter map. This fixes the logic to prevent this from occurring. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2014 - -### Follow directives from Uplink ([Issue #1494](https://github.com/apollographql/router/issues/1494) [Issue #1539](https://github.com/apollographql/router/issues/1539)) - -The Uplink API returns actionable info in its responses: -- some error codes indicate an unrecoverable issue, for which the router should not retry the query (example: non-existing graph) -- it can tell the router when it should retry the query - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2001 - -### Fix the rhai SDL print function ([Issue #2005](https://github.com/apollographql/router/issues/2005)) - -A recent change to the way we provide the SDL to plugins broke the rhai SDL print. This fixes it. - -By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/apollographql/router/pull/2007 - -### Exports a missing strut (`router_factory::Endpoint`) that was preventing the `web_endpoints` trait from being implemented by Plugins - -By [@scottdouglas1989](https://github.com/scottdouglas1989) in https://github.com/apollographql/router/pull/2007 - -### Validate default values for input object fields ([Issue #1979](https://github.com/apollographql/router/issues/1979)) - -When validating variables, we should use default values for object fields if applicable. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2003 - -### ([Issue #2036](https://github.com/apollographql/router/issues/2036)) - -Work around for [opentelemetry-rust#908](https://github.com/open-telemetry/opentelemetry-rust/issues/908) -The default URL currently incorrectly uses https causing errors when connecting to a default localhost OTel Collector. - -The router will detect and work around this by explicitly setting the correct endpoint URLs when not specified in config. - -In addition: -* basic TLS defaulting will occur when the endpoint scheme uses `https`. -* a warning will be raised if the endpoint port is 443 but no TLS config is specified. - -By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographql/router/pull/#2048 - ## 🛠 Maintenance - -### Apply tower best practice to inner service cloning ([PR #2030](https://github.com/apollographql/router/pull/2030)) - -Our service readiness checking can be improved by following tower project recommendations for cloning inner services. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2030 - -### Split the configuration file management in multiple modules ([Issue #1790](https://github.com/apollographql/router/issues/1790)) - -The file is becoming large and hard to modify. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/1996 - -### Apply traffic shaping on supergraph and subgraph directly [PR #2034](https://github.com/apollographql/router/issues/2034)) - -The plugin infrastructure works on `BoxService` instances, and makes no guarantee on plugin ordering. -The traffic shaping plugin needs a clonable inner service, and should run right before calling -the underlying service. So this changes the traffic plugin application so it can work directly -on the underlying service. It is still a plugin though, so it keeps the same configuration. - -By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2034 - ## 📚 Documentation - -### Remove references to git submodules from DEVELOPMENT.md ([Issue #2012](https://github.com/apollographql/router/issues/2012)) - -We don't need instructions about submodules since #1856. Let's remove them. - -By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2045 - diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index e07f04f346..f4fc5442c3 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.2.1" +version = "1.3.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "LicenseRef-ELv2" diff --git a/apollo-router-scaffold/Cargo.toml b/apollo-router-scaffold/Cargo.toml index b06f2420e2..12120625ab 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-scaffold" -version = "1.2.1" +version = "1.3.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "LicenseRef-ELv2" diff --git a/apollo-router-scaffold/templates/base/Cargo.toml b/apollo-router-scaffold/templates/base/Cargo.toml index cbf28f9421..2620dd577c 100644 --- a/apollo-router-scaffold/templates/base/Cargo.toml +++ b/apollo-router-scaffold/templates/base/Cargo.toml @@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" } apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} # Note if you update these dependencies then also update xtask/Cargo.toml -apollo-router = "1.2.1" +apollo-router = "1.3.0" {{/if}} {{/if}} async-trait = "0.1.52" diff --git a/apollo-router-scaffold/templates/base/xtask/Cargo.toml b/apollo-router-scaffold/templates/base/xtask/Cargo.toml index e3c58d5e94..b8552d50f5 100644 --- a/apollo-router-scaffold/templates/base/xtask/Cargo.toml +++ b/apollo-router-scaffold/templates/base/xtask/Cargo.toml @@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" } {{#if branch}} apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} -apollo-router-scaffold = { git="https://github.com/apollographql/router.git", tag="v1.2.1"} +apollo-router-scaffold = { git="https://github.com/apollographql/router.git", tag="v1.3.0"} {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 02ecd4c961..7ab972b1fd 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.2.1" +version = "1.3.0" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://www.apollographql.com/docs/router/" diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index 2dbb7439a1..7e5d0f0abd 100644 --- a/dockerfiles/tracing/docker-compose.datadog.yml +++ b/dockerfiles/tracing/docker-compose.datadog.yml @@ -3,7 +3,7 @@ services: apollo-router: container_name: apollo-router - image: ghcr.io/apollographql/router:v1.2.1 + image: ghcr.io/apollographql/router:v1.3.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/datadog.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.jaeger.yml b/dockerfiles/tracing/docker-compose.jaeger.yml index 0a932455fd..d94555e14d 100644 --- a/dockerfiles/tracing/docker-compose.jaeger.yml +++ b/dockerfiles/tracing/docker-compose.jaeger.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router #build: ./router - image: ghcr.io/apollographql/router:v1.2.1 + image: ghcr.io/apollographql/router:v1.3.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/jaeger.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.zipkin.yml b/dockerfiles/tracing/docker-compose.zipkin.yml index 5a77e29bb7..21e0f036fb 100644 --- a/dockerfiles/tracing/docker-compose.zipkin.yml +++ b/dockerfiles/tracing/docker-compose.zipkin.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router build: ./router - image: ghcr.io/apollographql/router:v1.2.1 + image: ghcr.io/apollographql/router:v1.3.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml diff --git a/docs/source/containerization/docker.mdx b/docs/source/containerization/docker.mdx index 000e6fa0aa..b24b52d7a7 100644 --- a/docs/source/containerization/docker.mdx +++ b/docs/source/containerization/docker.mdx @@ -11,7 +11,7 @@ The default behaviour of the router images is suitable for a quickstart or devel Note: The [docker documentation](https://docs.docker.com/engine/reference/run/) for the run command may be helpful when reading through the examples. -Note: The exact image version to use is your choice depending on which release you wish to use. In the following examples, replace `` with your chosen version. e.g.: `v1.2.1` +Note: The exact image version to use is your choice depending on which release you wish to use. In the following examples, replace `` with your chosen version. e.g.: `v1.3.0` ## Override the configuration @@ -97,10 +97,10 @@ Usage: build_docker_image.sh [-b] [] Example 1: Building HEAD from the repo build_docker_image.sh -b Example 2: Building tag from the repo - build_docker_image.sh -b v1.2.1 + build_docker_image.sh -b v1.3.0 Example 3: Building commit hash from the repo build_docker_image.sh -b 1c220d35acf9ad2537b8edc58c498390b6701d3d - Example 4: Building tag v1.2.1 from the released tarball - build_docker_image.sh v1.2.1 + Example 4: Building tag v1.3.0 from the released tarball + build_docker_image.sh v1.3.0 ``` Note: The script has to be run from the `dockerfiles/diy` directory because it makes assumptions about the relative availability of various files. The example uses [distroless images](https://github.com/GoogleContainerTools/distroless) for the final image build. Feel free to modify the script to use images which better suit your own needs. diff --git a/docs/source/containerization/kubernetes.mdx b/docs/source/containerization/kubernetes.mdx index b1c68c34ad..0f915994fa 100644 --- a/docs/source/containerization/kubernetes.mdx +++ b/docs/source/containerization/kubernetes.mdx @@ -13,7 +13,7 @@ import { Link } from 'gatsby'; [Helm](https://helm.sh) is the package manager for kubernetes. -There is a complete [helm chart definition](https://github.com/apollographql/router/tree/v1.2.1/helm/chart/router) in the repo which illustrates how to use helm to deploy the router in kubernetes. +There is a complete [helm chart definition](https://github.com/apollographql/router/tree/v1.3.0/helm/chart/router) in the repo which illustrates how to use helm to deploy the router in kubernetes. In both the following examples, we are using helm to install the router: - into namespace "router-deploy" (create namespace if it doesn't exist) @@ -64,10 +64,10 @@ kind: ServiceAccount metadata: name: release-name-router labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm --- # Source: router/templates/secret.yaml @@ -76,10 +76,10 @@ kind: Secret metadata: name: "release-name-router" labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm data: managedFederationApiKey: "UkVEQUNURUQ=" @@ -90,10 +90,10 @@ kind: ConfigMap metadata: name: release-name-router labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm data: configuration.yaml: | @@ -117,10 +117,10 @@ kind: Service metadata: name: release-name-router labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP @@ -143,10 +143,10 @@ kind: Deployment metadata: name: release-name-router labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm annotations: @@ -172,7 +172,7 @@ spec: - name: router securityContext: {} - image: "ghcr.io/apollographql/router:v1.2.1" + image: "ghcr.io/apollographql/router:v1.3.0" imagePullPolicy: IfNotPresent args: - --hot-reload @@ -220,10 +220,10 @@ kind: Pod metadata: name: "release-name-router-test-connection" labels: - helm.sh/chart: router-1.0.0-rc.5 + helm.sh/chart: router-1.0.0-rc.7 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.2.1" + app.kubernetes.io/version: "v1.3.0" app.kubernetes.io/managed-by: Helm annotations: "helm.sh/hook": test diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index 4f740e84c6..eeef60fab2 100644 --- a/helm/chart/router/Chart.yaml +++ b/helm/chart/router/Chart.yaml @@ -19,10 +19,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0-rc.6 +version: 1.0.0-rc.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v1.2.1" +appVersion: "v1.3.0" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index fc8723c450..362949f4a4 100644 --- a/helm/chart/router/README.md +++ b/helm/chart/router/README.md @@ -2,7 +2,7 @@ [router](https://github.com/apollographql/router) Rust Graph Routing runtime for Apollo Federation -![Version: 1.0.0-rc.6](https://img.shields.io/badge/Version-1.0.0--rc.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.2.1](https://img.shields.io/badge/AppVersion-v1.2.1-informational?style=flat-square) +![Version: 1.0.0-rc.7](https://img.shields.io/badge/Version-1.0.0--rc.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.3.0](https://img.shields.io/badge/AppVersion-v1.3.0-informational?style=flat-square) ## Prerequisites @@ -11,7 +11,7 @@ ## Get Repo Info ```console -helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.6 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.7 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.6 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.6 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.0.0-rc.7 --values my-values.yaml ``` _See [configuration](#configuration) below._ diff --git a/scripts/install.sh b/scripts/install.sh index 680b4b647d..362ec6cb4a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/router/releases/downloa # Router version defined in apollo-router's Cargo.toml # Note: Change this line manually during the release steps. -PACKAGE_VERSION="v1.2.1" +PACKAGE_VERSION="v1.3.0" download_binary() { downloader --check diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 38bc10531d..c328c6d790 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "1.2.1" +version = "1.3.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" From 02ed083547f78664fe496d7c9360d6d096e6abc4 Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:54:26 -0500 Subject: [PATCH 30/32] updating cargo lockfile --- Cargo.lock | 170 +++++++++-------------------------------------------- 1 file changed, 29 insertions(+), 141 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70d64710ff..58fbedb18a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,41 +107,36 @@ checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "apollo-compiler" -version = "0.3.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8469cb8f7f42ad9b062e70f1148320e6cb7d727d2e87ca46635633ca6b2e6e4d" +checksum = "619d54da02587ebced191b1000e3d8b31060cf7c77c5800c53d33d88faaeff30" dependencies = [ "apollo-parser", "miette 4.7.1", "ordered-float 2.10.0", - "rowan", "salsa", "thiserror", - "uuid 1.2.1", + "uuid 0.8.2", ] [[package]] name = "apollo-encoder" -version = "0.3.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b17d38f06e92256e9b0b271b878e20309822a587b2acfa234a60d36d92b6b43" -dependencies = [ - "apollo-parser", - "thiserror", -] +checksum = "344a1afec31ce0273dc2061105b04e5c4ab620fe0748a76244338aa893db42f3" [[package]] name = "apollo-parser" -version = "0.3.1" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8f6cc3fa1313e045538ed2ce72ba916d52b501cd81e636a0bd5cdc703a0c73" +checksum = "f901785c93a542be795c2703370ddb5f84d4e38606357fc56fefa4b42ab25151" dependencies = [ "rowan", ] [[package]] name = "apollo-router" -version = "1.3.0" +version = "1.2.1" dependencies = [ "access-json", "ansi_term", @@ -163,7 +158,6 @@ dependencies = [ "deadpool", "derivative", "derive_more", - "dhat", "directories", "displaydoc", "flate2", @@ -188,7 +182,7 @@ dependencies = [ "maplit", "mediatype", "memchr", - "miette 5.4.1", + "miette 5.3.0", "mime", "mockall", "multimap", @@ -208,8 +202,6 @@ dependencies = [ "prost 0.9.0", "prost-types 0.9.0", "rand", - "redis", - "redis_cluster_async", "regex", "reqwest", "rhai", @@ -253,7 +245,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.3.0" +version = "1.2.1" dependencies = [ "apollo-router", "async-trait", @@ -269,7 +261,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.3.0" +version = "1.2.1" dependencies = [ "anyhow", "cargo-scaffold", @@ -283,9 +275,9 @@ dependencies = [ [[package]] name = "apollo-smith" -version = "0.2.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796458df9954e3f7ad451dd231d3d369296d349371878a31b9641470989bb112" +checksum = "d66fba27e21f40315a0e8abfd2998632b3d1670ae5a16d069c8ff652ea79992d" dependencies = [ "apollo-encoder", "apollo-parser", @@ -876,20 +868,6 @@ dependencies = [ "unreachable", ] -[[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util 0.7.4", -] - [[package]] name = "compose-your-graphql-router" version = "0.1.0" @@ -955,7 +933,6 @@ dependencies = [ "lazy_static", "libc", "terminal_size", - "unicode-width", "winapi 0.3.9", ] @@ -1079,12 +1056,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc16" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" - [[package]] name = "crc32fast" version = "1.3.2" @@ -1406,22 +1377,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dhat" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2aaf837aaf456f6706cb46386ba8dffd4013a757e36f4ea05c20dd46b209a3" -dependencies = [ - "backtrace", - "lazy_static", - "mintex", - "parking_lot 0.12.0", - "rustc-hash", - "serde", - "serde_json", - "thousands", -] - [[package]] name = "dialoguer" version = "0.6.2" @@ -1868,10 +1823,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1923,7 +1876,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" dependencies = [ - "combine 3.8.1", + "combine", "thiserror", ] @@ -2302,7 +2255,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" dependencies = [ - "console 0.15.2", + "console 0.12.0", "lazy_static", "number_prefix", "regex", @@ -2741,13 +2694,13 @@ dependencies = [ [[package]] name = "miette" -version = "5.4.1" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" +checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" dependencies = [ "atty", "backtrace", - "miette-derive 5.4.1", + "miette-derive 5.3.0", "once_cell", "owo-colors", "supports-color", @@ -2772,9 +2725,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.4.1" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" +checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" dependencies = [ "proc-macro2", "quote", @@ -2812,16 +2765,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mintex" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7c5ba1c3b5a23418d7bbf98c71c3d4946a0125002129231da8d6b723d559cb" -dependencies = [ - "once_cell", - "sys-info", -] - [[package]] name = "mio" version = "0.8.4" @@ -3058,9 +3001,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "oorandom" @@ -3803,43 +3746,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "redis" -version = "0.21.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571c252c68d09a2ad3e49edd14e9ee48932f3e0f27b06b4ea4c9b2a706d31103" -dependencies = [ - "async-trait", - "bytes", - "combine 4.6.6", - "crc16", - "futures-util", - "itoa 1.0.1", - "percent-encoding", - "pin-project-lite", - "rand", - "ryu", - "sha1", - "tokio", - "tokio-util 0.7.4", - "url", -] - -[[package]] -name = "redis_cluster_async" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2bda8e41b4abd38386c64fe61e3c2dda2df8cf2768d0b3a47ce060336f0fe0" -dependencies = [ - "crc16", - "futures", - "log", - "pin-project-lite", - "rand", - "redis", - "tokio", -] - [[package]] name = "redox_syscall" version = "0.2.13" @@ -3862,9 +3768,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -4529,21 +4435,6 @@ dependencies = [ "digest 0.10.5", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "sha2" version = "0.9.9" @@ -5018,12 +4909,6 @@ dependencies = [ "syn", ] -[[package]] -name = "thousands" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" - [[package]] name = "thread_local" version = "1.1.4" @@ -5659,6 +5544,10 @@ name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] [[package]] name = "uuid" @@ -5668,7 +5557,6 @@ checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom", "serde", - "wasm-bindgen", ] [[package]] @@ -5979,7 +5867,7 @@ dependencies = [ [[package]] name = "xtask" -version = "1.3.0" +version = "1.2.1" dependencies = [ "ansi_term", "anyhow", From 3e75c1363bf6942cd7964edd3eca9d80f221100e Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:57:28 -0500 Subject: [PATCH 31/32] actually updating cargo lockfile per xtask --- Cargo.lock | 1549 ++++++++++++++++++++++++++-------------------------- 1 file changed, 771 insertions(+), 778 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58fbedb18a..c24999c69a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,42 +50,42 @@ checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", - "serde", "version_check", ] [[package]] name = "ahash" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" +checksum = "464b3811b747f8f7ebc8849c9c728c39f6ac98a055edad93baf9eb330e3f8f9d" dependencies = [ "cfg-if", "getrandom", "once_cell", + "serde", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] [[package]] name = "alloc-no-stdlib" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] name = "alloc-stdlib" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" dependencies = [ "alloc-no-stdlib", ] @@ -107,36 +107,41 @@ checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "apollo-compiler" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619d54da02587ebced191b1000e3d8b31060cf7c77c5800c53d33d88faaeff30" +checksum = "8469cb8f7f42ad9b062e70f1148320e6cb7d727d2e87ca46635633ca6b2e6e4d" dependencies = [ "apollo-parser", "miette 4.7.1", "ordered-float 2.10.0", + "rowan", "salsa", "thiserror", - "uuid 0.8.2", + "uuid", ] [[package]] name = "apollo-encoder" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344a1afec31ce0273dc2061105b04e5c4ab620fe0748a76244338aa893db42f3" +checksum = "8b17d38f06e92256e9b0b271b878e20309822a587b2acfa234a60d36d92b6b43" +dependencies = [ + "apollo-parser", + "thiserror", +] [[package]] name = "apollo-parser" -version = "0.2.12" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f901785c93a542be795c2703370ddb5f84d4e38606357fc56fefa4b42ab25151" +checksum = "7a8f6cc3fa1313e045538ed2ce72ba916d52b501cd81e636a0bd5cdc703a0c73" dependencies = [ "rowan", ] [[package]] name = "apollo-router" -version = "1.2.1" +version = "1.3.0" dependencies = [ "access-json", "ansi_term", @@ -148,8 +153,8 @@ dependencies = [ "atty", "axum", "backtrace", - "base64 0.13.0", - "buildstructor 0.5.0", + "base64 0.13.1", + "buildstructor 0.5.1", "bytes", "clap 3.2.23", "console-subscriber", @@ -158,6 +163,7 @@ dependencies = [ "deadpool", "derivative", "derive_more", + "dhat", "directories", "displaydoc", "flate2", @@ -182,7 +188,7 @@ dependencies = [ "maplit", "mediatype", "memchr", - "miette 5.3.0", + "miette 5.4.1", "mime", "mockall", "multimap", @@ -202,6 +208,8 @@ dependencies = [ "prost 0.9.0", "prost-types 0.9.0", "rand", + "redis", + "redis_cluster_async", "regex", "reqwest", "rhai", @@ -212,7 +220,7 @@ dependencies = [ "serde_json_bytes", "serde_urlencoded", "serde_yaml", - "sha2 0.10.6", + "sha2", "shellexpand", "static_assertions", "sys-info", @@ -238,14 +246,14 @@ dependencies = [ "uname", "url", "urlencoding", - "uuid 1.2.1", + "uuid", "walkdir 2.3.2", "yaml-rust", ] [[package]] name = "apollo-router-benchmarks" -version = "1.2.1" +version = "1.3.0" dependencies = [ "apollo-router", "async-trait", @@ -261,7 +269,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.2.1" +version = "1.3.0" dependencies = [ "anyhow", "cargo-scaffold", @@ -275,9 +283,9 @@ dependencies = [ [[package]] name = "apollo-smith" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66fba27e21f40315a0e8abfd2998632b3d1670ae5a16d069c8ff652ea79992d" +checksum = "796458df9954e3f7ad451dd231d3d369296d349371878a31b9641470989bb112" dependencies = [ "apollo-encoder", "apollo-parser", @@ -287,9 +295,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.1.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0d87f4e4aaa9f3a00706edc7cbbeab0e3cc45ff1062b1160bc0204d6481ad4" +checksum = "29d47fbf90d5149a107494b15a7dc8d69b351be2db3bb9691740e88ec17fd880" dependencies = [ "derive_arbitrary", ] @@ -378,9 +386,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ "brotli", "flate2", @@ -413,9 +421,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -433,15 +441,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -450,9 +449,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.16" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e3356844c4d6a6d6467b8da2cffb4a2820be256f50a3a386c9d152bab31043" +checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" dependencies = [ "async-trait", "axum-core", @@ -463,7 +462,7 @@ dependencies = [ "http", "http-body", "hyper", - "itoa 1.0.1", + "itoa 1.0.4", "matchit", "memchr", "mime", @@ -482,9 +481,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" +checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" dependencies = [ "async-trait", "bytes", @@ -536,21 +535,27 @@ checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64ct" -version = "1.1.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b4d9b1225d28d360ec6a231d65af1fd99a2a095154c8040689617290569c5c" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + +[[package]] +name = "binstring" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0d60973d9320722cb1206f412740e162a33b8547ea8d6be75d7cff237c7a85" [[package]] name = "bit-set" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ "bit-vec", ] @@ -569,41 +574,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-buffer" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" -dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-padding" -version = "0.1.5" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -656,9 +631,9 @@ dependencies = [ [[package]] name = "buildstructor" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54027423064fb9ead112911b05eccb6484070f5ec778610906458603e0673381" +checksum = "32e1c120c6c832d6101eeb3170eeaeec6aca98759b59c37a1f78b3becfa482a5" dependencies = [ "lazy_static", "proc-macro2", @@ -671,21 +646,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" - -[[package]] -name = "byte-tools" -version = "0.3.1" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecount" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "byteorder" @@ -707,9 +676,9 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "camino" -version = "1.0.9" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" dependencies = [ "serde", ] @@ -748,24 +717,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abb7553d5b9b8421c6de7cb02606ff15e0c6eea7d8eadd75ef013fd636bec36" +checksum = "406c859255d568f4f742b3146d51851f3bfd49f734a2c289d9107c4395ee0062" dependencies = [ "camino", "cargo-platform", - "semver 1.0.7", + "semver 1.0.14", "serde", "serde_json", -] - -[[package]] -name = "cast" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", + "thiserror", ] [[package]] @@ -776,9 +737,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" dependencies = [ "jobserver", ] @@ -851,7 +812,7 @@ checksum = "454038500439e141804c655b4cd1bc6a70bcb95cd2bc9463af5661b6956f0e46" dependencies = [ "libc", "once_cell", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -868,6 +829,20 @@ dependencies = [ "unreachable", ] +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util 0.7.4", +] + [[package]] name = "compose-your-graphql-router" version = "0.1.0" @@ -882,9 +857,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" dependencies = [ "cache-padded", ] @@ -933,6 +908,7 @@ dependencies = [ "lazy_static", "libc", "terminal_size", + "unicode-width", "winapi 0.3.9", ] @@ -942,9 +918,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" dependencies = [ - "prost 0.11.0", - "prost-types 0.11.1", - "tonic 0.8.1", + "prost 0.11.2", + "prost-types 0.11.2", + "tonic 0.8.2", "tracing-core", ] @@ -960,13 +936,13 @@ dependencies = [ "futures", "hdrhistogram", "humantime", - "prost-types 0.11.1", + "prost-types 0.11.2", "serde", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic 0.8.1", + "tonic 0.8.2", "tracing", "tracing-core", "tracing-subscriber", @@ -974,15 +950,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" - -[[package]] -name = "const-oid" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" +checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" [[package]] name = "context-data" @@ -1049,13 +1019,19 @@ checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] +[[package]] +name = "crc16" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" + [[package]] name = "crc32fast" version = "1.3.2" @@ -1072,7 +1048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", - "cast 0.3.0", + "cast", "clap 2.34.0", "criterion-plot", "csv", @@ -1095,19 +1071,19 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ - "cast 0.2.7", + "cast", "itertools", ] [[package]] name = "crossbeam-channel" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1115,9 +1091,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -1126,46 +1102,33 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.9" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ - "autocfg 1.1.0", + "autocfg", "cfg-if", "crossbeam-utils", "memoffset", - "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "lazy_static", -] - -[[package]] -name = "crypto-bigint" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" -dependencies = [ - "generic-array 0.14.5", - "rand_core", - "subtle", ] [[package]] name = "crypto-bigint" -version = "0.3.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array 0.14.5", + "generic-array", "rand_core", "subtle", "zeroize", @@ -1173,24 +1136,14 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array", "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.5", - "subtle", -] - [[package]] name = "csv" version = "1.1.6" @@ -1221,9 +1174,9 @@ checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" [[package]] name = "ctor" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", @@ -1259,7 +1212,7 @@ dependencies = [ "hashbrown", "lock_api", "once_cell", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.4", "serde", ] @@ -1298,7 +1251,7 @@ dependencies = [ "libc", "log", "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "pin-project", "serde", "serde_json", @@ -1324,22 +1277,13 @@ dependencies = [ [[package]] name = "der" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" -dependencies = [ - "const-oid 0.6.2", - "crypto-bigint 0.2.11", -] - -[[package]] -name = "der" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" dependencies = [ - "const-oid 0.7.1", - "pem-rfc7468 0.3.1", + "const-oid", + "pem-rfc7468", + "zeroize", ] [[package]] @@ -1355,9 +1299,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.1.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d12f7983d7849dbd48d7754de36d4a5edc919806c8a54eba6281f6d7af4446fc" +checksum = "4903dff04948f22033ca30232ab8eca2c3fc4c913a8b6a34ee5199699814817f" dependencies = [ "proc-macro2", "quote", @@ -1377,6 +1321,22 @@ dependencies = [ "syn", ] +[[package]] +name = "dhat" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2aaf837aaf456f6706cb46386ba8dffd4013a757e36f4ea05c20dd46b209a3" +dependencies = [ + "backtrace", + "lazy_static", + "mintex", + "parking_lot 0.12.1", + "rustc-hash", + "serde", + "serde_json", + "thousands", +] + [[package]] name = "dialoguer" version = "0.6.2" @@ -1394,32 +1354,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.5", -] - [[package]] name = "digest" version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", + "const-oid", "crypto-common", + "subtle", ] [[package]] @@ -1470,17 +1414,17 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dyn-clone" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" [[package]] name = "ecdsa" -version = "0.13.4" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der 0.5.1", + "der", "elliptic-curve", "rfc6979", "signature", @@ -1488,9 +1432,9 @@ dependencies = [ [[package]] name = "ed25519-compact" -version = "1.0.11" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e1f30f0312ac83726c1197abeacd91c9557f8a623e904a009ae6bc529ae8d8" +checksum = "1f2d21333b679bbbac680b3eb45c86937e42f69277028f4e97b599b80b86c253" dependencies = [ "ct-codecs", "getrandom", @@ -1498,23 +1442,26 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" -version = "0.11.12" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ "base16ct", - "crypto-bigint 0.3.2", - "der 0.5.1", + "crypto-bigint", + "der", + "digest", "ff", - "generic-array 0.14.5", + "generic-array", "group", - "pem-rfc7468 0.3.1", + "hkdf", + "pem-rfc7468", + "pkcs8", "rand_core", "sec1", "subtle", @@ -1538,9 +1485,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", @@ -1551,30 +1498,24 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.3.20" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad132dd8d0d0b546348d7d86cb3191aad14b34e5f979781fc005c80d4ac67ffd" +checksum = "54558e0ba96fbe24280072642eceb9d7d442e32c7ec0ea9e7ecd7b4ea2cf4e11" dependencies = [ "serde", ] [[package]] name = "event-listener" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" - -[[package]] -name = "fake-simd" -version = "0.1.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fancy-regex" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95b4efe5be9104a4a18a9916e86654319895138be727b229820c39257c30dda" +checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" dependencies = [ "bit-set", "regex", @@ -1582,18 +1523,18 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] [[package]] name = "ff" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ "rand_core", "subtle", @@ -1601,21 +1542,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if", "libc", "redox_syscall", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] name = "fixedbitset" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" @@ -1657,6 +1598,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "forbid_anonymous_oeprations_rhai" +version = "0.1.0" +dependencies = [ + "anyhow", + "apollo-router", + "futures", + "http", + "serde_json", + "tokio", + "tower", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -1683,9 +1637,9 @@ dependencies = [ [[package]] name = "fraction" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb65943183b6b3cbf00f64c181e8178217e30194381b150e4f87ec59864c803" +checksum = "99df8100674344d1cee346c764684f7ad688a4dcaa1a3efb2fdb45daf9acf4f9" dependencies = [ "lazy_static", "num", @@ -1693,9 +1647,9 @@ dependencies = [ [[package]] name = "fragile" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d758e60b45e8d749c89c1b389ad8aee550f86aa12e2b9298b546dda7a82ab1" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fslock" @@ -1709,9 +1663,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -1724,9 +1678,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -1734,15 +1688,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -1752,15 +1706,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -1769,21 +1723,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -1799,18 +1753,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -1818,20 +1763,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "git2" @@ -1850,9 +1797,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ "aho-corasick", "bstr", @@ -1876,7 +1823,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" dependencies = [ - "combine", + "combine 3.8.1", "thiserror", ] @@ -1921,9 +1868,9 @@ dependencies = [ [[package]] name = "group" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff", "rand_core", @@ -1932,9 +1879,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -1957,9 +1904,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.0" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d113a9853e5accd30f43003560b5563ffbb007e3f325e8b103fa0d0029c6e6df" +checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd" dependencies = [ "log", "pest", @@ -1980,11 +1927,11 @@ dependencies = [ [[package]] name = "hdrhistogram" -version = "7.5.0" +version = "7.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31672b7011be2c4f7456c4ddbcb40e7e9a4a9fad8efe49a6ebaf5f307d0109c0" +checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "byteorder", "flate2", "nom", @@ -1993,18 +1940,18 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bitflags", "bytes", "headers-core", "http", "httpdate", "mime", - "sha-1 0.10.0", + "sha1 0.10.5", ] [[package]] @@ -2062,38 +2009,46 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "crypto-mac", - "digest 0.9.0", + "digest", ] [[package]] name = "hmac-sha1-compact" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d103cfecf6edf3f7d1dc7c5ab64e99488c0f8d11786e43b40873e66e8489d014" +checksum = "a76968b14b68737b664da5f9a31eb00af72f69a618a8ef2e2c8d30c494d28dae" [[package]] name = "hmac-sha256" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45e85b74de4f2610b0c832e3a532f3b64cddb5d8923923bc00d70206fb035f7" +checksum = "43ecbd4fb98b97457d10a29f8bdfee1fad612b6ce879b39d7b8dd6ce510875af" dependencies = [ - "digest 0.9.0", + "digest", ] [[package]] name = "hmac-sha512" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2ce076d8070f292037093a825343f6341fe0ce873268c2477e2f49abd57b10" +checksum = "f4d6b820c3093490ef1fb8253caa34feb83b0ab894c06c8c16c3c02cfaebc1eb" dependencies = [ - "digest 0.9.0", + "digest", ] [[package]] @@ -2104,7 +2059,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.1", + "itoa 1.0.4", ] [[package]] @@ -2126,9 +2081,9 @@ checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6330e8a36bd8c859f3fa6d9382911fbb7147ec39807f63b923933a247240b9ba" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -2160,9 +2115,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -2173,7 +2128,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.1", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -2191,10 +2146,10 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.20.4", + "rustls 0.20.7", "rustls-native-certs 0.6.2", "tokio", - "tokio-rustls 0.23.3", + "tokio-rustls 0.23.4", ] [[package]] @@ -2244,7 +2199,7 @@ version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ - "autocfg 1.1.0", + "autocfg", "hashbrown", "serde", ] @@ -2255,7 +2210,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" dependencies = [ - "console 0.12.0", + "console 0.15.2", "lazy_static", "number_prefix", "regex", @@ -2308,9 +2263,9 @@ dependencies = [ [[package]] name = "integer-encoding" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e85a1509a128c855368e135cffcde7eac17d8e1083f41e2b98c58bc1a5074be" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "introspector-gadget" @@ -2324,7 +2279,7 @@ dependencies = [ "humantime", "hyper", "reqwest", - "semver 1.0.7", + "semver 1.0.14", "serde", "serde_json", "thiserror", @@ -2333,9 +2288,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "is_ci" @@ -2345,9 +2300,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" [[package]] name = "iso8601" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a59a3f2be6271b2a844cd0dd13bf8ccc88a9540482d872c7ce58ab1c4db9fab" +checksum = "296af15e112ec6dc38c9fd3ae027b5337a75466e8eed757bd7d5cf742ea85eb6" dependencies = [ "nom", ] @@ -2369,24 +2324,24 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -2404,29 +2359,29 @@ dependencies = [ [[package]] name = "jsonschema" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebd40599e7f1230ce296f73b88c022b98ed66689f97eaa54bbeadc337a2ffa6" +checksum = "6ca9e2b45609132ae2214d50482c03aeee78826cd6fd53a8940915b81acedf16" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.1", "anyhow", - "base64 0.13.0", + "base64 0.13.1", "bytecount", "fancy-regex", "fraction", "iso8601", - "itoa 1.0.1", + "itoa 1.0.4", "lazy_static", "memchr", "num-cmp", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "percent-encoding", "regex", "serde", "serde_json", "time", "url", - "uuid 0.8.2", + "uuid", ] [[package]] @@ -2451,11 +2406,12 @@ dependencies = [ [[package]] name = "jwt-simple" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cf3a9f4c365a97b89e846cdb1c18dddbeafa692ebef1005cea26b8f04386e43" +checksum = "529a00f2d42d7dc349c994e65917c81bf53225831a65361f6c0454124c550f63" dependencies = [ "anyhow", + "binstring", "coarsetime", "ct-codecs", "ed25519-compact", @@ -2464,25 +2420,26 @@ dependencies = [ "hmac-sha512", "k256", "p256", + "p384", "rand", "rsa", "serde", "serde_json", + "spki", "thiserror", "zeroize", ] [[package]] name = "k256" -version = "0.10.4" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sec1", - "sha2 0.9.9", + "sha2", ] [[package]] @@ -2526,15 +2483,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.134" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libfuzzer-sys" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae185684fe19814afd066da15a7cc41e126886c21282934225d9fc847582da58" +checksum = "c8fff891139ee62800da71b7fd5b508d570b9ad95e614a53c6f453ca08366038" dependencies = [ "arbitrary", "cc", @@ -2557,9 +2514,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libssh2-sys" @@ -2598,11 +2555,11 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ - "autocfg 1.1.0", + "autocfg", "scopeguard", ] @@ -2653,9 +2610,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "mediatype" -version = "0.19.9" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90da6e15720cff55898a02a2ed6e9a21b152f0283a5ad89465f8d8f80c9750ca" +checksum = "6a280afd79e5a4c3e7f298c6139321aad0365690f24a57539e18590b5a606966" [[package]] name = "memchr" @@ -2669,7 +2626,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -2687,27 +2644,27 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.15.0", + "textwrap 0.15.2", "thiserror", "unicode-width", ] [[package]] name = "miette" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" +checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" dependencies = [ "atty", "backtrace", - "miette-derive 5.3.0", + "miette-derive 5.4.1", "once_cell", "owo-colors", "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.15.0", + "textwrap 0.15.2", "thiserror", "unicode-width", ] @@ -2725,9 +2682,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" +checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" dependencies = [ "proc-macro2", "quote", @@ -2758,30 +2715,40 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] +[[package]] +name = "mintex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7c5ba1c3b5a23418d7bbf98c71c3d4946a0125002129231da8d6b723d559cb" +dependencies = [ + "once_cell", + "sys-info", +] + [[package]] name = "mio" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "wasi", + "windows-sys 0.42.0", ] [[package]] name = "mockall" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2be9a9090bc1cac2930688fa9478092a64c6a92ddc6ae0692d46b37d9cab709" +checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" dependencies = [ "cfg-if", "downcast", @@ -2794,9 +2761,9 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d702a0530a0141cf4ed147cf5ec7be6f2c187d4e37fcbefc39cf34116bfe8f" +checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" dependencies = [ "cfg-if", "proc-macro2", @@ -2815,9 +2782,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -2865,9 +2832,9 @@ dependencies = [ [[package]] name = "num" -version = "0.2.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ "num-bigint", "num-complex", @@ -2879,22 +2846,21 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.2.6" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-bigint-dig" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4547ee5541c18742396ae2c895d0717d0f886d8823b8399cdaf7b07d63ad0480" +checksum = "566d173b2f9406afbc5510a90925d5a2cd80cae4605631f1212303df265de011" dependencies = [ - "autocfg 0.1.8", "byteorder", "lazy_static", "libm", @@ -2914,42 +2880,41 @@ checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" [[package]] name = "num-complex" -version = "0.2.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" dependencies = [ - "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-rational" -version = "0.2.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-bigint", "num-integer", "num-traits", @@ -2957,33 +2922,24 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ - "autocfg 1.1.0", + "autocfg", "libm", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", ] -[[package]] -name = "num_threads" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" -dependencies = [ - "libc", -] - [[package]] name = "number_prefix" version = "0.3.0" @@ -3001,9 +2957,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "oorandom" @@ -3024,32 +2980,32 @@ dependencies = [ "tower", ] -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "openssl" -version = "0.10.38" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", + "openssl-macros", "openssl-sys", ] +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" @@ -3058,11 +3014,11 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.72" +version = "0.9.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" dependencies = [ - "autocfg 1.1.0", + "autocfg", "cc", "libc", "pkg-config", @@ -3224,26 +3180,36 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" [[package]] name = "owo-colors" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e72e30578e0d0993c8ae20823dd9cff2bc5517d2f586a8aef462a581e8a03eb" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "p256" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19736d80675fbe9fe33426268150b951a3fb8f5cfca2a23a17c85ef3adb24e3b" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa", "elliptic-curve", - "sec1", - "sha2 0.9.9", + "sha2", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] @@ -3259,12 +3225,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.4", ] [[package]] @@ -3283,15 +3249,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3302,18 +3268,9 @@ checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pem-rfc7468" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e93a3b1cc0510b03020f33f21e62acdde3dcaef432edc95bea377fbd4c2cd4" -dependencies = [ - "base64ct", -] - -[[package]] -name = "pem-rfc7468" -version = "0.3.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" dependencies = [ "base64ct", ] @@ -3326,18 +3283,19 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.1.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "a528564cc62c19a7acac4d81e01f39e53e25e17b934878f4c6d25cc2836e62f8" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "d5fd9bc6500181952d34bd0b2b0163a54d794227b498be0b7afa7698d0a7b18f" dependencies = [ "pest", "pest_generator", @@ -3345,9 +3303,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "d2610d5ac5156217b4ff8e46ddcef7cdf44b273da2ac5bca2ecbfa86a330e7c4" dependencies = [ "pest", "pest_meta", @@ -3358,20 +3316,20 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "824749bf7e21dd66b36fbe26b3f45c713879cccd4a009a917ab8e045ca8246fe" dependencies = [ - "maplit", + "once_cell", "pest", - "sha-1 0.8.2", + "sha1 0.10.5", ] [[package]] name = "petgraph" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset", "indexmap", @@ -3381,18 +3339,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -3413,50 +3371,37 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs1" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c" -dependencies = [ - "der 0.4.5", - "pem-rfc7468 0.2.4", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.7.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" +checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" dependencies = [ - "der 0.4.5", - "pem-rfc7468 0.2.4", - "pkcs1", - "spki 0.4.1", + "der", + "pkcs8", + "spki", "zeroize", ] [[package]] name = "pkcs8" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der 0.5.1", - "spki 0.5.4", - "zeroize", + "der", + "spki", ] [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plotters" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -3467,30 +3412,30 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" +checksum = "ab68289ded120dcbf9d571afcf70163233229052aec9b08ab09532f698d0e1e6" dependencies = [ "difflib", "float-cmp", @@ -3502,15 +3447,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" +checksum = "a6e7125585d872860e9955ca571650b27a4979c5823084168c5ed5bbfb016b56" [[package]] name = "predicates-tree" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" +checksum = "ad3f7fa8d61e139cbc7c3edfebf3b6678883a53f5ffac65d1259329a93ee43a5" dependencies = [ "predicates-core", "termtree", @@ -3553,24 +3498,24 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cface98dfa6d645ea4c789839f176e4b072265d085bfcc48eaa8d137f58d3c39" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "protobuf", "thiserror", ] @@ -3603,12 +3548,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" dependencies = [ "bytes", - "prost-derive 0.11.0", + "prost-derive 0.11.2", ] [[package]] @@ -3646,9 +3591,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" dependencies = [ "anyhow", "itertools", @@ -3669,19 +3614,19 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" dependencies = [ "bytes", - "prost 0.11.0", + "prost 0.11.2", ] [[package]] name = "protobuf" -version = "2.27.1" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7e6d18738ecd0902d30d1ad232c9125985a3422929b16c65517b38adc14f96" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "quote" @@ -3715,20 +3660,20 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rayon" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ - "autocfg 1.1.0", + "autocfg", "crossbeam-deque", "either", "rayon-core", @@ -3736,9 +3681,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -3746,11 +3691,48 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "redis" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571c252c68d09a2ad3e49edd14e9ee48932f3e0f27b06b4ea4c9b2a706d31103" +dependencies = [ + "async-trait", + "bytes", + "combine 4.6.6", + "crc16", + "futures-util", + "itoa 1.0.4", + "percent-encoding", + "pin-project-lite", + "rand", + "ryu", + "sha1 0.6.1", + "tokio", + "tokio-util 0.7.4", + "url", +] + +[[package]] +name = "redis_cluster_async" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2bda8e41b4abd38386c64fe61e3c2dda2df8cf2768d0b3a47ce060336f0fe0" +dependencies = [ + "crc16", + "futures", + "log", + "pin-project-lite", + "rand", + "redis", + "tokio", +] + [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -3768,9 +3750,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -3788,9 +3770,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -3807,7 +3789,7 @@ version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -3826,7 +3808,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.20.4", + "rustls 0.20.7", "rustls-native-certs 0.6.2", "rustls-pemfile", "serde", @@ -3834,7 +3816,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.23.3", + "tokio-rustls 0.23.4", "tokio-util 0.7.4", "tower-service", "url", @@ -3847,17 +3829,17 @@ dependencies = [ [[package]] name = "retain_mut" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "rfc6979" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint 0.3.2", + "crypto-bigint", "hmac", "zeroize", ] @@ -3868,7 +3850,7 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6eec3a3db30f591ece18c66b3db4c9fa26f3bce20bc821c50550968361f84333" dependencies = [ - "ahash 0.8.0", + "ahash 0.8.1", "bitflags", "instant", "num-traits", @@ -3945,9 +3927,9 @@ dependencies = [ [[package]] name = "rhai_codegen" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a39bc2aa9258b282ee5518dac493491a9c4c11a6d7361b9d2644c922fc6488" +checksum = "36791b0b801159db25130fd46ac726d2751c070260bba3a4a0a3eeb6231bb82a" dependencies = [ "proc-macro2", "quote", @@ -4014,9 +3996,9 @@ dependencies = [ [[package]] name = "rowan" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88acf7b001007e9e8c989fe7449f6601d909e5dd2c56399fc158977ad6c56e8" +checksum = "5811547e7ba31e903fe48c8ceab10d40d70a101f3d15523c847cce91aa71f332" dependencies = [ "countme", "hashbrown", @@ -4027,20 +4009,21 @@ dependencies = [ [[package]] name = "rsa" -version = "0.5.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" +checksum = "b0ecc3307be66bfb3574577895555bacfb9a37a8d5cd959444b72ff02495c618" dependencies = [ "byteorder", - "digest 0.9.0", - "lazy_static", + "digest", "num-bigint-dig", "num-integer", "num-iter", "num-traits", "pkcs1", - "pkcs8 0.7.6", - "rand", + "pkcs8", + "rand_core", + "signature", + "smallvec", "subtle", "zeroize", ] @@ -4072,7 +4055,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.7", + "semver 1.0.14", ] [[package]] @@ -4081,7 +4064,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "log", "ring", "sct 0.6.1", @@ -4090,9 +4073,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -4126,24 +4109,24 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", ] [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "salsa" @@ -4185,19 +4168,19 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi 0.3.9", + "windows-sys 0.36.1", ] [[package]] name = "schemars" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1847b767a3d62d95cbf3d8a9f0e421cf57a0d8aa4f411d4b16525afb0284d4ed" +checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" dependencies = [ "dyn-clone", "schemars_derive", @@ -4208,9 +4191,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4d7e1b012cb3d9129567661a63755ea4b8a7386d339dc945ae187e403c6743" +checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" dependencies = [ "proc-macro2", "quote", @@ -4246,22 +4229,23 @@ dependencies = [ [[package]] name = "sec1" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "der 0.5.1", - "generic-array 0.14.5", - "pkcs8 0.8.0", + "base16ct", + "der", + "generic-array", + "pkcs8", "subtle", "zeroize", ] [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -4291,9 +4275,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.7" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] @@ -4352,7 +4336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "indexmap", - "itoa 1.0.1", + "itoa 1.0.4", "ryu", "serde", ] @@ -4382,7 +4366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.1", + "itoa 1.0.4", "ryu", "serde", ] @@ -4413,40 +4397,30 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.8.2" +name = "sha1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "sha1_smol", ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest", ] [[package]] -name = "sha2" -version = "0.9.9" +name = "sha1_smol" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" @@ -4456,7 +4430,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest", ] [[package]] @@ -4494,31 +4468,34 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "digest 0.9.0", + "digest", "rand_core", ] [[package]] name = "similar" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" +checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" dependencies = [ "serde", ] @@ -4529,7 +4506,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ - "autocfg 1.1.0", + "autocfg", "serde", "static_assertions", "version_check", @@ -4543,9 +4520,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi 0.3.9", @@ -4575,21 +4552,12 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spki" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" -dependencies = [ - "der 0.4.5", -] - -[[package]] -name = "spki" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der 0.5.1", + "der", ] [[package]] @@ -4655,9 +4623,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -4690,9 +4658,9 @@ dependencies = [ [[package]] name = "supports-color" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" dependencies = [ "atty", "is_ci", @@ -4718,9 +4686,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.98" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -4733,18 +4701,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - [[package]] name = "sys-info" version = "0.9.1" @@ -4810,9 +4766,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" [[package]] name = "test-log" @@ -4874,9 +4830,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" dependencies = [ "smawk", "unicode-linebreak", @@ -4909,6 +4865,12 @@ dependencies = [ "syn", ] +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + [[package]] name = "thread_local" version = "1.1.4" @@ -4942,20 +4904,29 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "libc", - "num_threads", + "serde", + "time-core", "time-macros", ] +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + [[package]] name = "time-macros" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] [[package]] name = "tinytemplate" @@ -4969,9 +4940,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -4988,13 +4959,13 @@ version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ - "autocfg 1.1.0", + "autocfg", "bytes", "libc", "memchr", "mio", "num_cpus", - "parking_lot 0.12.0", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -5015,9 +4986,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", @@ -5047,20 +5018,20 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.3" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.4", + "rustls 0.20.7", "tokio", "webpki 0.22.0", ] [[package]] name = "tokio-stream" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -5083,9 +5054,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ "bytes", "futures-core", @@ -5126,7 +5097,7 @@ checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" dependencies = [ "async-stream", "async-trait", - "base64 0.13.0", + "base64 0.13.1", "bytes", "futures-core", "futures-util", @@ -5143,7 +5114,7 @@ dependencies = [ "tokio", "tokio-rustls 0.22.0", "tokio-stream", - "tokio-util 0.6.9", + "tokio-util 0.6.10", "tower", "tower-layer", "tower-service", @@ -5153,14 +5124,14 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd56bdb54ef93935a6a79dbd1d91f1ebd4c64150fd61654031fd6b8b775c91" +checksum = "55b9af819e54b8f33d453655bef9b9acc171568fb49523078d0cc4e7484200ec" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.0", + "base64 0.13.1", "bytes", "futures-core", "futures-util", @@ -5171,8 +5142,8 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.11.0", - "prost-derive 0.11.0", + "prost 0.11.2", + "prost-derive 0.11.2", "tokio", "tokio-stream", "tokio-util 0.7.4", @@ -5241,9 +5212,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -5280,9 +5251,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.20" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -5313,9 +5284,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", "log", @@ -5381,9 +5352,9 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4801dca35e4e2cee957c469bd4a1c370fadb7894c0d50721a40eba3523e6e91c" +checksum = "744324b12d69a9fc1edea4b38b7b1311295b662d161ad5deac17bb1358224a08" dependencies = [ "lazy_static", "quote", @@ -5436,9 +5407,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uname" @@ -5460,51 +5431,46 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ + "hashbrown", "regex", ] [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.2" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unreachable" @@ -5539,16 +5505,6 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde", -] - [[package]] name = "uuid" version = "1.2.1" @@ -5557,6 +5513,7 @@ checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom", "serde", + "wasm-bindgen", ] [[package]] @@ -5633,12 +5590,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5647,9 +5598,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5657,13 +5608,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -5672,9 +5623,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -5684,9 +5635,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5694,9 +5645,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -5707,15 +5658,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -5743,22 +5694,22 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" dependencies = [ "webpki 0.22.0", ] [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -5810,43 +5761,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.10.1" @@ -5858,20 +5866,20 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" dependencies = [ "libc", ] [[package]] name = "xtask" -version = "1.2.1" +version = "1.3.0" dependencies = [ "ansi_term", "anyhow", - "base64 0.13.0", + "base64 0.13.1", "camino", "cargo_metadata", "flate2", @@ -5880,7 +5888,7 @@ dependencies = [ "reqwest", "serde_json", "serde_json_traversal", - "sha2 0.10.6", + "sha2", "structopt", "tar", "tempfile", @@ -5899,30 +5907,15 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.3.2" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" [[package]] name = "zip" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "byteorder", "crc32fast", From eb321c59a004905a5610dc09c3de0a0370d9681d Mon Sep 17 00:00:00 2001 From: Lucas Leadbetter <5595530+lleadbet@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:48:10 -0500 Subject: [PATCH 32/32] adding updated insta --- ...nfiguration__tests__schema_generation.snap | 92 +++++++++++++++---- 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap index 9baa50d72a..8a249cfcc5 100644 --- a/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap +++ b/apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap @@ -679,10 +679,21 @@ expression: "&schema" "format": "double" }, { - "type": "string", - "enum": [ - "always_on", - "always_off" + "oneOf": [ + { + "description": "Always sample", + "type": "string", + "enum": [ + "always_on" + ] + }, + { + "description": "Never sample", + "type": "string", + "enum": [ + "always_off" + ] + } ] } ], @@ -1958,10 +1969,21 @@ expression: "&schema" "format": "double" }, { - "type": "string", - "enum": [ - "always_on", - "always_off" + "oneOf": [ + { + "description": "Always sample", + "type": "string", + "enum": [ + "always_on" + ] + }, + { + "description": "Never sample", + "type": "string", + "enum": [ + "always_off" + ] + } ] } ], @@ -2028,11 +2050,28 @@ expression: "&schema" "properties": { "compression": { "description": "Enable compression for subgraphs (available compressions are deflate, br, gzip)", - "type": "string", - "enum": [ - "gzip", - "deflate", - "br" + "oneOf": [ + { + "description": "gzip", + "type": "string", + "enum": [ + "gzip" + ] + }, + { + "description": "deflate", + "type": "string", + "enum": [ + "deflate" + ] + }, + { + "description": "brotli", + "type": "string", + "enum": [ + "br" + ] + } ], "nullable": true }, @@ -2120,11 +2159,28 @@ expression: "&schema" "properties": { "compression": { "description": "Enable compression for subgraphs (available compressions are deflate, br, gzip)", - "type": "string", - "enum": [ - "gzip", - "deflate", - "br" + "oneOf": [ + { + "description": "gzip", + "type": "string", + "enum": [ + "gzip" + ] + }, + { + "description": "deflate", + "type": "string", + "enum": [ + "deflate" + ] + }, + { + "description": "brotli", + "type": "string", + "enum": [ + "br" + ] + } ], "nullable": true },