diff --git a/.circleci/config.yml b/.circleci/config.yml index f81a9dfc8a7..eb3ed281750 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2.1 # across projects. See https://circleci.com/orbs/ for more information. orbs: gh: circleci/github-cli@2.2.0 - slack: circleci/slack@4.12.1 + slack: circleci/slack@4.12.5 executors: amd_linux_build: &amd_linux_build_executor @@ -21,8 +21,8 @@ executors: amd_linux_test: &amd_linux_test_executor docker: - image: cimg/base:stable - - image: cimg/redis:7.0.9 - - image: jaegertracing/all-in-one:1.42.0 + - image: cimg/redis:7.0.11 + - image: jaegertracing/all-in-one:1.45.0 resource_class: xlarge environment: CARGO_BUILD_JOBS: 4 diff --git a/.github/workflows/update_uplink_schema.yml b/.github/workflows/update_uplink_schema.yml new file mode 100644 index 00000000000..20a7560c0b2 --- /dev/null +++ b/.github/workflows/update_uplink_schema.yml @@ -0,0 +1,33 @@ +name: Update Uplink Schema +run-name: ${{ github.actor }} is updating the Uplink schema 🚀 +on: + workflow_dispatch: + schedule: + # On the 5 of every hour + - cron: '5 * * * *' +jobs: + Update-Uplink-Schema: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rover + run: | + curl -sSL https://rover.apollo.dev/nix/v0.14.1 | sh + echo "$HOME/.rover/bin" >> $GITHUB_PATH + - name: Make changes to pull request + run: | + rover graph introspect https://uplink.api.apollographql.com/ | perl -pe 'chomp if eof' > ./apollo-router/src/uplink/uplink.graphql + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Update Uplink schema + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + branch: create-pull-request/uplink-schema-updates + add-paths: | + apollo-router/src/uplink/uplink.graphql + delete-branch: true + title: 'chore: Update Uplink schema' + body: | + This updates the copy of `uplink.graphql` which this repository relies on with the latest copy fetched via `rover graph introspect`. diff --git a/CHANGELOG.md b/CHANGELOG.md index 576e37112c8..54417acba8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,166 @@ 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.20.0] - 2023-05-31 + +## 🚀 Features + +### Configurable histogram buckets for metrics ([Issue #2333](https://github.com/apollographql/router/issues/2333)) + +It is now possible to change the default bucketing for histograms generated for metrics: + +```yaml title="router.yaml" +telemetry: + metrics: + common: + buckets: + - 0.05 + - 0.10 + - 0.25 + - 0.50 + - 1.00 + - 2.50 + - 5.00 + - 10.00 + - 20.00 +``` + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/3098 + +## 🐛 Fixes + +### Federation v2.4.7 ([Issue #3170](https://github.com/apollographql/router/issues/3170), [Issue #3133](https://github.com/apollographql/router/issues/3133)) + +This release bumps the Router's Federation support from v2.4.7 to v2.4.7, which brings in notable query planner fixes from [v2.4.7](https://github.com/apollographql/federation/releases/tag/%40apollo%2Fquery-planner%402.4.7). Of note from those releases, this brings query planner fixes that (per that dependency's changelog): + +- Re-work the code use to try to reuse query named fragments to improve performance (thus sometimes improving query ([#2604](https://github.com/apollographql/federation/pull/2604)) planning performance) +- Fix a raised assertion error (again, with a message of form like `Cannot add selection of field X to selection set of parent type Y`). +- Fix a rare issue where an `interface` or `union` field was not being queried for all the types it should be. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3185 + +### Set the global allocator in the library crate, not just the executable ([Issue #3126](https://github.com/apollographql/router/issues/3126)) + +In 1.19, Apollo Router [switched to use `jemalloc` as the global Rust allocator on Linux](https://github.com/apollographql/router/blob/dev/CHANGELOG.md#improve-memory-fragmentation-and-resource-consumption-by-switching-to-jemalloc-as-the-memory-allocator-on-linux-pr-2882) to reduce memory fragmentation. However, prior to this change this was only occurring in the executable binary provided by the `apollo-router` crate and [custom binaries](https://www.apollographql.com/docs/router/customizations/custom-binary) using the crate _as a library_ were not getting this benefit. + +The `apollo-router` library crate now sets the global allocator so that custom binaries also take advantage of this by default. If some other choice is desired, the `global-allocator` Cargo [feature flag](https://doc.rust-lang.org/cargo/reference/features.html) can be disabled in `Cargo.toml` with: + +```toml +[dependencies] +apollo-router = {version = "[…]", default-features = false} +``` + +Library crates that depend on `apollo-router` (if any) should also do this in order to leave the choice to the eventual executable. (Cargo default features are only disabled if *all* dependents specify `default-features = false`.) + +By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/3157 + +### Add `ca-certificates` to our Docker image ([Issue #3173](https://github.com/apollographql/router/issues/3173)) + +We removed `curl` from our Docker images to improve security, which meant that our implicit install of `ca-certificates` (as a dependency of `curl`) was no longer performed. + +This fix reinstates the `ca-certificates` package explicitly, which is required for the router to be able to process TLS requests. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/3174 + +### Helm: Running of `helm test` no longer fails + +Running `helm test` was generating an error since `wget` was sending a request without a proper body and expecting an HTTP status response of 2xx. Without the proper body, it expectedly resulted in an HTTP status of 400. By switching to using `netcat` (or `nc`) we will now check that the port is up and use that to determine that the router is functional. + +By [@bbardawilwiser](https://github.com/bbardawilwiser) in https://github.com/apollographql/router/pull/3096 + +### Move `curl` dependency to separate layer in Docker image ([Issue #3144](https://github.com/apollographql/router/issues/3144)) + +We've moved `curl` out of the Docker image we publish. The `curl` command is only used in the image we produce today for the sake of downloading dependencies. It is never used after that, but we can move it to a separate layer to further remove it from the image. + +By [@abernix](https://github.com/abernix) in https://github.com/apollographql/router/pull/3146 + +## 🛠 Maintenance + +### Improve `cargo-about` license checking ([Issue #3176](https://github.com/apollographql/router/issues/3176)) + +From the description of this [cargo about PR](https://github.com/EmbarkStudios/cargo-about/pull/216), it is possible for `NOASSERTION` identifiers to be added when gathering license information, causing license checks to fail. This change uses the new `cargo-about` configuration `filter-noassertion` to eliminate the problem. + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/3178 + + + +# [1.19.1] - 2023-05-26 + +## 🐛 Fixes + +### Fix router coprocessor deferred response buffering and change JSON body type from Object to String ([Issue #3015](https://github.com/apollographql/router/issues/3015)) + +The current implementation of the `RouterResponse` processing for coprocessors forces buffering of response data before passing the data to a coprocessor. This is a bug, because deferred responses should be processed progressively with a stream of calls to the coprocessor as each chunk of data becomes available. + +Furthermore, the data type was assumed to be valid JSON for both `RouterRequest` and `RouterResponse` coprocessor processing. This is also a bug, because data at this stage of processing was never necessarily valid JSON. This is a particular issue when dealing with deferred (when using `@defer`) `RouterResponses`. + +This change fixes both of these bugs by modifying the router so that coprocessors are invoked with a `body` payload which is a JSON `String`, not a JSON `Object`. Furthermore, the router now processes each chunk of response data separately so that a coprocessor will receive multiple calls (once for each chunk) for a deferred response. + +For more details about how this works see the [coprocessor documentation](https://www.apollographql.com/docs/router/customizations/coprocessor/). + +By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/3104 + +### Experimental: Query plan cache keys now include a hash of the query and operation name ([Issue #2998](https://github.com/apollographql/router/issues/2998)) + +> **Note** +> This feature is still _experimental_ and not recommended under normal use nor is it validated that caching query plans in a distributed fashion will result in improved performance. + +The experimental feature for caching query plans in a distributed store (e.g., Redis) will now create a SHA-256 hash of the query and operation name and include that hash in the cache key, rather than using the operation document as it was previously. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3101 + +### Federation v2.4.6 ([Issue #3133](https://github.com/apollographql/router/issues/3133)) + +This release bumps the Router's Federation support from v2.4.5 to v2.4.6, which brings in notable query planner fixes from [v2.4.6](https://github.com/apollographql/federation/releases/tag/%40apollo%2Fquery-planner%402.4.6). Of note from those releases, this brings query planner fixes that (per that dependency's changelog): + +- Fix assertion error in some overlapping fragment cases. In some cases, when fragments overlaps on some sub-selections ([apollographql/federation#2594](https://github.com/apollographql/federation/pull/2594)) and some interface field implementation relied on sub-typing, an assertion error could be raised with a message of the form `Cannot add selection of field X to selection set of parent type Y` and this fixes this problem. + +- Fix possible fragment-related assertion error during query planning. This prevents a rare case where an assertion with a ([apollographql/federation#2596](https://github.com/apollographql/federation/pull/2596)) message of the form `Cannot add fragment of condition X (runtimes: ...) to parent type Y (runtimes: ...)` could fail during query planning. + +In addition, the packaging includes dependency updates for `bytes`, `regex`, `once_cell`, `tokio`, and `uuid`. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3135 + +### Error redaction for subgraphs now respects _disabling_ it + +This follows-up on the new ability to selectively disable Studio-bound error redaction which was released in https://github.com/apollographql/router/pull/3011 by fixing a bug which was preventing users from _disabling_ that behavior on subgraphs. Redaction continues to be on by default and both the default behavior and the explicit `redact: true` option were behaving correctly. + +With this fix, the `tracing.apollo.errors.subgraph.all.redact` option set to `false` will now transmit the un-redacted error message to Studio. + +By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/3137 + +### Evaluate multiple keys matching a JWT criteria ([Issue #3017](https://github.com/apollographql/router/issues/3017)) + +In some cases, multiple keys could match what a JWT asks for (both the algorithm, `alg`, and optional key identifier, `kid`). Previously, we scored each possible match and only took the one with the highest score. But even then, we could have multiple keys with the same score (e.g., colliding `kid` between multiple JWKS in tests). + +The improved behavior will: + +- Return a list of those matching `key` instead of the one with the highest score. +- Try them one by one until the JWT is validated, or return an error. +- If some keys were found with the highest possible score (matching `alg`, with `kid` present and matching, too), then we only test those keys. + +By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/3031 + +## 🛠 Maintenance + +### chore(deps): `xtask/` dependency updates ([PR #3149](https://github.com/apollographql/router/pull/3149)) + +This is effectively running `cargo update` in the `xtask/` directory (our directory of tooling; not runtime components) to bring things more up to date. + +This changeset takes extra care to update `chrono`'s features to remove the `time` dependency which is impacted by [CVE-2020-26235](https://nvd.nist.gov/vuln/detail/CVE-2020-26235), resolving a moderate severity which was appearing in scans. Again, this is not a runtime dependency and there was no actual/known impact to any users. + +By [@abernix](https://github.com/abernix) in https://github.com/apollographql/router/pull/3149 + +### Improve testability of the `state_machine` in integration tests + +We have introduced a `TestRouterHttpServer` for writing more fine-grained integration tests in the Router core for the behaviors of the state machine. + +By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollographql/router/pull/3099 + # [1.19.0] - 2023-05-19 > **Note** -> This release focused a notable amount of effort on improving both CPU usage and memory utilization/fragmentization. Our testing and pre-release feedback has been overwhelmingly positive. 🙌 +> This release focused a notable amount of effort on improving both CPU usage and memory utilization/fragmentization. Our testing and pre-release feedback has been overwhelmingly positive. 🙌 ## 🚀 Features @@ -29,9 +185,9 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p ## 🐛 Fixes -### Prevent span attributes from being formatted to write logs +### Prevent span attributes from being formatted to write logs -We do not show span attributes in our logs, but the log formatter still spends time formatting them to a string, even when there will be no logs written for the trace. This adds the `NullFieldFormatter` that entirely avoids formatting the attributes to improve performance. +We do not show span attributes in our logs, but the log formatter still spends time formatting them to a string, even when there will be no logs written for the trace. This adds the `NullFieldFormatter` that entirely avoids formatting the attributes to improve performance. By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/2890 @@ -41,7 +197,7 @@ This release bumps the Router's Federation support from v2.4.2 to v2.4.5, which - Improves the heuristics used to try to reuse the query named fragments in subgraph fetches. Said fragment will be reused ([apollographql/federation#2541](https://github.com/apollographql/federation/pull/2541)) more often, which can lead to smaller subgraph queries (and hence overall faster processing). - Fix potential assertion error during query planning in some multi-field `@requires` case. This error could be triggered ([#2575](https://github.com/apollographql/federation/pull/2575)) when a field in a `@requires` depended on another field that was also part of that same requires (for instance, if a field has a `@requires(fields: "id otherField")` and that `id` is also a key necessary to reach the subgraph providing `otherField`). - + The assertion error thrown in that case contained the message `Root groups (...) should have no remaining groups unhandled (...)` By [@abernix](https://github.com/abernix) in https://github.com/apollographql/router/pull/3107 @@ -65,7 +221,7 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p If you were using local schema or config then previously the Router was performing blocking IO in an async thread. This could have caused stalls to serving requests. The Router now uses async IO for all config and schema reloads. -Fixing the above surfaced an issue with the experimental `force_hot_reload` feature introduced for testing. This has also been fixed and renamed to `force_reload`. +Fixing the above surfaced an issue with the experimental `force_hot_reload` feature introduced for testing. This has also been fixed and renamed to `force_reload`. ```diff experimental_chaos: @@ -99,7 +255,7 @@ Adds an integration test that iterates over `./examples` looking for `.yaml` fil By [@EverlastingBugstopper](https://github.com/EverlastingBugstopper) in https://github.com/apollographql/router/pull/3097 -### Improve memory fragmentation and resource consumption by switching to `jemalloc` as the memory allocator on Linux ([PR #2882](https://github.com/apollographql/router/pull/2882)) +### Improve memory fragmentation and resource consumption by switching to `jemalloc` as the memory allocator on Linux ([PR #2882](https://github.com/apollographql/router/pull/2882)) Detailed memory investigation revealed significant memory fragmentation when using the default allocator, `glibc`, on Linux. Performance testing and flame-graph analysis suggested that using `jemalloc` on Linux would yield notable performance improvements. In our tests, this figure shows performance to be about 35% faster than the default allocator, on account of spending less time managing memory fragmentation. diff --git a/Cargo.lock b/Cargo.lock index 0480847d2df..ce4d5061816 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,6 +119,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -151,49 +160,58 @@ dependencies = [ [[package]] name = "anstream" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ "anstyle", "anstyle-parse", + "anstyle-query", "anstyle-wincon", - "concolor-override", - "concolor-query", + "colorchoice", "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "0.3.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" [[package]] name = "anstyle-parse" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" dependencies = [ "utf8parse", ] +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "anstyle-wincon" -version = "0.2.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "apollo-ariadne" @@ -212,7 +230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adfb4c7364494ca41e3fec600b6a4570320db83ae0aa938ca70036632bb9365e" dependencies = [ "apollo-ariadne", - "apollo-parser 0.5.1", + "apollo-parser 0.5.3", "indexmap", "ordered-float 2.10.0", "rowan", @@ -221,16 +239,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "apollo-encoder" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b17d38f06e92256e9b0b271b878e20309822a587b2acfa234a60d36d92b6b43" -dependencies = [ - "apollo-parser 0.3.2", - "thiserror", -] - [[package]] name = "apollo-encoder" version = "0.4.0" @@ -241,15 +249,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "apollo-parser" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640c8fb7f9ab98a78a8086bb413d8ecf3ee44849976e1636e27265f09e9e544" -dependencies = [ - "rowan", -] - [[package]] name = "apollo-parser" version = "0.4.1" @@ -262,9 +261,9 @@ dependencies = [ [[package]] name = "apollo-parser" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cee3beb80302b36d9d1d3d2feaf3d4a47a4da18d8a4088e71948989a494999" +checksum = "ec05c087cc9d21576b18337d9dbaadc87cea1b33c4f2b8d59e735ed90e880984" dependencies = [ "rowan", "thiserror", @@ -272,12 +271,12 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.19.0" +version = "1.20.0" dependencies = [ "access-json", "anyhow", "apollo-compiler", - "apollo-parser 0.5.1", + "apollo-parser 0.5.3", "arc-swap", "askama", "async-compression", @@ -290,7 +289,7 @@ dependencies = [ "buildstructor 0.5.2", "bytes", "ci_info", - "clap 4.2.1", + "clap 4.3.0", "console-subscriber", "dashmap", "derivative", @@ -313,7 +312,7 @@ dependencies = [ "humantime 2.1.0", "humantime-serde", "hyper", - "hyper-rustls", + "hyper-rustls 0.23.2", "indexmap", "insta", "introspector-gadget", @@ -361,7 +360,7 @@ dependencies = [ "router-bridge", "rstack", "rust-embed", - "rustls", + "rustls 0.20.8", "rustls-pemfile", "schemars", "serde", @@ -381,13 +380,13 @@ dependencies = [ "thiserror", "tikv-jemallocator", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-stream", "tokio-util", - "tonic", + "tonic 0.8.3", "tonic-build", "tower", - "tower-http 0.3.5", + "tower-http", "tower-service", "tower-test", "tracing", @@ -410,7 +409,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.19.0" +version = "1.20.0" dependencies = [ "apollo-parser 0.4.1", "apollo-router", @@ -426,11 +425,11 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.19.0" +version = "1.20.0" dependencies = [ "anyhow", "cargo-scaffold", - "clap 4.2.1", + "clap 4.3.0", "copy_dir", "regex", "str_inflector", @@ -444,7 +443,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b4ab369b6c748e8e1ea87733a7f98d8e8671bf848cd8a8290308d5b0f90299b" dependencies = [ - "apollo-encoder 0.4.0", + "apollo-encoder", "apollo-parser 0.4.1", "arbitrary", "once_cell", @@ -629,9 +628,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.9" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6137c6234afb339e75e764c866e3594900f0211e1315d33779f269bbe2ec6967" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" dependencies = [ "async-trait", "axum-core", @@ -656,16 +655,15 @@ dependencies = [ "sync_wrapper", "tokio", "tower", - "tower-http 0.4.0", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -890,9 +888,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bytes-utils" @@ -1046,9 +1044,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" dependencies = [ "clap_builder", "clap_derive", @@ -1057,22 +1055,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" dependencies = [ "anstream", "anstyle", "bitflags", - "clap_lex 0.4.1", + "clap_lex 0.5.0", "strsim 0.10.0", ] [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -1091,9 +1089,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "combine" @@ -1122,21 +1126,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "concolor-override" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" - -[[package]] -name = "concolor-query" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" -dependencies = [ - "windows-sys 0.45.0", -] - [[package]] name = "concurrent-queue" version = "2.1.0" @@ -1195,21 +1184,21 @@ dependencies = [ [[package]] name = "console-api" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" +checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" dependencies = [ "prost", "prost-types", - "tonic", + "tonic 0.9.2", "tracing-core", ] [[package]] name = "console-subscriber" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a3a81dfaf6b66bce5d159eddae701e3a002f194d378cbf7be5f053c281d9be" +checksum = "57ab2224a0311582eb03adba4caaf18644f7b1f10a760803a803b9b605187fc7" dependencies = [ "console-api", "crossbeam-channel", @@ -1223,7 +1212,7 @@ dependencies = [ "thread_local", "tokio", "tokio-stream", - "tonic", + "tonic 0.9.2", "tracing", "tracing-core", "tracing-subscriber", @@ -1555,18 +1544,18 @@ checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" [[package]] name = "deno_console" -version = "0.89.0" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cda6cf4635c2261951074023288f23756ac6852e7e63a6bd416a88f0e98c52e" +checksum = "1ce6d5caccaac26056182333e915d28b3b5b332b199dd12ab3467590cbda0039" dependencies = [ "deno_core", ] [[package]] name = "deno_core" -version = "0.171.0" +version = "0.187.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc41944f05dfeacfc2610e91f40ddcf246f3aeeac8ae4c26df46bfbf01a3902" +checksum = "922ed10fa6019414f58095894140e77479662833a62c568b023226e8be103e93" dependencies = [ "anyhow", "bytes", @@ -1583,15 +1572,16 @@ dependencies = [ "serde_v8", "smallvec", "sourcemap", + "tokio", "url", "v8", ] [[package]] name = "deno_crypto" -version = "0.103.0" +version = "0.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e2a590be03f643d1147e12e8bc2fb04671b9bd68da9c8857d7d0b11a0255c" +checksum = "9603a2705c5cce5995b98b8fecb743c1fa59d4907b50955160d67e3f5ab6c23e" dependencies = [ "aes", "aes-gcm", @@ -1626,10 +1616,11 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.49.0" +version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4740bc5738ad07dc1f523a232a4079a995fa2ad11efd71e09e8e32bf28f21ee1" +checksum = "47d3fbb72196f1880ff7a2824e4f3e111f6601b78f38e715ae3d3d412d9e0a42" dependencies = [ + "lazy-regex", "once_cell", "pmutil", "proc-macro-crate", @@ -1641,9 +1632,9 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.89.0" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fe82b011d8b2af63c4587551536d951f47ffc3ba2a710e455b383d4f4b06ba" +checksum = "8e3451bf3b98d028a4f61fae2bba1d58aad1ba790cfe0d14a0b11cd17623f1ee" dependencies = [ "deno_core", "serde", @@ -1653,9 +1644,9 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.120.0" +version = "0.136.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7379502a7a333f573949558803e8bfe2e8fba3ef180cdbb4a882951803c87d20" +checksum = "08198c3ae53f5b722907ebde32d340c6f9223fa347689619cb5d500ee9a176bd" dependencies = [ "async-trait", "base64-simd", @@ -1665,13 +1656,14 @@ dependencies = [ "serde", "tokio", "uuid", + "windows-sys 0.48.0", ] [[package]] name = "deno_webidl" -version = "0.89.0" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d046c6ac75f22be851219f44824c42927345f51e0ae5fb825e8bf8ea658d8ee8" +checksum = "3d2c11261edf0f1459f6b7dab67db6241af2c74b1e764d117c607aa649aea338" dependencies = [ "deno_core", ] @@ -2188,9 +2180,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fred" -version = "6.0.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52d60e6d9b2a715da13ec520d7da6e095121e25da5027cdac56b8f96684654b" +checksum = "7e02c21b098d77b0e99fe0054ebd3e7c9f81bffb42aa843021415ffa793124a6" dependencies = [ "arc-swap", "arcstr", @@ -2206,12 +2198,13 @@ dependencies = [ "pretty_env_logger", "rand 0.8.5", "redis-protocol", - "rustls", + "rustls 0.21.1", "rustls-native-certs", + "rustls-webpki", "semver 1.0.17", "sha-1", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", "tokio-stream", "tokio-util", "url", @@ -2455,7 +2448,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "bstr 1.4.0", "fnv", "log", @@ -2799,9 +2792,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -2830,10 +2823,23 @@ dependencies = [ "http", "hyper", "log", - "rustls", + "rustls 0.20.8", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +dependencies = [ + "http", + "hyper", + "rustls 0.21.1", + "tokio", + "tokio-rustls 0.24.0", ] [[package]] @@ -2956,11 +2962,11 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "introspector-gadget" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9360a9dd04f347bf40cbb128bf622d4ef524fb89aee8cff836b88471d4f14dd" +checksum = "7d8b71efbbc9b5600183f9a46ca29062e56db6424e4b185cac3a042e9bfa87e8" dependencies = [ - "apollo-encoder 0.3.4", + "apollo-encoder", "backoff", "graphql_client", "hyper", @@ -3152,6 +3158,29 @@ dependencies = [ "libc", ] +[[package]] +name = "lazy-regex" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff63c423c68ea6814b7da9e88ce585f793c87ddd9e78f646970891769c8235d4" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8edfc11b8f56ce85e207e62ea21557cfa09bb24a8f6b04ae181b086ff8611c22" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -3163,9 +3192,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.141" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libfuzzer-sys" @@ -3353,9 +3382,9 @@ dependencies = [ [[package]] name = "miette" -version = "5.7.0" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abdc09c381c9336b9f2e9bd6067a9a5290d20e2d2e2296f275456121c33ae89" +checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" dependencies = [ "backtrace", "backtrace-ext", @@ -3374,9 +3403,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.7.0" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8842972f23939443013dfd3720f46772b743e86f1a81d120d4b6fb090f87de1c" +checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", @@ -3517,9 +3546,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "notify" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" dependencies = [ "bitflags", "filetime", @@ -3528,7 +3557,7 @@ dependencies = [ "libc", "mio", "walkdir 2.3.3", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3573,6 +3602,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "rand 0.8.5", ] [[package]] @@ -3677,9 +3707,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "oorandom" @@ -3815,7 +3845,7 @@ dependencies = [ "reqwest", "thiserror", "tokio", - "tonic", + "tonic 0.8.3", ] [[package]] @@ -3839,7 +3869,7 @@ dependencies = [ "futures-util", "opentelemetry", "prost", - "tonic", + "tonic 0.8.3", "tonic-build", ] @@ -4399,9 +4429,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -4431,9 +4461,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", @@ -4444,9 +4474,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ "prost", ] @@ -4644,13 +4674,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.1", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -4659,7 +4689,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] @@ -4668,11 +4698,17 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + [[package]] name = "reqwest" -version = "0.11.16" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "base64 0.21.0", "bytes", @@ -4683,7 +4719,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.0", "ipnet", "js-sys", "log", @@ -4691,14 +4727,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.1", "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", "tokio-util", "tower-service", "url", @@ -4729,9 +4765,9 @@ dependencies = [ [[package]] name = "rhai" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd29fa1f740be6dc91982013957e08c3c4232d7efcfe19e12da87d50bad47758" +checksum = "b2c99b27f6661b4d217b6aa21727c6a0808729266edfc8a8877042d609b1904e" dependencies = [ "ahash 0.8.3", "bitflags", @@ -4842,9 +4878,9 @@ dependencies = [ [[package]] name = "router-bridge" -version = "0.2.4+v2.4.5" +version = "0.2.6+v2.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd4da971fb256903c3f1eecd56f8ad862f4a82853d94f53759c8908f5862d222" +checksum = "bbcd2822ebb7b954f2444eb6691d1e4eb354cf276eb4f6dfbe59216819859623" dependencies = [ "anyhow", "async-channel", @@ -5015,6 +5051,18 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + [[package]] name = "rustls-native-certs" version = "0.6.2" @@ -5036,6 +5084,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -5196,9 +5254,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] @@ -5214,9 +5272,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", @@ -5236,9 +5294,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "indexmap", "itoa", @@ -5248,9 +5306,9 @@ dependencies = [ [[package]] name = "serde_json_bytes" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07cc85f924551185aa24952d5bf52c8433ffd040eeeff3908bb684c55035002" +checksum = "46deda3f831d90694634ede6f2f9b956bec326a67499333c7fc3943832d06050" dependencies = [ "bytes", "indexmap", @@ -5303,15 +5361,17 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.82.0" +version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060fd38f18c420e82ab21592ec1f088b39bccb6897b1dda394d63628e22158d" +checksum = "ac09be069e49932c7c1df9b25c9e76ecb235e2127530462885926431c00d05f3" dependencies = [ "bytes", "derive_more", + "num-bigint", "serde", "serde_bytes", "smallvec", + "thiserror", "v8", ] @@ -5968,14 +6028,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.2" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -5984,7 +6043,7 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -5999,13 +6058,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.13", ] [[package]] @@ -6014,16 +6073,26 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +dependencies = [ + "rustls 0.21.1", + "tokio", +] + [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -6046,9 +6115,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -6111,7 +6180,7 @@ dependencies = [ "rustls-native-certs", "rustls-pemfile", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-stream", "tokio-util", "tower", @@ -6121,6 +6190,34 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum", + "base64 0.21.0", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tonic-build" version = "0.8.4" @@ -6177,25 +6274,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1d42a9b3f3ec46ba828e8d376aec14592ea199f70a06a548587ecd1c4ab658" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -6593,23 +6671,24 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.1.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ "getrandom 0.2.8", "serde", + "wasm-bindgen", ] [[package]] name = "v8" -version = "0.60.1" +version = "0.71.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd5b3ed559897ff02c0f62bc0a5f300bfe79bb4c77a50031b8df771701c628" +checksum = "1a4bbfd886a9c2f87170438c0cdb6b1ddbfe80412ab591c83d24c7e48e487313" dependencies = [ "bitflags", "fslock", - "lazy_static", + "once_cell", "which", ] diff --git a/Cargo.toml b/Cargo.toml index 3fe0e63b799..3df068499c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,8 +41,8 @@ incremental = false inherits = "release" debug = 1 +[patch.crates-io] # TODO: to delete -# [patch.crates-io] # opentelemetry = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "e5ef3552efab2bdbf2f838023c37461cd799ab2c"} # opentelemetry-http = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "e5ef3552efab2bdbf2f838023c37461cd799ab2c"} # opentelemetry-jaeger = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "e5ef3552efab2bdbf2f838023c37461cd799ab2c"} diff --git a/RELEASE_CHECKLIST.md b/RELEASE_CHECKLIST.md index b5ee0d7669d..4c585698fc1 100644 --- a/RELEASE_CHECKLIST.md +++ b/RELEASE_CHECKLIST.md @@ -42,61 +42,246 @@ This is a list of the things that need to happen during a release. Build a Release --------------- -### Prepare the Changelog (Full release only) - -If you are releasing a beta or a release candidate, no official changelog is -needed, but you're not off the hook! You'll need to write testing instructions -in lieu of an official changelog. - -1. Open the associated GitHub milestone for the release. All issues and PRs should be closed. If - they are not you should reassign all open issues and PRs to future - milestones. -2. Go through the commit history since the last release. Ensure that all PRs - that have landed are marked with the milestone. You can use this to - show all the PRs that are merged on or after YYYY-MM-DD: - `https://github.com/issues?utf8=%E2%9C%93&q=repo%3Aapollographql%2Frouter+merged%3A%3E%3DYYYY-MM-DD` -3. Go through the closed PRs in the milestone. Each should have a changelog - label indicating if the change is documentation, feature, fix, or - maintenance. If there is a missing label, please add one. If it is a - breaking change, also add a BREAKING label. -4. Set the release date in `NEXT_CHANGELOG.md`. Add this release to the - `CHANGELOG.md`. Use the structure of previous entries. - -### Start a release PR +Most of this will be executing some simple commands but here's a high level understanding and some terminology. There will be a total of 3 pull-requests involved: + +- **a Release PR**: this will merge **into `main`**. It will be a real merge commit and it **should NOT be squashed**. +- **a Release _Prep_ PR**: this will merge into the release PR _above_. It **SHOULD be squashed**. +- **Reconciliation PR**: a PR that merges `main` back into `dev`. It will be a real merge commit and it **should NOT be squashed**. + +The examples below will use [the GitHub CLI (`gh`)](https://cli.github.com/) to simplify the steps. We can automate it further in the future, but feels like the right level of abstraction right now. + +A release can be cut from any branch, but we assume you'll be doing it from `dev`. If you're just doing a release candidate, you can skip merging it back into `main`. 1. Make sure you have `cargo` installed on your machine and in your `PATH`. -2. Create a new branch "#.#.#" where "#.#.#" is this release's version - (release) or "#.#.#-rc.#" (release candidate) -3. Update the `version` in `*/Cargo.toml` (do not forget the ones in scaffold templates). -4. Update the `apollo-router` Git tags in the `dependencies` sections of the `Cargo.toml` files in `apollo-router-scaffold/templates/**`. -5. Update the `PACKAGE_VERSION` value in `scripts/install.sh` (it should be prefixed with `v`!) -6. Update `docker.mdx` and `kubernetes.mdx` with the release version. -7. Update `helm/chart/router/Chart.yaml` as follows: - - update the version and the appVersion to the release version. e.g.: `appVersion: "v0.9.0"` -8 Update `helm/chart/router/README.md` by running this from the repo root: `(cd helm/chart && helm-docs router)`. - (If not installed, you should [install `helm-docs`](https://github.com/norwoodj/helm-docs)) -9. Update the kubernetes section of the docs: - - go to the `helm/chart/router` folder - - run - ```helm template --set router.configuration.telemetry.metrics.prometheus.enabled=true --set managedFederation.apiKey="REDACTED" --set managedFederation.graphRef="REDACTED" --debug .``` - - Paste the output in the `Kubernetes Configuration` example of the `docs/source/containerization/kubernetes.mdx` file -9. Update `federation-version-support.mdx` with the latest version info. Use https://github.com/apollographql/version_matrix to generate the version matrix. -10. Update the `image` of the Docker image within `docker-compose*.yml` files inside the `dockerfiles` directory. -11. Update the license list with `cargo xtask licenses`. - (If not installed, you can install `cargo-about` by running `cargo install cargo-about`.) -12. Add a new section in `CHANGELOG.md` with the contents of `NEXT_CHANGELOG.md` -13. Put a Release date and the version number on the new `CHANGELOG.md` section -14. Update the version in `NEXT_CHANGELOG.md`. -15. Clear `NEXT_CHANGELOG.md` leaving only the template. -16. Run `cargo check` so the lock file gets updated. -17. Run `cargo xtask check-compliance`. -18. Push up a commit with all the changes. The commit message should be "release: v#.#.#" or "release: v#.#.#-rc.#" -19. Request review from the Router team. - -### Review - -Most review comments will be about the changelog. Once the PR is finalized and -approved: +2. Pick the version number you are going to release. This project uses [Semantic Versioning 2.0.0](https://semver.org/), so analyze the existing changes in the `.changesets/` directory to pick the right next version. (e.g., If there are `feat_` changes, it must be a minor version bump. If there are `breaking_` changes, it must be a _major_ version bump). **Do not release a major version without explicit agreement from core team members**. +3. Checkout the branch you want to cut from. Typically, this is `dev`, but you could do this from another branch as well. + + ``` + git checkout dev + ``` + +4. We'll set some environment variables for steps that follow this, to simplify copy and pasting. Be sure to customize these for your own conditions, and **set the version you picked in the above step** as `APOLLO_ROUTER_RELEASE_VERSION`: + + ``` + APOLLO_ROUTER_RELEASE_VERSION=#.#.# + APOLLO_ROUTER_RELEASE_GIT_ORIGIN=origin + APOLLO_ROUTER_RELEASE_GITHUB_REPO=apollographql/router + ``` + +5. Make sure you have the latest from the remote before releasing, ensuring you're using the right remote! + + ``` + git pull "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" + ``` + +6. Create a new branch `#.#.#`. (The `#.#.#` values should be this release's version, and it is perfectly acceptable to use prerelease semantics, e.g., a branch named `1.5.3-rc.9`). To do this using the environment variable we just set, we'll just run the following from the same terminal: + + ``` + git checkout -b "${APOLLO_ROUTER_RELEASE_VERSION}" + ``` +7. Push this new branch to the appropriate remote. We will open a PR for it **later**, but this will be the **base** for the PR created in the next step). (And `--set-upstream` will of course track this locally. This is commonly abbreviated as `-u`.) + + ``` + git push --set-upstream "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" "${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +8. Create _another_ new branch called `prep-#.#.#` off of `#.#.#`. This branch will be used for bumping version numbers and getting review on the changelog. We'll do this using the same environment variable, so you can just run: + + ``` + git checkout -b "prep-${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +9. On this new `prep-#.#.#` branch, run the release automation script using this command to use the environment variable set previously: + + > **Note** + > For this command, `GITHUB_TOKEN` is **not used**, but it is still _required_ at the moment, so it's set here to `prep`. This is a bug in the releasing script that needs to be changed. + + ``` + cargo xtask release prepare $APOLLO_ROUTER_RELEASE_VERSION + ``` + + Running this command will: + + - Bump the necessary versions to the version specified, including those in the documentation. + - Migrate the current set of `/.changesets/*.md` files into `/CHANGELOG.md` using the version specified. + - Run our compliance checks and update the `licenses.html` file as appropriate. + - Ensure we're not using any incompatible licenses in the release. + +10. **MANUALLY CHECK AND UPDATE** the `federation-version-support.mdx` to make sure it shows the version of Federation which is included in the `router-bridge` that ships with this version of Router. This can be obtained by looking at the version of `router-bridge` in `apollo-router/Cargo.toml` and taking the number after the `+` (e.g., `router-bridge@0.2.0+v2.4.3` means Federation v2.4.3). + +11. Now, review and stage he changes produced by the previous step. This is most safely done using the `--patch` (or `-p`) flag to `git add` (`-u` ignores untracked files). + + ``` + git add -up . + ``` + +12. Now commit those changes locally, using a brief message: + + ``` + git commit -m "prep release: v${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +13. (Optional) Make local edits to the newly rendered `CHANGELOG.md` entries to do some initial editoral. + + These things should typically be resolved earlier in the review process, but need to be double checked: + + - There are no breaking changes. + - Entries are in categories (e.g., Fixes vs Features) that make sense. + - Titles stand alone and work without their descriptions. + - You don't need to read the title for the description to make sense. + - Grammar is good. (Or great! But don't let perfect be the enemy of good.) + - Formatting looks nice when rendered as markdown and follows common convention. + +14. Now push the branch up to the correct remote: + + ``` + git push --set-upstream "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" "prep-${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +15. Programatically create a small temporary file called `this_release.md` with the changelog details of _precisely this release_ from the `CHANGELOG.md`: + + > Note: This file could totally be created by the `xtask` if we merely decide convention for it and whether we want it checked in or not. It will be used again later in process and, in theory, by CI. Definitely not suggesting this should live on as regex. + + ``` + perl -0777 \ + -sne 'print "$1\n" if m{ + (?:\#\s # Look for H1 Markdown (line starting with "# ") + \[v?\Q$version\E\] # ...followed by [$version] (optionally with a "v") + # since some versions had that in the past. + \s.*?\n$) # ... then "space" until the end of the line. + \s* # Ignore PRE-entry-whitespace + (.*?) # Capture the ACTUAL body of the release. But do it + # in a non-greedy way, leading us to stop when we + # reach the next version boundary/heading. + \s* # Ignore POST-entry-whitespace + (?=^\#\s\[[^\]]+\]\s) # Once again, look for a version boundary. This is + # the same bit at the start, just on one line. + }msx' -- \ + -version="${APOLLO_ROUTER_RELEASE_VERSION}" \ + CHANGELOG.md > this_release.md + ``` + +16. Now, run this command to generate the header and the PR and keep them in an environment variable: + + ``` + apollo_prep_release_header="$( + cat < **Note** + > + > When approved, this PR will merge into **the \`${APOLLO_ROUTER_RELEASE_VERSION}\` branch** which will — upon being approved itself — merge into \`main\`. + > + > **Things to review in this PR**: + > - Changelog correctness (There is a preview below, but it is not necessarily the most up to date. See the _Files Changed_ for the true reality.) + > - Version bumps + > - That it targets the right release branch (\`${APOLLO_ROUTER_RELEASE_VERSION}\` in this case!). + > + --- + EOM + )" + apollo_prep_release_notes="$(cat ./this_release.md)" + ``` + +17. Use the `gh` CLI to create the PR, using the previously-set environment variables: + + ``` + echo "${apollo_prep_release_header}\n${apollo_prep_release_notes}" | gh --repo "${APOLLO_ROUTER_RELEASE_GITHUB_REPO}" pr create -B "${APOLLO_ROUTER_RELEASE_VERSION}" --title "prep release: v${APOLLO_ROUTER_RELEASE_VERSION}" --body-file - + ``` + +18. Use the `gh` CLI to enable **auto-squash** (**_NOT_** auto-**_merge_**) on the PR you just opened: + + ``` + gh --repo "${APOLLO_ROUTER_RELEASE_GITHUB_REPO}" pr merge --squash --body "" -t "prep release: v${APOLLO_ROUTER_RELEASE_VERSION}" --auto "prep-${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +19. 🗣️ **Solicit feedback from the Router team on the prep PR** + + Once approved, the PR will squash-merge itself into the next branch. + +20. After the PR has auto-merged, change your local branch back to the _non-_prep branch, pull any changes you (or others) may have added on GitHub : + + ``` + git checkout "${APOLLO_ROUTER_RELEASE_VERSION}" && \ + git pull "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" + ``` + +20. Now, from your local final release branch, open the PR from the branch the prep PR already merged into: + + ``` + apollo_release_pr_header="$( + cat < **Note** + > **This particular PR should be true-merged to \`main\`.** + + This PR represents the merge to \`main\` of the v${APOLLO_ROUTER_RELEASE_VERSION} release. + + This PR is **primarily a merge commit**, so reviewing every individual commit shown below is **not necessary** since those have been reviewed in their own PR. + + **However!** Some things to review on this PR: + + - Does this PR target the right branch? (usually, \`main\`) + - Are the appropriate **version bumps** and **release note edits** in the end of the commit list (or within the last few commits). In other words, "Did the 'release prep' PR actually land on this branch?" + + If those things look good, this PR is good to merge. + EOM + )" + echo "${apollo_release_pr_header}" | gh --repo "${APOLLO_ROUTER_RELEASE_GITHUB_REPO}" pr create -B "main" --title "release: v${APOLLO_ROUTER_RELEASE_VERSION}" --body-file - + ``` + +21. Use the `gh` CLI to enable **auto-merge** (**_NOT_** auto-**_squash_**): + + ``` + gh --repo "${APOLLO_ROUTER_RELEASE_GITHUB_REPO}" pr merge --merge --body "" -t "release: v${APOLLO_ROUTER_RELEASE_VERSION}" --auto "${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +22. 🗣️ **Solicit approval from the Router team, wait for the PR to pass CI and auto-merge into `main`** + +23. After the PR has merged to `main`, pull `main` to your local terminal, and Git tag & push the release: + + This process will kick off the bulk of the release process on CircleCI, including building each architecture on its own infrastructure and notarizing the macOS binary. + + ``` + git checkout main && \ + git pull "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" && \ + git tag -a "v${APOLLO_ROUTER_RELEASE_VERSION}" -m "${APOLLO_ROUTER_RELEASE_VERSION}" && \ + git push "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" "v${APOLLO_ROUTER_RELEASE_VERSION}" + ``` + +24. Open a PR that reconciles `dev` (Make sure to merge this reconciliation PR back to dev, do not squash or rebase): + + ``` + gh --repo "${APOLLO_ROUTER_RELEASE_GITHUB_REPO}" pr create --title "Reconcile \`dev\` after merge to \`main\` for v${APOLLO_ROUTER_RELEASE_VERSION}" -B dev -H main --body "Follow-up to the v${APOLLO_ROUTER_RELEASE_VERSION} being officially released, bringing version bumps and changelog updates into the \`dev\` branch." + ``` + +25. 👀 Follow along with the process by [going to CircleCI for the repository](https://app.circleci.com/pipelines/github/apollographql/router) and clicking on `release` for the Git tag that appears at the top of the list. **Wait for `publish_github_release` to finish on this job before continuing.** + +26. After the CI job has finished for the tag, re-run the `perl` command from Step 15, which will regenerate the `this_release.md` with changes that happened in the release review. + +27. Change the links from `[@username](https://github.com/username)` to `@username` (TODO: Write more `perl` here. 😄) + + This ensures that contribution credit is clearly displayed using the user avatars on the GitHub Releases page when the notes are published in the next step. + +28. Update the release notes on the now-published [GitHub Releases](https://github.com/apollographql/router/releases) (this needs to be moved to CI, but requires `this_release.md` which we created earlier): + + ``` + gh release edit v"${APOLLO_ROUTER_RELEASE_VERSION}" -F ./this_release.md + ``` + +29. Publish the Crate from your local computer from the `main` branch (this also needs to be moved to CI, but requires changing the release containers to be Rust-enabled and to restore the caches): + + ``` + cargo publish -p apollo-router + ``` + +30. (Optional) To have a "social banner" for this release, run [this `htmlq` command](https://crates.io/crates/htmlq) (`cargo install htmlq`, or on MacOS `brew install htmlq`; its `jq` for HTML), open the link it produces, copy the image to your clipboard: + + ``` + curl -s "https://github.com/apollographql/router/releases/tag/v${APOLLO_ROUTER_RELEASE_VERSION}" | htmlq 'meta[property="og:image"]' --attribute content + ``` + +### prep PR Review + +Most review comments for the prep PR will be about the changelog. Once the prep PR is finalized and approved: 1. Always use `Squash and Merge` GitHub button. diff --git a/about.toml b/about.toml index 7facbe8b8ff..dbd148a7a40 100644 --- a/about.toml +++ b/about.toml @@ -12,6 +12,9 @@ accepted = [ "Unicode-DFS-2016" ] +# See https://github.com/EmbarkStudios/cargo-about/pull/216 +filter-noassertion = true + # Ignore non plublished crates, such as xtask for example private = { ignore = true } # Ignore dependencies used in tests only, test-log for example diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index adfbbe51473..fa8fa5e18dc 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.19.0" +version = "1.20.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" @@ -20,7 +20,7 @@ tower = "0.4" [build-dependencies] apollo-smith = { version = "0.3.2", features = ["parser-impl"] } apollo-parser = "0.4.1" -arbitrary = "1.2.3" +arbitrary = "1.3.0" [[bench]] name = "basic_composition" diff --git a/apollo-router-scaffold/Cargo.toml b/apollo-router-scaffold/Cargo.toml index d79f396f29b..bd35941ead0 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "apollo-router-scaffold" -version = "1.19.0" +version = "1.20.0" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" publish = false [dependencies] -anyhow = "1.0.68" -clap = { version = "4.1.4", features = ["derive"] } +anyhow = "1.0.71" +clap = { version = "4.3.0", features = ["derive"] } cargo-scaffold = { version = "0.8.9", default-features = false } regex = "1" str_inflector = "0.12.0" toml = "0.5.11" [dev-dependencies] -tempfile = "3.3.0" +tempfile = "3.5.0" copy_dir = "0.1.2" diff --git a/apollo-router-scaffold/templates/base/Cargo.toml b/apollo-router-scaffold/templates/base/Cargo.toml index 81b6ea80d22..d30d3ae4c0e 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.19.0" +apollo-router = "1.20.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 d38b0491382..bf7074212d5 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.19.0" } +apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.20.0" } {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 3a14d358d35..60b5f3b10a4 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.19.0" +version = "1.20.0" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://docs.rs/apollo-router" @@ -17,21 +17,34 @@ name = "router" path = "src/main.rs" [features] +default = ["global-allocator"] + +# Set the Rust global allocator on some platforms +# https://doc.rust-lang.org/std/alloc/index.html#the-global_allocator-attribute +# Enabled by default. Disable default features in library crates or to set it yourself: +# ``` +# [dependencies] +# apollo-router = {version = "1.20", default-features = false} +# ``` +global-allocator = [] + # 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. failfast = [] + # Enables usage of tokio-console with the router # tokio-console also requires at build time the environment variable # RUSTFLAGS="--cfg tokio_unstable" console = ["tokio/tracing", "console-subscriber"] + # "fake" feature to disable V8 usage when building on docs.rs # See https://github.com/apollographql/federation-rs/pull/185 docs_rs = ["router-bridge/docs_rs"] -default = [] [package.metadata.docs.rs] features = ["docs_rs"] @@ -39,9 +52,9 @@ features = ["docs_rs"] [dependencies] askama = "0.11.1" access-json = "0.1.0" -anyhow = "1.0.68" +anyhow = "1.0.71" apollo-compiler = "0.8.0" -apollo-parser = "0.5.1" +apollo-parser = "0.5.3" arc-swap = "1.6.0" async-compression = { version = "0.3.15", features = [ "tokio", @@ -49,20 +62,20 @@ async-compression = { version = "0.3.15", features = [ "gzip", "deflate", ] } -async-trait = "0.1.67" +async-trait = "0.1.68" atty = "0.2.14" -axum = { version = "0.6.6", features = ["headers", "json", "original-uri"] } +axum = { version = "0.6.18", features = ["headers", "json", "original-uri"] } backtrace = "0.3.67" base64 = "0.20.0" buildstructor = "0.5.2" -bytes = "1.2.1" -clap = { version = "4.1.4", default-features = false, features = [ +bytes = "1.4.0" +clap = { version = "4.3.0", default-features = false, features = [ "env", "derive", "std", "help", ] } -console-subscriber = { version = "0.1.8", optional = true } +console-subscriber = { version = "0.1.9", optional = true } ci_info = {version="0.14.10", features=["serde-1"] } dashmap = { version = "5.4.0", features = ["serde"] } derivative = "2.2.0" @@ -75,8 +88,8 @@ diff = "0.1.13" directories = "4.0.1" displaydoc = "0.2" flate2 = "1.0.24" -fred = { version = "6.0.0", features = ["enable-rustls", "no-client-setname"] } -futures = { version = "0.3.27", features = ["thread-pool"] } +fred = { version = "6.3.0", features = ["enable-rustls", "no-client-setname"] } +futures = { version = "0.3.28", features = ["thread-pool"] } graphql_client = "0.11.0" hex = "0.4.3" http = "0.2.9" @@ -84,27 +97,27 @@ http-body = "0.4.5" heck = "0.4.1" humantime = "2.1.0" humantime-serde = "1.1.1" -hyper = { version = "0.14.25", features = ["server", "client"] } +hyper = { version = "0.14.26", features = ["server", "client"] } hyper-rustls = { version = "0.23.2", features = ["http1", "http2"] } -indexmap = { version = "1.9.2", features = ["serde-1"] } +indexmap = { version = "1.9.3", features = ["serde-1"] } itertools = "0.10.5" jsonpath_lib = "0.3.0" jsonschema = { version = "0.16.1", default-features = false } -jsonwebtoken = "8.2.0" +jsonwebtoken = "8.3.0" lazy_static = "1.4.0" -libc = "0.2.140" +libc = "0.2.144" linkme = "0.3.9" lru = "0.8.1" mediatype = "0.19.13" -mockall = "0.11.3" -miette = { version = "5.5.0", features = ["fancy"] } +mockall = "0.11.4" +miette = { version = "5.9.0", features = ["fancy"] } mime = "0.3.17" -multer = "2.0.4" +multer = "2.1.0" multimap = "0.8.3" # To avoid tokio issues -notify = { version = "5.1.0", default-features = false, features=["macos_kqueue"] } +notify = { version = "5.2.0", default-features = false, features=["macos_kqueue"] } nu-ansi-term = "0.47" -once_cell = "1.16.0" +once_cell = "1.17.2" # Any package that starts with `opentelemetry` needs to be updated with care # because it is tightly intertwined with the `tracing` packages on account of @@ -142,40 +155,40 @@ opentelemetry-zipkin = { version = "0.16.0", default-features = false, features "reqwest-rustls", ] } opentelemetry-prometheus = "0.11.0" -paste = "1.0.11" +paste = "1.0.12" pin-project-lite = "0.2.9" prometheus = "0.13" -prost = "0.11.8" -prost-types = "0.11.8" +prost = "0.11.9" +prost-types = "0.11.9" proteus = "0.5.0" rand = "0.8.5" -rhai = { version = "1.12.0", features = ["sync", "serde", "internals"] } -regex = "1.6.0" -reqwest = { version = "0.11.15", default-features = false, features = [ +rhai = { version = "1.14.0", features = ["sync", "serde", "internals"] } +regex = "1.8.3" +reqwest = { version = "0.11.18", default-features = false, features = [ "rustls-tls", "rustls-native-certs", "json", "stream", ] } -router-bridge = "=0.2.4+v2.4.5" -rust-embed="6.4.2" +router-bridge = "0.2.6+v2.4.7" +rust-embed="6.6.1" rustls = "0.20.8" rustls-pemfile = "1.0.2" schemars = { version = "0.8.12", features = ["url"] } -shellexpand = "3.0.0" +shellexpand = "3.1.0" sha2 = "0.10.6" -serde = { version = "1.0.149", features = ["derive", "rc"] } -serde_json_bytes = { version = "0.2.0", features = ["preserve_order"] } -serde_json = { version = "1.0.85", features = ["preserve_order"] } +serde = { version = "1.0.163", features = ["derive", "rc"] } +serde_json_bytes = { version = "0.2.1", features = ["preserve_order"] } +serde_json = { version = "1.0.96", features = ["preserve_order"] } serde_urlencoded = "0.7.1" serde_yaml = "0.8.26" static_assertions = "1.1.0" strum_macros = "0.24.3" sys-info = "0.9.1" -thiserror = "1.0.38" -tokio = { version = "1.24.2", features = ["full"] } -tokio-stream = { version = "0.1.12", features = ["sync", "net"] } -tokio-util = { version = "0.7.7", features = ["net", "codec", "time"] } +thiserror = "1.0.40" +tokio = { version = "1.28.2", features = ["full"] } +tokio-stream = { version = "0.1.14", features = ["sync", "net"] } +tokio-util = { version = "0.7.8", features = ["net", "codec", "time"] } tonic = { version = "0.8.3", features = ["transport", "tls", "tls-roots", "gzip"] } tower = { version = "0.4.13", features = ["full"] } tower-http = { version = "0.3.5", features = [ @@ -198,7 +211,7 @@ tracing-opentelemetry = "0.18.0" tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] } url = { version = "2.3.1", features = ["serde"] } urlencoding = "2.1.2" -uuid = { version = "1.1.2", features = ["serde", "v4"] } +uuid = { version = "1.3.3", features = ["serde", "v4"] } yaml-rust = "0.4.5" wsl = "0.1.0" tokio-rustls = "0.23.4" @@ -220,23 +233,23 @@ tikv-jemallocator = "0.5" [dev-dependencies] ecdsa = { version = "0.15.1", features = ["signing", "pem", "pkcs8"] } -fred = "6.0.0-beta.2" -redis = { version = "0.21.7", features = ["tokio-comp"] } -futures-test = "0.3.27" -insta = { version = "1.26.0", features = ["json", "redactions", "yaml"] } -introspector-gadget = "0.2.0" +fred = { version = "6.3.0", features = ["enable-rustls", "no-client-setname"] } +futures-test = "0.3.28" +insta = { version = "1.29.0", features = ["json", "redactions", "yaml"] } +introspector-gadget = "0.2.1" maplit = "1.0.2" memchr = { version = "2.5.0", default-features = false } -mockall = "0.11.3" -once_cell = "1.16.0" +mockall = "0.11.4" +once_cell = "1.17.2" p256 = "0.12.0" rand_core = "0.6.4" -reqwest = { version = "0.11.15", default-features = false, features = [ +redis = { version = "0.21.7", features = ["tokio-comp"] } +reqwest = { version = "0.11.18", default-features = false, features = [ "json", "stream", ] } similar-asserts = "1.4.2" -tempfile = "3.4.0" +tempfile = "3.5.0" test-log = { version = "0.2.11", default-features = false, features = [ "trace", ] } @@ -250,8 +263,8 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [ "fmt", ] } tracing-test = "0.2.2" -walkdir = "2.3.2" -wiremock = "0.5.17" +walkdir = "2.3.3" +wiremock = "0.5.18" [target.'cfg(target_os = "linux")'.dev-dependencies] rstack = { version = "0.3.3", features = ["dw"], default-features = false } @@ -265,3 +278,6 @@ tonic-build = "0.8.4" name = "integration_tests" path = "tests/integration_tests.rs" +[[bench]] +name = "huge_requests" +harness = false diff --git a/apollo-router/benches/huge_requests.rs b/apollo-router/benches/huge_requests.rs new file mode 100644 index 00000000000..78f47c3bb41 --- /dev/null +++ b/apollo-router/benches/huge_requests.rs @@ -0,0 +1,185 @@ +use std::time::Duration; + +use futures::stream::StreamExt; +use tokio::io::AsyncBufReadExt; +use tokio::process::Command; + +// chosen by fair dice roll. guaranteed to be random. https://xkcd.com/221/ +const SUBGRAPH_PORT: u16 = 10141; // hard-coded in huge_requests/supergraph.graphql + +const SUPERGRAPH_PORT: u16 = 10142; // hard-coded in huge_requests/router.yaml + +const VERBOSE: bool = false; + +#[tokio::main] +async fn main() { + println!("Columns:"); + println!("* Size of a String variable in an otherwise small GraphQL request"); + println!("* End-to-end time"); + println!("* Peak RSS (including heaptrack overhead) of a fresh Router process"); + println!(); + for (display, value) in [ + (" 1K", 1_000), + (" 10K", 10_000), + ("100K", 100_000), + (" 1M", 1_000_000), + (" 10M", 10_000_000), + ("100M", 100_000_000), + (" 1G", 1_000_000_000), + ] { + print!("{display} "); + one_request(value).await; + // Work around "error creating server listener: Address already in use (os error 98)" + tokio::time::sleep(std::time::Duration::from_millis(100)).await; + } +} + +async fn one_request(string_variable_bytes: usize) { + let _shutdown_on_drop = spawn_subgraph().await; + + let heaptrack_output = tempfile::NamedTempFile::new().unwrap(); + let heaptrack_output_path = heaptrack_output.path().as_os_str().to_str().unwrap(); + let router_exe = env!("CARGO_BIN_EXE_router"); + let mut child = Command::new("heaptrack") + .args([ + "-o", + heaptrack_output_path, + router_exe, + "-s", + "supergraph.graphql", + "-c", + "router.yaml", + ]) + .current_dir( + std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("benches") + .join("huge_requests"), + ) + .kill_on_drop(true) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::null()) + .spawn() + .unwrap(); + + let mut router_stdout = tokio::io::BufReader::new(child.stdout.take().unwrap()).lines(); + let (tx, rx) = tokio::sync::oneshot::channel::<()>(); + tokio::spawn(async move { + let mut tx = Some(tx); + while let Some(line) = router_stdout.next_line().await.unwrap() { + if line.contains("GraphQL endpoint exposed") { + if let Some(tx) = tx.take() { + let _ = tx.send(()); + // Don’t stop here, keep consuming output so the pipe doesn’t block on a full buffer + } + } + if VERBOSE { + println!("{}", line); + } + } + }); + rx.await.unwrap(); + + // Warm up Router caches + graphql_client(1).await; + + let latency = graphql_client(string_variable_bytes).await; + print!("{:>4} ms ", latency.as_millis()); + + // Trigger graceful shutdown by signaling the router process, + // which is a child of the heaptrack process. + assert!(Command::new("pkill") + .arg("-P") + .arg(child.id().unwrap().to_string()) + .arg("-f") + .arg(router_exe) + .status() + .await + .unwrap() + .success()); + assert!(child.wait().await.unwrap().success()); + + let output = Command::new("heaptrack_print") + // .arg(heaptrack_output_path) + .arg(format!("{heaptrack_output_path}.zst")) + .output() + .await + .unwrap(); + assert!(output.status.success()); + for line in String::from_utf8_lossy(&output.stdout).lines() { + if let Some(rss) = line.strip_prefix("peak RSS (including heaptrack overhead): ") { + println!("{rss:>7}") + } + } +} + +async fn graphql_client(string_variable_bytes: usize) -> Duration { + let graphql_request = serde_json::json!({ + "query": "mutation Mutation($data: String) { upload(data: $data) }", + "variables": {"data": "_".repeat(string_variable_bytes)} + }); + let request = hyper::Request::post(format!("http://127.0.0.1:{SUPERGRAPH_PORT}")) + .header("content-type", "application/json") + .body(serde_json::to_string(&graphql_request).unwrap().into()) + .unwrap(); + let client = hyper::Client::new(); + let start_time = std::time::Instant::now(); + let result = client.request(request).await; + let latency = start_time.elapsed(); + let mut response = result.unwrap(); + let body = hyper::body::to_bytes(response.body_mut()).await.unwrap(); + assert_eq!( + String::from_utf8_lossy(&body), + r#"{"data":{"upload":true}}"# + ); + if VERBOSE { + println!("{}", String::from_utf8_lossy(&body)); + } + assert!(response.status().is_success()); + latency +} + +async fn spawn_subgraph() -> ShutdownOnDrop { + let (tx, rx) = tokio::sync::oneshot::channel::<()>(); + let shutdown_on_drop = ShutdownOnDrop(Some(tx)); + + let service = hyper::service::make_service_fn(|_| async { + Ok::<_, hyper::Error>(hyper::service::service_fn(subgraph)) + }); + let server = hyper::Server::bind(&([127, 0, 0, 1], SUBGRAPH_PORT).into()) + .serve(service) + .with_graceful_shutdown(async { + let _ = rx.await; + }); + tokio::spawn(async move { + if let Err(e) = server.await { + eprintln!("server error: {}", e); + } + }); + shutdown_on_drop +} + +async fn subgraph( + request: hyper::Request, +) -> Result, hyper::Error> { + // Read the request body and prompty ignore it + request + .into_body() + .for_each(|chunk| { + let _: &[u8] = &chunk.unwrap(); + async {} + }) + .await; + // Assume we got a GraphQL request with `mutation Mutation { upload($some_string) }` + let graphql_response = r#"{"data":{"upload":true}}"#; + Ok(hyper::Response::new(hyper::Body::from(graphql_response))) +} + +struct ShutdownOnDrop(Option>); + +impl Drop for ShutdownOnDrop { + fn drop(&mut self) { + if let Some(tx) = self.0.take() { + let _ = tx.send(()); + } + } +} diff --git a/apollo-router/benches/huge_requests/router.yaml b/apollo-router/benches/huge_requests/router.yaml new file mode 100644 index 00000000000..48f80679257 --- /dev/null +++ b/apollo-router/benches/huge_requests/router.yaml @@ -0,0 +1,2 @@ +supergraph: + listen: 127.0.0.1:10142 diff --git a/apollo-router/benches/huge_requests/supergraph.graphql b/apollo-router/benches/huge_requests/supergraph.graphql new file mode 100644 index 00000000000..d5f3f94dba6 --- /dev/null +++ b/apollo-router/benches/huge_requests/supergraph.graphql @@ -0,0 +1,38 @@ +schema + @core(feature: "https://specs.apollo.dev/core/v0.1") + @core(feature: "https://specs.apollo.dev/join/v0.1") +{ + query: Query + mutation: Mutation +} + +directive @core(feature: String!) repeatable on SCHEMA + +directive @join__field( + graph: join__Graph + requires: join__FieldSet + provides: join__FieldSet +) on FIELD_DEFINITION + +directive @join__type( + graph: join__Graph! + key: join__FieldSet +) repeatable on OBJECT | INTERFACE + +directive @join__owner(graph: join__Graph!) on OBJECT | INTERFACE + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +scalar join__FieldSet + +enum join__Graph { + SUBGRAPH_1 @join__graph(name: "subgraph_1", url: "http://127.0.0.1:10141/") +} + +type Query { + unused: Int +} + +type Mutation { + upload(data: String): Boolean +} 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 c3019908624..f02fda7160a 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 @@ -3719,6 +3719,28 @@ expression: "&schema" "additionalProperties": false, "nullable": true }, + "buckets": { + "description": "Custom buckets for histograms", + "default": [ + 0.001, + 0.005, + 0.015, + 0.05, + 0.1, + 0.2, + 0.3, + 0.4, + 0.5, + 1.0, + 5.0, + 10.0 + ], + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, "resources": { "description": "Resources", "default": {}, @@ -3729,11 +3751,13 @@ expression: "&schema" }, "service_name": { "description": "Set a service.name resource in your metrics", + "default": null, "type": "string", "nullable": true }, "service_namespace": { "description": "Set a service.namespace attribute in your metrics", + "default": null, "type": "string", "nullable": true } diff --git a/apollo-router/src/executable.rs b/apollo-router/src/executable.rs index f696b8e6a52..a3e27c8af34 100644 --- a/apollo-router/src/executable.rs +++ b/apollo-router/src/executable.rs @@ -33,6 +33,14 @@ use crate::router::SchemaSource; use crate::router::ShutdownSource; use crate::EntitlementSource; +#[cfg(all( + feature = "global-allocator", + not(feature = "dhat-heap"), + target_os = "linux" +))] +#[global_allocator] +static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; + // 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. diff --git a/apollo-router/src/main.rs b/apollo-router/src/main.rs index 413189a7535..4384157e0af 100644 --- a/apollo-router/src/main.rs +++ b/apollo-router/src/main.rs @@ -1,15 +1,3 @@ -//! Main entry point for CLI command to start server. -// Note: We want to use jemalloc on linux, but we don't enable it if dhat-heap is in use because we -// can only have one global allocator -#[cfg(target_os = "linux")] -#[cfg(not(feature = "dhat-heap"))] -use tikv_jemallocator::Jemalloc; - -#[cfg(target_os = "linux")] -#[cfg(not(feature = "dhat-heap"))] -#[global_allocator] -static GLOBAL: Jemalloc = Jemalloc; - fn main() { match apollo_router::main() { Ok(_) => {} diff --git a/apollo-router/src/plugins/authentication/mod.rs b/apollo-router/src/plugins/authentication/mod.rs index e155df3cb41..135c60795e3 100644 --- a/apollo-router/src/plugins/authentication/mod.rs +++ b/apollo-router/src/plugins/authentication/mod.rs @@ -17,6 +17,7 @@ use jsonwebtoken::jwk::KeyOperations; use jsonwebtoken::jwk::PublicKeyUse; use jsonwebtoken::Algorithm; use jsonwebtoken::DecodingKey; +use jsonwebtoken::TokenData; use jsonwebtoken::Validation; use once_cell::sync::Lazy; use reqwest::Client; @@ -61,9 +62,6 @@ enum AuthenticationError<'a> { /// '{0}' is not a valid JWT header: {1} InvalidHeader(&'a str, JWTError), - /// Cannot retrieve JWKS: {0} - CannotRetrieveJWKS(BoxError), - /// Cannot create decoding key: {0} CannotCreateDecodingKey(JWTError), @@ -168,9 +166,10 @@ struct JWTCriteria { fn search_jwks( jwks_manager: &JwksManager, criteria: &JWTCriteria, -) -> Result, Jwk)>, BoxError> { +) -> Option, Jwk)>> { const HIGHEST_SCORE: usize = 2; let mut candidates = vec![]; + let mut found_highest_score = false; for JwkSetInfo { jwks, issuer, @@ -270,9 +269,10 @@ fn search_jwks( // point for having an explicitly matching algorithm and 1 point for an explicitly // matching kid. We will sort our candidates and pick the key with the highest score. - // If we find a key with a HIGHEST_SCORE, let's stop looking. + // If we find a key with a HIGHEST_SCORE, we will filter the list to only keep those + // with that score if key_score == HIGHEST_SCORE { - return Ok(Some((issuer, key))); + found_highest_score = true; } candidates.push((key_score, (issuer.clone(), key))); @@ -292,13 +292,34 @@ fn search_jwks( ); if candidates.is_empty() { - Ok(None) + None } else { // Only sort if we need to if candidates.len() > 1 { candidates.sort_by(|a, b| a.0.cmp(&b.0)); } - Ok(Some(candidates.pop().expect("list isn't empty").1)) + + if found_highest_score { + Some( + candidates + .into_iter() + .filter_map(|(score, candidate)| { + if score == HIGHEST_SCORE { + Some(candidate) + } else { + None + } + }) + .collect(), + ) + } else { + Some( + candidates + .into_iter() + .map(|(_score, candidate)| candidate) + .collect(), + ) + } } } @@ -472,52 +493,11 @@ fn authenticate( // Search our list of JWKS to find the kid and process it // Note: This will search through JWKS in the order in which they are defined // in configuration. - - let jwk_opt = match search_jwks(jwks_manager, &criteria) { - Ok(j) => j, - Err(e) => { - return failure_message( - request.context, - AuthenticationError::CannotRetrieveJWKS(e), - StatusCode::INTERNAL_SERVER_ERROR, - ); - } - }; - - if let Some((issuer, jwk)) = jwk_opt { - let decoding_key = match DecodingKey::from_jwk(&jwk) { - Ok(k) => k, - Err(e) => { - return failure_message( - request.context, - AuthenticationError::CannotCreateDecodingKey(e), - StatusCode::INTERNAL_SERVER_ERROR, - ); - } - }; - - let algorithm = match jwk.common.algorithm { - Some(a) => a, - None => { - return failure_message( - request.context, - AuthenticationError::JWKHasNoAlgorithm, - StatusCode::INTERNAL_SERVER_ERROR, - ); - } - }; - - let mut validation = Validation::new(algorithm); - validation.validate_nbf = true; - - let token_data = match decode::(jwt, &decoding_key, &validation) { - Ok(v) => v, - Err(e) => { - return failure_message( - request.context, - AuthenticationError::CannotDecodeJWT(e), - StatusCode::UNAUTHORIZED, - ); + if let Some(keys) = search_jwks(jwks_manager, &criteria) { + let (issuer, token_data) = match decode_jwt(jwt, keys, criteria) { + Ok(data) => data, + Err((auth_error, status_code)) => { + return failure_message(request.context, auth_error, status_code); } }; @@ -575,6 +555,68 @@ fn authenticate( } } +fn decode_jwt( + jwt: &str, + keys: Vec<(Option, Jwk)>, + criteria: JWTCriteria, +) -> Result<(Option, TokenData), (AuthenticationError, StatusCode)> { + let mut error = None; + for (issuer, jwk) in keys.into_iter() { + let decoding_key = match DecodingKey::from_jwk(&jwk) { + Ok(k) => k, + Err(e) => { + error = Some(( + AuthenticationError::CannotCreateDecodingKey(e), + StatusCode::INTERNAL_SERVER_ERROR, + )); + continue; + } + }; + + let algorithm = match jwk.common.algorithm { + Some(a) => a, + None => { + error = Some(( + AuthenticationError::JWKHasNoAlgorithm, + StatusCode::INTERNAL_SERVER_ERROR, + )); + continue; + } + }; + + let mut validation = Validation::new(algorithm); + validation.validate_nbf = true; + + match decode::(jwt, &decoding_key, &validation) { + Ok(v) => return Ok((issuer, v)), + Err(e) => { + error = Some(( + AuthenticationError::CannotDecodeJWT(e), + StatusCode::UNAUTHORIZED, + )); + } + }; + } + + match error { + Some(e) => Err(e), + None => { + // We can't find a key to process this JWT. + if criteria.kid.is_some() { + Err(( + AuthenticationError::CannotFindKID(criteria.kid), + StatusCode::UNAUTHORIZED, + )) + } else { + Err(( + AuthenticationError::CannotFindSuitableKey(criteria.alg, criteria.kid), + StatusCode::UNAUTHORIZED, + )) + } + } + } +} + // This macro allows us to use it in our plugin registry! // register_plugin takes a group name, and a plugin name. // diff --git a/apollo-router/src/plugins/authentication/tests.rs b/apollo-router/src/plugins/authentication/tests.rs index d826db59590..c9200cb2a25 100644 --- a/apollo-router/src/plugins/authentication/tests.rs +++ b/apollo-router/src/plugins/authentication/tests.rs @@ -570,8 +570,9 @@ async fn it_finds_key_with_criteria_kid_and_algorithm() { }; let (_issuer, key) = search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .expect("found a key"); + .expect("found a key") + .pop() + .expect("list isn't empty"); assert_eq!(Algorithm::HS256, key.common.algorithm.unwrap()); assert_eq!("key2", key.common.key_id.unwrap()); } @@ -586,8 +587,9 @@ async fn it_finds_best_matching_key_with_criteria_algorithm() { }; let (_issuer, key) = search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .expect("found a key"); + .expect("found a key") + .pop() + .expect("list isn't empty"); assert_eq!(Algorithm::HS256, key.common.algorithm.unwrap()); assert_eq!("key1", key.common.key_id.unwrap()); } @@ -601,9 +603,7 @@ async fn it_fails_to_find_key_with_criteria_algorithm_not_in_set() { alg: Algorithm::RS512, }; - assert!(search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .is_none()); + assert!(search_jwks(&jwks_manager, &criteria).is_none()); } #[tokio::test] @@ -616,8 +616,9 @@ async fn it_finds_key_with_criteria_algorithm_ec() { }; let (_issuer, key) = search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .expect("found a key"); + .expect("found a key") + .pop() + .expect("list isn't empty"); assert_eq!(Algorithm::ES256, key.common.algorithm.unwrap()); assert_eq!( "afda85e09a320cf748177874592de64d", @@ -635,8 +636,9 @@ async fn it_finds_key_with_criteria_algorithm_rsa() { }; let (_issuer, key) = search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .expect("found a key"); + .expect("found a key") + .pop() + .expect("list isn't empty"); assert_eq!(Algorithm::RS256, key.common.algorithm.unwrap()); assert_eq!( "022516583d56b68faf40260fda72978a", @@ -872,7 +874,5 @@ async fn it_rejects_key_with_restricted_algorithm() { alg: Algorithm::HS256, }; - assert!(search_jwks(&jwks_manager, &criteria) - .expect("search worked") - .is_none()); + assert!(search_jwks(&jwks_manager, &criteria).is_none()); } diff --git a/apollo-router/src/plugins/coprocessor.rs b/apollo-router/src/plugins/coprocessor.rs index 2227136584b..2c914eb1c97 100644 --- a/apollo-router/src/plugins/coprocessor.rs +++ b/apollo-router/src/plugins/coprocessor.rs @@ -8,6 +8,10 @@ use std::sync::Arc; use std::time::Duration; use bytes::Bytes; +use futures::future::ready; +use futures::stream::once; +use futures::StreamExt; +use futures::TryStreamExt; use http::header::HeaderName; use http::HeaderMap; use http::HeaderValue; @@ -107,7 +111,7 @@ where + Send + Sync + 'static, - >>::Future: Send + Sync + 'static, + >>::Future: Send + Sync + 'static, { http_client: C, configuration: Conf, @@ -121,7 +125,7 @@ where + Send + Sync + 'static, - >>::Future: Send + Sync + 'static, + >>::Future: Send + Sync + 'static, { fn new(http_client: C, configuration: Conf, sdl: Arc) -> Result { Ok(Self { @@ -262,7 +266,7 @@ impl RouterStage { + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { let request_layer = (self.request != Default::default()).then_some({ let request_config = self.request.clone(); @@ -378,7 +382,7 @@ impl SubgraphStage { + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { let request_layer = (self.request != Default::default()).then_some({ let request_config = self.request.clone(); @@ -474,7 +478,7 @@ where + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { // Call into our out of process processor with a body of our body // First, extract the data we need from our request and prepare our @@ -490,30 +494,26 @@ where // HTTP GET requests don't have a body let body_to_send = request_config .body - .then(|| serde_json::from_slice::(&bytes)) + .then(|| String::from_utf8(bytes.to_vec())) .transpose() .unwrap_or_default(); let path_to_send = request_config.path.then(|| parts.uri.to_string()); let context_to_send = request_config.context.then(|| request.context.clone()); - let sdl = request_config.sdl.then(|| sdl.clone().to_string()); - - let payload = Externalizable { - version: EXTERNALIZABLE_VERSION, - stage: PipelineStep::RouterRequest.to_string(), - control: Some(Control::default()), - id: TraceId::maybe_new().map(|id| id.to_string()), - headers: headers_to_send, - body: body_to_send, - context: context_to_send, - sdl, - uri: None, - path: path_to_send, - method: Some(parts.method.to_string()), - service_name: None, - status_code: None, - }; + let sdl_to_send = request_config.sdl.then(|| sdl.clone().to_string()); + + let payload = Externalizable::router_builder() + .stage(PipelineStep::RouterRequest) + .control(Control::default()) + .and_id(TraceId::maybe_new().map(|id| id.to_string())) + .and_headers(headers_to_send) + .and_body(body_to_send) + .and_context(context_to_send) + .and_sdl(sdl_to_send) + .and_path(path_to_send) + .method(parts.method.to_string()) + .build(); tracing::debug!(?payload, "externalized output"); request.context.enter_active_request(); @@ -533,18 +533,24 @@ where // Ensure the code is a valid http status code let code = control.get_http_status()?; - let graphql_response: crate::graphql::Response = - serde_json::from_value(co_processor_output.body.unwrap_or(serde_json::Value::Null)) - .unwrap_or_else(|error| { - crate::graphql::Response::builder() - .errors(vec![Error::builder() - .message(format!( - "couldn't deserialize coprocessor output body: {error}" - )) - .extension_code("EXERNAL_DESERIALIZATION_ERROR") - .build()]) - .build() - }); + // At this point our body is a String. Try to get a valid JSON value from it + let body_as_value = co_processor_output + .body + .and_then(|b| serde_json::from_str(&b).ok()) + .unwrap_or(serde_json::Value::Null); + // Now we have some JSON, let's see if it's the right "shape" to create a graphql_response. + // If it isn't, we create a graphql error response + let graphql_response: crate::graphql::Response = serde_json::from_value(body_as_value) + .unwrap_or_else(|error| { + crate::graphql::Response::builder() + .errors(vec![Error::builder() + .message(format!( + "couldn't deserialize coprocessor output body: {error}" + )) + .extension_code("EXTERNAL_DESERIALIZATION_ERROR") + .build()]) + .build() + }); let res = router::Response::builder() .errors(graphql_response.errors) @@ -576,7 +582,7 @@ where // are present in our co_processor_output. let new_body = match co_processor_output.body { - Some(bytes) => Body::from(serde_json::to_vec(&bytes)?), + Some(bytes) => Body::from(bytes), None => Body::from(bytes), }; @@ -610,46 +616,57 @@ where + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { - // Call into our out of process processor with a body of our body - // First, extract the data we need from our response and prepare our - // external call. Use our configuration to figure out which data to send. + // split the response into parts + body let (parts, body) = response.response.into_parts(); - let bytes = hyper::body::to_bytes(body).await?; + // we split the body (which is a stream) into first response + rest of responses, + // for which we will implement mapping later + let (first, rest): (Option>, Body) = body.into_future().await; + + // If first is None, or contains an error we return an error + let opt_first: Option = first.and_then(|f| f.ok()); + let bytes = match opt_first { + Some(b) => b.to_vec(), + None => { + tracing::error!( + "Coprocessor cannot convert body into future due to problem with first part" + ); + return Err(BoxError::from( + "Coprocessor cannot convert body into future due to problem with first part", + )); + } + }; + + // Now we process our first chunk of response + // Encode headers, body, status, context, sdl to create a payload let headers_to_send = response_config .headers .then(|| externalize_header_map(&parts.headers)) .transpose()?; let body_to_send = response_config .body - .then(|| serde_json::from_slice::(&bytes)) + .then(|| String::from_utf8(bytes.clone())) .transpose()?; let status_to_send = response_config.status_code.then(|| parts.status.as_u16()); let context_to_send = response_config.context.then(|| response.context.clone()); - let sdl = response_config.sdl.then(|| sdl.clone().to_string()); - - let payload = Externalizable { - version: EXTERNALIZABLE_VERSION, - stage: PipelineStep::RouterResponse.to_string(), - control: None, - id: TraceId::maybe_new().map(|id| id.to_string()), - headers: headers_to_send, - body: body_to_send, - context: context_to_send, - status_code: status_to_send, - sdl, - uri: None, - path: None, - method: None, - service_name: None, - }; + let sdl_to_send = response_config.sdl.then(|| sdl.clone().to_string()); + + let payload = Externalizable::router_builder() + .stage(PipelineStep::RouterResponse) + .and_id(TraceId::maybe_new().map(|id| id.to_string())) + .and_headers(headers_to_send) + .and_body(body_to_send) + .and_context(context_to_send) + .and_status_code(status_to_send) + .and_sdl(sdl_to_send.clone()) + .build(); // Second, call our co-processor and get a reply. tracing::debug!(?payload, "externalized output"); response.context.enter_active_request(); - let co_processor_result = payload.call(http_client, &coprocessor_url).await; + let co_processor_result = payload.call(http_client.clone(), &coprocessor_url).await; response.context.leave_active_request(); tracing::debug!(?co_processor_result, "co-processor returned"); let co_processor_output = co_processor_result?; @@ -662,11 +679,12 @@ where // bits that we sent to the co_processor. let new_body = match co_processor_output.body { - Some(bytes) => Body::from(serde_json::to_vec(&bytes)?), + Some(bytes) => Body::from(bytes), None => Body::from(bytes), }; response.response = http::Response::from_parts(parts, new_body); + if let Some(control) = co_processor_output.control { *response.response.status_mut() = control.get_http_status()? } @@ -683,7 +701,85 @@ where *response.response.headers_mut() = internalize_header_map(headers)?; } - Ok(response) + // Now break our co-processor modified response back into parts + let (parts, body) = response.response.into_parts(); + + // Clone all the bits we need + let context = response.context.clone(); + let map_context = response.context.clone(); + + // Map the rest of our body to process subsequent chunks of response + let mapped_stream = rest + .map_err(BoxError::from) + .and_then(move |deferred_response| { + let generator_client = http_client.clone(); + let generator_coprocessor_url = coprocessor_url.clone(); + let generator_map_context = map_context.clone(); + let generator_sdl_to_send = sdl_to_send.clone(); + + async move { + let bytes = deferred_response.to_vec(); + let body_to_send = response_config + .body + .then(|| String::from_utf8(bytes.clone())) + .transpose()?; + let context_to_send = response_config + .context + .then(|| generator_map_context.clone()); + + // Note: We deliberately DO NOT send headers or status_code even if the user has + // requested them. That's because they are meaningless on a deferred response and + // providing them will be a source of confusion. + let payload = Externalizable::router_builder() + .stage(PipelineStep::RouterResponse) + .and_id(TraceId::maybe_new().map(|id| id.to_string())) + .and_body(body_to_send) + .and_context(context_to_send) + .and_sdl(generator_sdl_to_send) + .build(); + + // Second, call our co-processor and get a reply. + tracing::debug!(?payload, "externalized output"); + generator_map_context.enter_active_request(); + let co_processor_result = payload + .call(generator_client, &generator_coprocessor_url) + .await; + generator_map_context.leave_active_request(); + tracing::debug!(?co_processor_result, "co-processor returned"); + let co_processor_output = co_processor_result?; + + validate_coprocessor_output(&co_processor_output, PipelineStep::RouterResponse)?; + + // Third, process our reply and act on the contents. Our processing logic is + // that we replace "bits" of our incoming response with the updated bits if they + // are present in our co_processor_output. If they aren't present, just use the + // bits that we sent to the co_processor. + let final_bytes: Bytes = match co_processor_output.body { + Some(bytes) => bytes.into(), + None => bytes.into(), + }; + + if let Some(context) = co_processor_output.context { + for (key, value) in context.try_into_iter()? { + generator_map_context.upsert_json_value(key, move |_current| value); + } + } + + // We return the final_bytes into our stream of response chunks + Ok(final_bytes) + } + }); + + // Create our response stream which consists of the bytes from our first body chained with the + // rest of the responses in our mapped stream. + let bytes = hyper::body::to_bytes(body).await.map_err(BoxError::from); + let final_stream = once(ready(bytes)).chain(mapped_stream).boxed(); + + // Finally, return a response which has a Body that wraps our stream of response chunks. + Ok(router::Response { + context, + response: http::Response::from_parts(parts, Body::wrap_stream(final_stream)), + }) } // ----------------------------------------------------------------------------------------------------- @@ -700,7 +796,7 @@ where + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { // Call into our out of process processor with a body of our body // First, extract the data we need from our request and prepare our @@ -721,21 +817,17 @@ where let uri = request_config.uri.then(|| parts.uri.to_string()); let service_name = request_config.service_name.then_some(service_name); - let payload = Externalizable { - version: EXTERNALIZABLE_VERSION, - stage: PipelineStep::SubgraphRequest.to_string(), - control: Some(Control::default()), - id: TraceId::maybe_new().map(|id| id.to_string()), - headers: headers_to_send, - body: body_to_send, - context: context_to_send, - sdl: None, - service_name, - path: None, - uri, - method: Some(parts.method.to_string()), - status_code: None, - }; + let payload = Externalizable::subgraph_builder() + .stage(PipelineStep::SubgraphRequest) + .control(Control::default()) + .and_id(TraceId::maybe_new().map(|id| id.to_string())) + .and_headers(headers_to_send) + .and_body(body_to_send) + .and_context(context_to_send) + .method(parts.method.to_string()) + .and_service_name(service_name) + .and_uri(uri) + .build(); tracing::debug!(?payload, "externalized output"); request.context.enter_active_request(); @@ -763,7 +855,7 @@ where .message(format!( "couldn't deserialize coprocessor output body: {error}" )) - .extension_code("EXERNAL_DESERIALIZATION_ERROR") + .extension_code("EXTERNAL_DESERIALIZATION_ERROR") .build()]) .build() }); @@ -836,7 +928,7 @@ where + Send + Sync + 'static, - >>::Future: Send + 'static, + >>::Future: Send + 'static, { // Call into our out of process processor with a body of our body // First, extract the data we need from our response and prepare our @@ -859,21 +951,15 @@ where let context_to_send = response_config.context.then(|| response.context.clone()); let service_name = response_config.service_name.then_some(service_name); - let payload = Externalizable { - version: EXTERNALIZABLE_VERSION, - stage: PipelineStep::SubgraphResponse.to_string(), - control: None, - id: TraceId::maybe_new().map(|id| id.to_string()), - headers: headers_to_send, - body: body_to_send, - context: context_to_send, - status_code: status_to_send, - sdl: None, - uri: None, - path: None, - method: None, - service_name, - }; + let payload = Externalizable::subgraph_builder() + .stage(PipelineStep::SubgraphResponse) + .and_id(TraceId::maybe_new().map(|id| id.to_string())) + .and_headers(headers_to_send) + .and_body(body_to_send) + .and_context(context_to_send) + .and_status_code(status_to_send) + .and_service_name(service_name) + .build(); tracing::debug!(?payload, "externalized output"); response.context.enter_active_request(); @@ -917,8 +1003,8 @@ where // ----------------------------------------------------------------------------------------- -fn validate_coprocessor_output( - co_processor_output: &Externalizable, +fn validate_coprocessor_output( + co_processor_output: &Externalizable, expected_step: PipelineStep, ) -> Result<(), BoxError> { if co_processor_output.version != EXTERNALIZABLE_VERSION { diff --git a/apollo-router/src/plugins/coprocessor_test.rs b/apollo-router/src/plugins/coprocessor_test.rs index fb30b997ddb..297391af5ee 100644 --- a/apollo-router/src/plugins/coprocessor_test.rs +++ b/apollo-router/src/plugins/coprocessor_test.rs @@ -30,7 +30,7 @@ mod tests { #[tokio::test] async fn load_plugin() { - let config = serde_json::json!({ + let config = json!({ "coprocessor": { "url": "http://127.0.0.1:8081" } @@ -48,7 +48,7 @@ mod tests { #[tokio::test] async fn unknown_fields_are_denied() { - let config = serde_json::json!({ + let config = json!({ "coprocessor": { "url": "http://127.0.0.1:8081", "thisFieldDoesntExist": true @@ -67,7 +67,7 @@ mod tests { #[tokio::test] async fn external_plugin_with_stages_wont_load_without_graph_ref() { - let config = serde_json::json!({ + let config = json!({ "coprocessor": { "url": "http://127.0.0.1:8081", "stages": { @@ -110,22 +110,22 @@ mod tests { let mock_http_client = mock_with_callback(move |_: hyper::Request| { Box::pin(async { // Wrong version! + let input = json!( + { + "version": 2, + "stage": "RouterRequest", + "control": "continue", + "id": "1b19c05fdafc521016df33148ad63c1b", + "body": "{ + \"query\": \"query Long {\n me {\n name\n}\n}\" + }", + "context": { + "entries": {} + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 2, - "stage": "RouterRequest", - "control": "continue", - "id": "1b19c05fdafc521016df33148ad63c1b", - "body": { - "query": "query Long {\n me {\n name\n}\n}" - }, - "context": { - "entries": {} - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -169,22 +169,22 @@ mod tests { let mock_http_client = mock_with_callback(move |_: hyper::Request| { Box::pin(async { // Wrong stage! + let input = json!( + { + "version": 1, + "stage": "RouterResponse", + "control": "continue", + "id": "1b19c05fdafc521016df33148ad63c1b", + "body": "{ + \"query\": \"query Long {\n me {\n name\n}\n}\" + }", + "context": { + "entries": {} + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterResponse", - "control": "continue", - "id": "1b19c05fdafc521016df33148ad63c1b", - "body": { - "query": "query Long {\n me {\n name\n}\n}" - }, - "context": { - "entries": {} - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -228,21 +228,21 @@ mod tests { let mock_http_client = mock_with_callback(move |_: hyper::Request| { Box::pin(async { // Wrong stage! + let input = json!( + { + "version": 1, + "stage": "RouterRequest", + "id": "1b19c05fdafc521016df33148ad63c1b", + "body": "{ + \"query\": \"query Long {\n me {\n name\n}\n}\" + }", + "context": { + "entries": {} + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterRequest", - "id": "1b19c05fdafc521016df33148ad63c1b", - "body": { - "query": "query Long {\n me {\n name\n}\n}" - }, - "context": { - "entries": {} - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -691,53 +691,53 @@ mod tests { deserialized_request.stage ); + let input = json!( + { + "version": 1, + "stage": "RouterRequest", + "control": "continue", + "id": "1b19c05fdafc521016df33148ad63c1b", + "headers": { + "cookie": [ + "tasty_cookie=strawberry" + ], + "content-type": [ + "application/json" + ], + "host": [ + "127.0.0.1:4000" + ], + "apollo-federation-include-trace": [ + "ftv1" + ], + "apollographql-client-name": [ + "manual" + ], + "accept": [ + "*/*" + ], + "user-agent": [ + "curl/7.79.1" + ], + "content-length": [ + "46" + ] + }, + "body": "{ + \"query\": \"query Long {\n me {\n name\n}\n}\" + }", + "context": { + "entries": { + "accepts-json": false, + "accepts-wildcard": true, + "accepts-multipart": false, + "this-is-a-test-context": 42 + } + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterRequest", - "control": "continue", - "id": "1b19c05fdafc521016df33148ad63c1b", - "headers": { - "cookie": [ - "tasty_cookie=strawberry" - ], - "content-type": [ - "application/json" - ], - "host": [ - "127.0.0.1:4000" - ], - "apollo-federation-include-trace": [ - "ftv1" - ], - "apollographql-client-name": [ - "manual" - ], - "accept": [ - "*/*" - ], - "user-agent": [ - "curl/7.79.1" - ], - "content-length": [ - "46" - ] - }, - "body": { - "query": "query Long {\n me {\n name\n}\n}" - }, - "context": { - "entries": { - "accepts-json": false, - "accepts-wildcard": true, - "accepts-multipart": false, - "this-is-a-test-context": 42 - } - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -814,55 +814,55 @@ mod tests { deserialized_request.stage ); + let input = json!( + { + "version": 1, + "stage": "RouterRequest", + "control": "continue", + "id": "1b19c05fdafc521016df33148ad63c1b", + "uri": "/this/is/a/new/uri", + "method": "POST", + "headers": { + "cookie": [ + "tasty_cookie=strawberry" + ], + "content-type": [ + "application/json" + ], + "host": [ + "127.0.0.1:4000" + ], + "apollo-federation-include-trace": [ + "ftv1" + ], + "apollographql-client-name": [ + "manual" + ], + "accept": [ + "*/*" + ], + "user-agent": [ + "curl/7.79.1" + ], + "content-length": [ + "46" + ] + }, + "body": "{ + \"query\": \"query Long {\n me {\n name\n}\n}\" + }", + "context": { + "entries": { + "accepts-json": false, + "accepts-wildcard": true, + "accepts-multipart": false, + "this-is-a-test-context": 42 + } + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterRequest", - "control": "continue", - "id": "1b19c05fdafc521016df33148ad63c1b", - "uri": "/this/is/a/new/uri", - "method": "POST", - "headers": { - "cookie": [ - "tasty_cookie=strawberry" - ], - "content-type": [ - "application/json" - ], - "host": [ - "127.0.0.1:4000" - ], - "apollo-federation-include-trace": [ - "ftv1" - ], - "apollographql-client-name": [ - "manual" - ], - "accept": [ - "*/*" - ], - "user-agent": [ - "curl/7.79.1" - ], - "content-length": [ - "46" - ] - }, - "body": { - "query": "query Long {\n me {\n name\n}\n}" - }, - "context": { - "entries": { - "accepts-json": false, - "accepts-wildcard": true, - "accepts-multipart": false, - "this-is-a-test-context": 42 - } - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -910,28 +910,29 @@ mod tests { deserialized_request.stage ); + let input = json!( + { + "version": 1, + "stage": "RouterRequest", + "control": { + "break": 200 + }, + "id": "1b19c05fdafc521016df33148ad63c1b", + "body": "{ + \"errors\": [{ \"message\": \"my error message\" }] + }", + "context": { + "entries": { + "testKey": true + } + }, + "headers": { + "aheader": ["a value"] + } + } + ); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterRequest", - "control": { - "break": 200 - }, - "id": "1b19c05fdafc521016df33148ad63c1b", - "body": { - "errors": [{ "message": "my error message" }] - }, - "context": { - "entries": { - "testKey": true - } - }, - "headers": { - "aheader": ["a value"] - } - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -960,7 +961,7 @@ mod tests { .unwrap(); assert_eq!( - serde_json::json!({ + json!({ "errors": [{ "message": "my error message" }] @@ -984,14 +985,14 @@ mod tests { let mock_router_service = router_service::from_supergraph_mock_callback(move |req| { Ok(supergraph::Response::builder() - .data(json!({ "test": 1234_u32 })) + .data(json!("{ \"test\": 1234_u32 }")) .context(req.context) .build() .unwrap()) }) .await; - let mock_http_client = mock_with_callback(move |res: hyper::Request| { + let mock_http_client = mock_with_deferred_callback(move |res: hyper::Request| { Box::pin(async { let deserialized_response: Externalizable = serde_json::from_slice(&hyper::body::to_bytes(res.into_body()).await.unwrap()) @@ -1004,59 +1005,59 @@ mod tests { ); assert_eq!( - json!({ "data": { "test": 1234_u32 } }), + json!("{\"data\":\"{ \\\"test\\\": 1234_u32 }\"}"), deserialized_response.body.unwrap() ); + let input = json!( + { + "version": 1, + "stage": "RouterResponse", + "control": { + "break": 400 + }, + "id": "1b19c05fdafc521016df33148ad63c1b", + "headers": { + "cookie": [ + "tasty_cookie=strawberry" + ], + "content-type": [ + "application/json" + ], + "host": [ + "127.0.0.1:4000" + ], + "apollo-federation-include-trace": [ + "ftv1" + ], + "apollographql-client-name": [ + "manual" + ], + "accept": [ + "*/*" + ], + "user-agent": [ + "curl/7.79.1" + ], + "content-length": [ + "46" + ] + }, + "body": "{ + \"data\": { \"test\": 42 } + }", + "context": { + "entries": { + "accepts-json": false, + "accepts-wildcard": true, + "accepts-multipart": false, + "this-is-a-test-context": 42 + } + }, + "sdl": "the sdl shouldnt change" + }); Ok(hyper::Response::builder() - .body(Body::from( - r##"{ - "version": 1, - "stage": "RouterResponse", - "control": { - "break": 400 - }, - "id": "1b19c05fdafc521016df33148ad63c1b", - "headers": { - "cookie": [ - "tasty_cookie=strawberry" - ], - "content-type": [ - "application/json" - ], - "host": [ - "127.0.0.1:4000" - ], - "apollo-federation-include-trace": [ - "ftv1" - ], - "apollographql-client-name": [ - "manual" - ], - "accept": [ - "*/*" - ], - "user-agent": [ - "curl/7.79.1" - ], - "content-length": [ - "46" - ] - }, - "body": { - "data": { "test": 42 } - }, - "context": { - "entries": { - "accepts-json": false, - "accepts-wildcard": true, - "accepts-multipart": false, - "this-is-a-test-context": 42 - } - }, - "sdl": "the sdl shouldnt change" - }"##, - )) + .body(Body::from(serde_json::to_string(&input).unwrap())) .unwrap()) }) }); @@ -1182,4 +1183,28 @@ mod tests { mock_http_client } + + #[allow(clippy::type_complexity)] + fn mock_with_deferred_callback( + callback: fn( + hyper::Request, + ) -> BoxFuture<'static, Result, BoxError>>, + ) -> MockHttpClientService { + let mut mock_http_client = MockHttpClientService::new(); + mock_http_client.expect_clone().returning(move || { + let mut mock_http_client = MockHttpClientService::new(); + mock_http_client.expect_clone().returning(move || { + let mut mock_http_client = MockHttpClientService::new(); + mock_http_client.expect_clone().returning(move || { + let mut mock_http_client = MockHttpClientService::new(); + mock_http_client.expect_call().returning(callback); + mock_http_client + }); + mock_http_client + }); + mock_http_client + }); + + mock_http_client + } } diff --git a/apollo-router/src/plugins/telemetry/config.rs b/apollo-router/src/plugins/telemetry/config.rs index 21bb70387f6..afc99d28a12 100644 --- a/apollo-router/src/plugins/telemetry/config.rs +++ b/apollo-router/src/plugins/telemetry/config.rs @@ -80,7 +80,7 @@ pub(crate) struct Metrics { } #[derive(Clone, Default, Debug, Deserialize, JsonSchema)] -#[serde(deny_unknown_fields, rename_all = "snake_case")] +#[serde(deny_unknown_fields, rename_all = "snake_case", default)] pub(crate) struct MetricsCommon { /// Configuration to add custom labels/attributes to metrics pub(crate) attributes: Option, @@ -88,9 +88,17 @@ pub(crate) struct MetricsCommon { pub(crate) service_name: Option, /// Set a service.namespace attribute in your metrics pub(crate) service_namespace: Option, - #[serde(default)] /// Resources pub(crate) resources: HashMap, + /// Custom buckets for histograms + #[serde(default = "default_buckets")] + pub(crate) buckets: Vec, +} + +fn default_buckets() -> Vec { + vec![ + 0.001, 0.005, 0.015, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 5.0, 10.0, + ] } /// Tracing configuration diff --git a/apollo-router/src/plugins/telemetry/metrics/otlp.rs b/apollo-router/src/plugins/telemetry/metrics/otlp.rs index d4883a56bea..de18f0f9f10 100644 --- a/apollo-router/src/plugins/telemetry/metrics/otlp.rs +++ b/apollo-router/src/plugins/telemetry/metrics/otlp.rs @@ -42,9 +42,7 @@ impl MetricsConfigurator for super::super::otlp::Config { Some(exporter) => { let exporter = opentelemetry_otlp::new_pipeline() .metrics( - selectors::simple::histogram([ - 0.001, 0.005, 0.015, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 5.0, 10.0, - ]), + selectors::simple::histogram(metrics_config.buckets.clone()), aggregation::stateless_temporality_selector(), opentelemetry::runtime::Tokio, ) diff --git a/apollo-router/src/plugins/telemetry/metrics/prometheus.rs b/apollo-router/src/plugins/telemetry/metrics/prometheus.rs index f830b31152c..5d6e6c84bb8 100644 --- a/apollo-router/src/plugins/telemetry/metrics/prometheus.rs +++ b/apollo-router/src/plugins/telemetry/metrics/prometheus.rs @@ -85,9 +85,7 @@ impl MetricsConfigurator for Config { if self.enabled { let mut controller = controllers::basic( processors::factory( - selectors::simple::histogram([ - 0.001, 0.005, 0.015, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 5.0, 10.0, - ]), + selectors::simple::histogram(metrics_config.buckets.clone()), aggregation::stateless_temporality_selector(), ) .with_memory(true), diff --git a/apollo-router/src/plugins/telemetry/mod.rs b/apollo-router/src/plugins/telemetry/mod.rs index 05f50f90054..ec2850d2627 100644 --- a/apollo-router/src/plugins/telemetry/mod.rs +++ b/apollo-router/src/plugins/telemetry/mod.rs @@ -2098,6 +2098,287 @@ mod tests { assert_snapshot!(prom_metrics); } + #[tokio::test(flavor = "multi_thread")] + async fn it_test_prometheus_metrics_custom_buckets() { + let mut mock_service = MockSupergraphService::new(); + mock_service + .expect_call() + .times(1) + .returning(move |req: SupergraphRequest| { + Ok(SupergraphResponse::fake_builder() + .context(req.context) + .header("x-custom", "coming_from_header") + .data(json!({"data": {"my_value": 2usize}})) + .build() + .unwrap()) + }); + + let mut mock_bad_request_service = MockSupergraphService::new(); + mock_bad_request_service + .expect_call() + .times(1) + .returning(move |req: SupergraphRequest| { + Ok(SupergraphResponse::fake_builder() + .context(req.context) + .status_code(StatusCode::BAD_REQUEST) + .data(json!({"errors": [{"message": "nope"}]})) + .build() + .unwrap()) + }); + + let mut mock_subgraph_service = MockSubgraphService::new(); + mock_subgraph_service + .expect_call() + .times(1) + .returning(move |req: SubgraphRequest| { + let mut extension = Object::new(); + extension.insert( + serde_json_bytes::ByteString::from("status"), + serde_json_bytes::Value::String(ByteString::from("INTERNAL_SERVER_ERROR")), + ); + let _ = req + .context + .insert("my_key", "my_custom_attribute_from_context".to_string()) + .unwrap(); + Ok(SubgraphResponse::fake_builder() + .context(req.context) + .error( + Error::builder() + .message(String::from("an error occured")) + .extensions(extension) + .extension_code("FETCH_ERROR") + .build(), + ) + .build()) + }); + + let mut mock_subgraph_service_in_error = MockSubgraphService::new(); + mock_subgraph_service_in_error + .expect_call() + .times(1) + .returning(move |_req: SubgraphRequest| { + Err(Box::new(FetchError::SubrequestHttpError { + status_code: None, + service: String::from("my_subgraph_name_error"), + reason: String::from("cannot contact the subgraph"), + })) + }); + + let dyn_plugin: Box = crate::plugin::plugins() + .find(|factory| factory.name == "apollo.telemetry") + .expect("Plugin not found") + .create_instance( + &Value::from_str( + r#"{ + "apollo": { + "client_name_header": "name_header", + "client_version_header": "version_header", + "schema_id": "schema_sha" + }, + "metrics": { + "common": { + "service_name": "apollo-router", + "buckets": [5.0, 10.0, 20.0], + "attributes": { + "supergraph": { + "static": [ + { + "name": "myname", + "value": "label_value" + } + ], + "request": { + "header": [ + { + "named": "test", + "default": "default_value", + "rename": "renamed_value" + }, + { + "named": "another_test", + "default": "my_default_value" + } + ] + }, + "response": { + "header": [{ + "named": "x-custom" + }], + "body": [{ + "path": ".data.data.my_value", + "name": "my_value" + }] + } + }, + "subgraph": { + "all": { + "errors": { + "include_messages": true, + "extensions": [{ + "name": "subgraph_error_extended_code", + "path": ".code" + }, { + "name": "message", + "path": ".reason" + }] + } + }, + "subgraphs": { + "my_subgraph_name": { + "request": { + "body": [{ + "path": ".query", + "name": "query_from_request" + }, { + "path": ".data", + "name": "unknown_data", + "default": "default_value" + }, { + "path": ".data2", + "name": "unknown_data_bis" + }] + }, + "response": { + "body": [{ + "path": ".errors[0].extensions.status", + "name": "error" + }] + }, + "context": [ + { + "named": "my_key" + } + ] + } + } + } + } + }, + "prometheus": { + "enabled": true + } + } + }"#, + ) + .unwrap(), + Default::default(), + ) + .await + .unwrap(); + let mut supergraph_service = dyn_plugin.supergraph_service(BoxService::new(mock_service)); + let router_req = SupergraphRequest::fake_builder().header("test", "my_value_set"); + + let _router_response = supergraph_service + .ready() + .await + .unwrap() + .call(router_req.build().unwrap()) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + let mut bad_request_supergraph_service = + dyn_plugin.supergraph_service(BoxService::new(mock_bad_request_service)); + let router_req = SupergraphRequest::fake_builder().header("test", "my_value_set"); + + let _router_response = bad_request_supergraph_service + .ready() + .await + .unwrap() + .call(router_req.build().unwrap()) + .await + .unwrap() + .next_response() + .await + .unwrap(); + + let mut subgraph_service = + dyn_plugin.subgraph_service("my_subgraph_name", BoxService::new(mock_subgraph_service)); + let subgraph_req = SubgraphRequest::fake_builder() + .subgraph_request( + http_ext::Request::fake_builder() + .header("test", "my_value_set") + .body( + Request::fake_builder() + .query(String::from("query { test }")) + .build(), + ) + .build() + .unwrap(), + ) + .build(); + let _subgraph_response = subgraph_service + .ready() + .await + .unwrap() + .call(subgraph_req) + .await + .unwrap(); + // Another subgraph + let mut subgraph_service = dyn_plugin.subgraph_service( + "my_subgraph_name_error", + BoxService::new(mock_subgraph_service_in_error), + ); + let subgraph_req = SubgraphRequest::fake_builder() + .subgraph_request( + http_ext::Request::fake_builder() + .header("test", "my_value_set") + .body( + Request::fake_builder() + .query(String::from("query { test }")) + .build(), + ) + .build() + .unwrap(), + ) + .build(); + let _subgraph_response = subgraph_service + .ready() + .await + .unwrap() + .call(subgraph_req) + .await + .expect_err("Must be in error"); + + let http_req_prom = http::Request::get("http://localhost:9090/WRONG/URL/metrics") + .body(Default::default()) + .unwrap(); + let mut web_endpoint = dyn_plugin + .web_endpoints() + .into_iter() + .next() + .unwrap() + .1 + .into_iter() + .next() + .unwrap() + .into_router(); + let resp = web_endpoint + .ready() + .await + .unwrap() + .call(http_req_prom) + .await + .unwrap(); + assert_eq!(resp.status(), StatusCode::NOT_FOUND); + + let http_req_prom = http::Request::get("http://localhost:9090/metrics") + .body(Default::default()) + .unwrap(); + let mut resp = web_endpoint.oneshot(http_req_prom).await.unwrap(); + assert_eq!(resp.status(), StatusCode::OK); + let body = hyper::body::to_bytes(resp.body_mut()).await.unwrap(); + let prom_metrics = String::from_utf8_lossy(&body) + .to_string() + .split('\n') + .filter(|l| l.contains("bucket") && !l.contains("apollo_router_span_count")) + .sorted() + .join("\n"); + assert_snapshot!(prom_metrics); + } + #[test] fn it_test_send_headers_to_studio() { let fw_headers = ForwardHeaders::Only(vec![ diff --git a/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__tests__it_test_prometheus_metrics_custom_buckets.snap b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__tests__it_test_prometheus_metrics_custom_buckets.snap new file mode 100644 index 00000000000..a973b2aaaed --- /dev/null +++ b/apollo-router/src/plugins/telemetry/snapshots/apollo_router__plugins__telemetry__tests__it_test_prometheus_metrics_custom_buckets.snap @@ -0,0 +1,20 @@ +--- +source: apollo-router/src/plugins/telemetry/mod.rs +expression: prom_metrics +--- +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",error="400 Bad Request",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="400",le="+Inf"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",error="400 Bad Request",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="400",le="10"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",error="400 Bad Request",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="400",le="20"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",error="400 Bad Request",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="400",le="5"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",my_value="2",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="200",x_custom="coming_from_header",le="+Inf"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",my_value="2",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="200",x_custom="coming_from_header",le="10"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",my_value="2",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="200",x_custom="coming_from_header",le="20"} 1 +apollo_router_http_request_duration_seconds_bucket{another_test="my_default_value",my_value="2",myname="label_value",renamed_value="my_value_set",service_name="apollo-router",status="200",x_custom="coming_from_header",le="5"} 1 +apollo_router_http_request_duration_seconds_bucket{error="INTERNAL_SERVER_ERROR",my_key="my_custom_attribute_from_context",query_from_request="query { test }",service_name="apollo-router",status="200",subgraph="my_subgraph_name",unknown_data="default_value",le="+Inf"} 1 +apollo_router_http_request_duration_seconds_bucket{error="INTERNAL_SERVER_ERROR",my_key="my_custom_attribute_from_context",query_from_request="query { test }",service_name="apollo-router",status="200",subgraph="my_subgraph_name",unknown_data="default_value",le="10"} 1 +apollo_router_http_request_duration_seconds_bucket{error="INTERNAL_SERVER_ERROR",my_key="my_custom_attribute_from_context",query_from_request="query { test }",service_name="apollo-router",status="200",subgraph="my_subgraph_name",unknown_data="default_value",le="20"} 1 +apollo_router_http_request_duration_seconds_bucket{error="INTERNAL_SERVER_ERROR",my_key="my_custom_attribute_from_context",query_from_request="query { test }",service_name="apollo-router",status="200",subgraph="my_subgraph_name",unknown_data="default_value",le="5"} 1 +apollo_router_http_request_duration_seconds_bucket{message="cannot contact the subgraph",service_name="apollo-router",status="500",subgraph="my_subgraph_name_error",subgraph_error_extended_code="SUBREQUEST_HTTP_ERROR",le="+Inf"} 1 +apollo_router_http_request_duration_seconds_bucket{message="cannot contact the subgraph",service_name="apollo-router",status="500",subgraph="my_subgraph_name_error",subgraph_error_extended_code="SUBREQUEST_HTTP_ERROR",le="10"} 1 +apollo_router_http_request_duration_seconds_bucket{message="cannot contact the subgraph",service_name="apollo-router",status="500",subgraph="my_subgraph_name_error",subgraph_error_extended_code="SUBREQUEST_HTTP_ERROR",le="20"} 1 +apollo_router_http_request_duration_seconds_bucket{message="cannot contact the subgraph",service_name="apollo-router",status="500",subgraph="my_subgraph_name_error",subgraph_error_extended_code="SUBREQUEST_HTTP_ERROR",le="5"} 1 diff --git a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs index 8e233bfe73f..c0e913001c1 100644 --- a/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs +++ b/apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs @@ -556,11 +556,13 @@ fn extract_ftv1_trace( fn preprocess_errors(t: &mut proto::reports::trace::Node, error_config: &ErrorConfiguration) { if error_config.send { - t.error.iter_mut().for_each(|err| { - err.message = String::from(""); - err.location = Vec::new(); - err.json = String::new(); - }); + if error_config.redact { + t.error.iter_mut().for_each(|err| { + err.message = String::from(""); + err.location = Vec::new(); + err.json = String::new(); + }); + } } else { t.error = Vec::new(); } @@ -984,6 +986,48 @@ mod test { assert!(node.child[0].error[0].location.is_empty()); assert_eq!(node.child[0].error[0].message.as_str(), ""); assert_eq!(node.child[0].error[0].time_ns, 5u64); + + let sub_node = Node { + error: vec![Error { + message: "this is my error".to_string(), + location: Vec::new(), + time_ns: 5, + json: String::from(r#"{"foo": "bar"}"#), + }], + ..Default::default() + }; + let mut node = Node { + error: vec![ + Error { + message: "this is my error".to_string(), + location: Vec::new(), + time_ns: 5, + json: String::from(r#"{"foo": "bar"}"#), + }, + Error { + message: "this is my other error".to_string(), + location: Vec::new(), + time_ns: 5, + json: String::from(r#"{"foo": "bar"}"#), + }, + ], + ..Default::default() + }; + node.child.push(sub_node); + let error_config = ErrorConfiguration { + send: true, + redact: false, + }; + preprocess_errors(&mut node, &error_config); + assert_eq!(node.error[0].message.as_str(), "this is my error"); + assert_eq!(node.error[0].time_ns, 5u64); + assert!(!node.error[1].json.is_empty()); + assert_eq!(node.error[1].message.as_str(), "this is my other error"); + assert_eq!(node.error[1].time_ns, 5u64); + + assert!(!node.child[0].error[0].json.is_empty()); + assert_eq!(node.child[0].error[0].message.as_str(), "this is my error"); + assert_eq!(node.child[0].error[0].time_ns, 5u64); } #[test] diff --git a/apollo-router/src/query_planner/caching_query_planner.rs b/apollo-router/src/query_planner/caching_query_planner.rs index a1d6392021d..7b63c933c84 100644 --- a/apollo-router/src/query_planner/caching_query_planner.rs +++ b/apollo-router/src/query_planner/caching_query_planner.rs @@ -8,6 +8,8 @@ use std::task; use futures::future::BoxFuture; use router_bridge::planner::Planner; use router_bridge::planner::UsageReporting; +use sha2::Digest; +use sha2::Sha256; use tower::ServiceExt; use tracing::Instrument; @@ -251,12 +253,20 @@ pub(crate) struct CachingQueryKey { impl std::fmt::Display for CachingQueryKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let mut hasher = Sha256::new(); + hasher.update(&self.query); + let query = hex::encode(hasher.finalize()); + + let mut hasher = Sha256::new(); + hasher.update(self.operation.as_deref().unwrap_or("-")); + let operation = hex::encode(hasher.finalize()); + write!( f, - "plan\0{}\0{}\0{}", + "plan.{}.{}.{}", self.schema_id.as_deref().unwrap_or("-"), - self.query, - self.operation.as_deref().unwrap_or("-") + query, + operation ) } } diff --git a/apollo-router/src/request.rs b/apollo-router/src/request.rs index f8eaa3eab64..cbd3c3d75c5 100644 --- a/apollo-router/src/request.rs +++ b/apollo-router/src/request.rs @@ -1,4 +1,6 @@ +use bytes::Bytes; use derivative::Derivative; +use serde::de::DeserializeSeed; use serde::de::Error; use serde::Deserialize; use serde::Serialize; @@ -10,6 +12,8 @@ use crate::json_ext::Object; /// A GraphQL `Request` used to represent both supergraph and subgraph requests. #[derive(Clone, Derivative, Serialize, Deserialize, Default)] +// Note: if adding #[serde(deny_unknown_fields)], +// also remove `Fields::Other` in `DeserializeSeed` impl. #[serde(rename_all = "camelCase")] #[derivative(Debug, PartialEq, Eq, Hash)] #[non_exhaustive] @@ -78,6 +82,26 @@ where >::deserialize(deserializer).map(|x| x.unwrap_or_default()) } +fn as_object(value: Value, null_is_default: bool) -> Result { + use serde::de::Unexpected; + + let exp = if null_is_default { + "a map or null" + } else { + "a map" + }; + match value { + Value::Object(object) => Ok(object), + // Similar to `deserialize_null_default`: + Value::Null if null_is_default => Ok(Object::default()), + Value::Null => Err(E::invalid_type(Unexpected::Unit, &exp)), + Value::Bool(value) => Err(E::invalid_type(Unexpected::Bool(value), &exp)), + Value::Number(_) => Err(E::invalid_type(Unexpected::Other("a number"), &exp)), + Value::String(value) => Err(E::invalid_type(Unexpected::Str(value.as_str()), &exp)), + Value::Array(_) => Err(E::invalid_type(Unexpected::Seq, &exp)), + } +} + #[buildstructor::buildstructor] impl Request { #[builder(visibility = "pub")] @@ -129,6 +153,13 @@ impl Request { } } + /// Deserialize as JSON from `&Bytes`, avoiding string copies where possible + pub fn deserialize_from_bytes(data: &Bytes) -> Result { + let seed = RequestFromBytesSeed(data); + let mut de = serde_json::Deserializer::from_slice(data); + seed.deserialize(&mut de) + } + /// Convert encoded URL query string parameters (also known as "search /// params") into a GraphQL [`Request`]. /// @@ -182,6 +213,95 @@ fn get_from_urldecoded<'a, T: Deserialize<'a>>( } } +struct RequestFromBytesSeed<'data>(&'data Bytes); + +impl<'data, 'de> DeserializeSeed<'de> for RequestFromBytesSeed<'data> { + type Value = Request; + + fn deserialize(self, deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + #[derive(serde::Deserialize)] + #[serde(field_identifier, rename_all = "camelCase")] + enum Field { + Query, + OperationName, + Variables, + Extensions, + #[serde(other)] + Other, + } + + const FIELDS: &[&str] = &["query", "operationName", "variables", "extensions"]; + + struct RequestVisitor<'data>(&'data Bytes); + + impl<'data, 'de> serde::de::Visitor<'de> for RequestVisitor<'data> { + type Value = Request; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a GraphQL request") + } + + fn visit_map(self, mut map: V) -> Result + where + V: serde::de::MapAccess<'de>, + { + let mut query = None; + let mut operation_name = None; + let mut variables = None; + let mut extensions = None; + while let Some(key) = map.next_key()? { + match key { + Field::Query => { + if query.is_some() { + return Err(Error::duplicate_field("query")); + } + query = Some(map.next_value()?); + } + Field::OperationName => { + if operation_name.is_some() { + return Err(Error::duplicate_field("operationName")); + } + operation_name = Some(map.next_value()?); + } + Field::Variables => { + if variables.is_some() { + return Err(Error::duplicate_field("variables")); + } + let seed = serde_json_bytes::value::BytesSeed::new(self.0); + let value = map.next_value_seed(seed)?; + let null_is_default = true; + variables = Some(as_object(value, null_is_default)?); + } + Field::Extensions => { + if extensions.is_some() { + return Err(Error::duplicate_field("extensions")); + } + let seed = serde_json_bytes::value::BytesSeed::new(self.0); + let value = map.next_value_seed(seed)?; + let null_is_default = false; + extensions = Some(as_object(value, null_is_default)?); + } + Field::Other => { + let _: serde::de::IgnoredAny = map.next_value()?; + } + } + } + Ok(Request { + query: query.unwrap_or_default(), + operation_name: operation_name.unwrap_or_default(), + variables: variables.unwrap_or_default(), + extensions: extensions.unwrap_or_default(), + }) + } + } + + deserializer.deserialize_struct("Request", FIELDS, RequestVisitor(self.0)) + } +} + #[cfg(test)] mod tests { use serde_json::json; diff --git a/apollo-router/src/router.rs b/apollo-router/src/router.rs index e90ef6a34ac..b6b333a724d 100644 --- a/apollo-router/src/router.rs +++ b/apollo-router/src/router.rs @@ -19,12 +19,18 @@ use derivative::Derivative; use derive_more::Display; use derive_more::From; use displaydoc::Display as DisplayDoc; +#[cfg(test)] +use futures::channel::mpsc; +#[cfg(test)] +use futures::channel::mpsc::SendError; use futures::channel::oneshot; use futures::prelude::*; use futures::FutureExt; use http_body::Body as _; use hyper::Body; use thiserror::Error; +#[cfg(test)] +use tokio::sync::Notify; use tokio::sync::RwLock; use tokio::task::spawn; use tokio_util::time::DelayQueue; @@ -952,6 +958,86 @@ fn generate_event_stream( stream } +#[cfg(test)] +struct TestRouterHttpServer { + router_http_server: RouterHttpServer, + event_sender: mpsc::UnboundedSender, + state_machine_update_notifier: Arc, +} + +#[cfg(test)] +impl TestRouterHttpServer { + fn new() -> Self { + let (event_sender, event_receiver) = mpsc::unbounded(); + let state_machine_update_notifier = Arc::new(Notify::new()); + + let server_factory = AxumHttpServerFactory::new(); + let router_factory: OrbiterRouterSuperServiceFactory = + OrbiterRouterSuperServiceFactory::new(YamlRouterFactory::default()); + let state_machine = StateMachine::for_tests( + server_factory, + router_factory, + Arc::clone(&state_machine_update_notifier), + ); + + let listen_addresses = state_machine.listen_addresses.clone(); + let result = spawn( + async move { state_machine.process_events(event_receiver).await } + .with_current_subscriber(), + ) + .map(|r| match r { + Ok(Ok(ok)) => Ok(ok), + Ok(Err(err)) => Err(err), + Err(err) => { + tracing::error!("{}", err); + Err(ApolloRouterError::StartupError) + } + }) + .with_current_subscriber() + .boxed(); + + TestRouterHttpServer { + router_http_server: RouterHttpServer { + result, + shutdown_sender: None, + listen_addresses, + }, + event_sender, + state_machine_update_notifier, + } + } + + async fn request( + &self, + request: crate::graphql::Request, + ) -> Result { + Ok(reqwest::Client::new() + .post(format!("{}/", self.listen_address().await.unwrap())) + .json(&request) + .send() + .await + .expect("couldn't send request") + .json() + .await + .expect("couldn't deserialize into json")) + } + + async fn listen_address(&self) -> Option { + self.router_http_server.listen_address().await + } + + async fn send_event(&mut self, event: Event) -> Result<(), SendError> { + let result = self.event_sender.send(event).await; + self.state_machine_update_notifier.notified().await; + result + } + + async fn shutdown(mut self) -> Result<(), ApolloRouterError> { + self.send_event(Event::Shutdown).await.unwrap(); + self.router_http_server.shutdown().await + } +} + #[cfg(test)] mod tests { use std::env::temp_dir; @@ -1143,4 +1229,166 @@ mod tests { assert!(matches!(stream.next().await.unwrap(), UpdateSchema(_))); assert!(matches!(stream.next().await.unwrap(), NoMoreSchema)); } + + #[tokio::test(flavor = "multi_thread")] + async fn basic_event_stream_test() { + let mut router_handle = TestRouterHttpServer::new(); + + let configuration = + Configuration::from_str(include_str!("testdata/supergraph_config.router.yaml")) + .unwrap(); + let schema = include_str!("testdata/supergraph.graphql"); + + // let's push a valid configuration to the state machine, so it can start up + router_handle + .send_event(UpdateConfiguration(configuration)) + .await + .unwrap(); + router_handle + .send_event(UpdateSchema(schema.to_string())) + .await + .unwrap(); + router_handle + .send_event(UpdateEntitlement(EntitlementState::Unentitled)) + .await + .unwrap(); + + let request = Request::builder().query(r#"{ me { username } }"#).build(); + + let response = router_handle.request(request).await.unwrap(); + assert_eq!( + "@ada", + response + .data + .unwrap() + .get("me") + .unwrap() + .get("username") + .unwrap() + ); + + // shut the router down + router_handle + .send_event(Event::NoMoreConfiguration) + .await + .unwrap(); + router_handle.send_event(Event::NoMoreSchema).await.unwrap(); + router_handle.send_event(Event::Shutdown).await.unwrap(); + } + + #[tokio::test(flavor = "multi_thread")] + async fn schema_update_test() { + let mut router_handle = TestRouterHttpServer::new(); + // let's push a valid configuration to the state machine, so it can start up + router_handle + .send_event(UpdateConfiguration( + Configuration::from_str(include_str!("testdata/supergraph_config.router.yaml")) + .unwrap(), + )) + .await + .unwrap(); + router_handle + .send_event(UpdateSchema( + include_str!("testdata/supergraph_missing_name.graphql").to_string(), + )) + .await + .unwrap(); + router_handle + .send_event(UpdateEntitlement(EntitlementState::Unentitled)) + .await + .unwrap(); + + // let's send a valid query + let request = Request::builder().query(r#"{ me { username } }"#).build(); + let response = router_handle.request(request).await.unwrap(); + + assert_eq!( + "@ada", + response + .data + .unwrap() + .get("me") + .unwrap() + .get("username") + .unwrap() + ); + + // the name field is not present yet + let request = Request::builder() + .query(r#"{ me { username name } }"#) + .build(); + let response = router_handle.request(request).await.unwrap(); + + assert_eq!( + "cannot query field 'name' on type 'User'", + response.errors[0].message + ); + assert_eq!( + "INVALID_FIELD", + response.errors[0].extensions.get("code").unwrap() + ); + + // let's update the schema to add the field + router_handle + .send_event(UpdateSchema( + include_str!("testdata/supergraph.graphql").to_string(), + )) + .await + .unwrap(); + + // the request should now make it through + let request = Request::builder() + .query(r#"{ me { username name } }"#) + .build(); + + let response = router_handle.request(request).await.unwrap(); + + assert_eq!( + "Ada Lovelace", + response + .data + .unwrap() + .get("me") + .unwrap() + .get("name") + .unwrap() + ); + + // let's go back and remove the field + router_handle + .send_event(UpdateSchema( + include_str!("testdata/supergraph_missing_name.graphql").to_string(), + )) + .await + .unwrap(); + + let request = Request::builder().query(r#"{ me { username } }"#).build(); + let response = router_handle.request(request).await.unwrap(); + + assert_eq!( + "@ada", + response + .data + .unwrap() + .get("me") + .unwrap() + .get("username") + .unwrap() + ); + + let request = Request::builder() + .query(r#"{ me { username name } }"#) + .build(); + let response = router_handle.request(request).await.unwrap(); + + assert_eq!( + "cannot query field 'name' on type 'User'", + response.errors[0].message + ); + assert_eq!( + "INVALID_FIELD", + response.errors[0].extensions.get("code").unwrap() + ); + router_handle.shutdown().await.unwrap(); + } } diff --git a/apollo-router/src/services/external.rs b/apollo-router/src/services/external.rs index d137fcd4a47..42b59d8bfbb 100644 --- a/apollo-router/src/services/external.rs +++ b/apollo-router/src/services/external.rs @@ -66,7 +66,6 @@ impl Control { } } -// TODO: Builder #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct Externalizable { @@ -96,10 +95,85 @@ pub(crate) struct Externalizable { pub(crate) status_code: Option, } +#[buildstructor::buildstructor] impl Externalizable where T: Debug + DeserializeOwned + Serialize + Send + Sync, { + #[builder(visibility = "pub(crate)")] + /// This is the constructor (or builder) to use when constructing a Router + /// `Externalizable`. + /// + fn router_new( + stage: PipelineStep, + control: Option, + id: Option, + headers: Option>>, + body: Option, + context: Option, + status_code: Option, + method: Option, + path: Option, + sdl: Option, + ) -> Self { + assert!(matches!( + stage, + PipelineStep::RouterRequest | PipelineStep::RouterResponse + )); + Externalizable { + version: EXTERNALIZABLE_VERSION, + stage: stage.to_string(), + control, + id, + headers, + body, + context, + status_code, + sdl, + uri: None, + path, + method, + service_name: None, + } + } + + #[builder(visibility = "pub(crate)")] + /// This is the constructor (or builder) to use when constructing a Subgraph + /// `Externalizable`. + /// + fn subgraph_new( + stage: PipelineStep, + control: Option, + id: Option, + headers: Option>>, + body: Option, + context: Option, + status_code: Option, + method: Option, + service_name: Option, + uri: Option, + ) -> Self { + assert!(matches!( + stage, + PipelineStep::SubgraphRequest | PipelineStep::SubgraphResponse + )); + Externalizable { + version: EXTERNALIZABLE_VERSION, + stage: stage.to_string(), + control, + id, + headers, + body, + context, + status_code, + sdl: None, + uri, + path: None, + method, + service_name, + } + } + pub(crate) async fn call(self, mut client: C, uri: &str) -> Result where C: Service, Response = hyper::Response, Error = BoxError> @@ -131,3 +205,50 @@ where .and_then(|bytes| serde_json::from_slice(&bytes).map_err(BoxError::from)) } } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn it_will_build_router_externalizable_correctly() { + Externalizable::::router_builder() + .stage(PipelineStep::RouterRequest) + .build(); + Externalizable::::router_builder() + .stage(PipelineStep::RouterResponse) + .build(); + } + + #[test] + #[should_panic] + fn it_will_not_build_router_externalizable_incorrectly() { + Externalizable::::router_builder() + .stage(PipelineStep::SubgraphRequest) + .build(); + Externalizable::::router_builder() + .stage(PipelineStep::SubgraphResponse) + .build(); + } + + #[test] + fn it_will_build_subgraph_externalizable_correctly() { + Externalizable::::subgraph_builder() + .stage(PipelineStep::SubgraphRequest) + .build(); + Externalizable::::subgraph_builder() + .stage(PipelineStep::SubgraphResponse) + .build(); + } + + #[test] + #[should_panic] + fn it_will_not_build_subgraph_externalizable_incorrectly() { + Externalizable::::subgraph_builder() + .stage(PipelineStep::RouterRequest) + .build(); + Externalizable::::subgraph_builder() + .stage(PipelineStep::RouterResponse) + .build(); + } +} diff --git a/apollo-router/src/services/router_service.rs b/apollo-router/src/services/router_service.rs index 8f166c719af..3936b101f87 100644 --- a/apollo-router/src/services/router_service.rs +++ b/apollo-router/src/services/router_service.rs @@ -7,7 +7,6 @@ use std::task::Poll; use axum::body::StreamBody; use axum::response::*; -use bytes::Buf; use bytes::Bytes; use futures::future::ready; use futures::future::BoxFuture; @@ -247,7 +246,7 @@ where } }) .and_then(|bytes| { - serde_json::from_reader(bytes.reader()).map_err(|err| { + graphql::Request::deserialize_from_bytes(&bytes).map_err(|err| { ( StatusCode::BAD_REQUEST, "failed to deserialize the request body into JSON", diff --git a/apollo-router/src/state_machine.rs b/apollo-router/src/state_machine.rs index 3d836e66cee..a90ea770c58 100644 --- a/apollo-router/src/state_machine.rs +++ b/apollo-router/src/state_machine.rs @@ -6,6 +6,8 @@ use std::sync::Arc; use futures::prelude::*; use tokio::sync::mpsc; +#[cfg(test)] +use tokio::sync::Notify; use tokio::sync::OwnedRwLockWriteGuard; use tokio::sync::RwLock; use ApolloRouterError::ServiceCreationError; @@ -385,6 +387,8 @@ where router_configurator: FA, pub(crate) listen_addresses: Arc>, listen_addresses_guard: Option>, + #[cfg(test)] + notify_updated: Arc, } impl StateMachine @@ -407,6 +411,31 @@ where router_configurator: router_factory, listen_addresses, listen_addresses_guard, + #[cfg(test)] + notify_updated: Default::default(), + } + } + + #[cfg(test)] + pub(crate) fn for_tests( + http_server_factory: S, + router_factory: FA, + notify_updated: Arc, + ) -> Self { + // Listen address is created locked so that if a consumer tries to examine the listen address before the state machine has reached running state they are blocked. + let listen_addresses: Arc> = Default::default(); + let listen_addresses_guard = Some( + listen_addresses + .clone() + .try_write_owned() + .expect("lock just created, qed"), + ); + Self { + http_server_factory, + router_configurator: router_factory, + listen_addresses, + listen_addresses_guard, + notify_updated, } } @@ -452,12 +481,16 @@ where NoMoreEntitlement => state.no_more_entitlement().await, Shutdown => state.shutdown().await, }; + + #[cfg(test)] + self.notify_updated.notify_one(); + tracing::debug!( "state machine event: {event_name}, transitioned from: {last_state} to: {state:?}" ); // If we've errored then exit even if there are potentially more messages - if matches!(&state, Errored(_)) { + if matches!(&state, Stopped | Errored(_)) { break; } } @@ -522,7 +555,12 @@ mod tests { let router_factory = create_mock_router_configurator(0); let (server_factory, _) = create_mock_server_factory(0); assert_matches!( - execute(server_factory, router_factory, vec![NoMoreConfiguration],).await, + execute( + server_factory, + router_factory, + stream::iter(vec![NoMoreConfiguration]) + ) + .await, Err(NoConfiguration) ); } @@ -532,7 +570,12 @@ mod tests { let router_factory = create_mock_router_configurator(0); let (server_factory, _) = create_mock_server_factory(0); assert_matches!( - execute(server_factory, router_factory, vec![NoMoreSchema],).await, + execute( + server_factory, + router_factory, + stream::iter(vec![NoMoreSchema]) + ) + .await, Err(NoSchema) ); } @@ -542,7 +585,12 @@ mod tests { let router_factory = create_mock_router_configurator(0); let (server_factory, _) = create_mock_server_factory(0); assert_matches!( - execute(server_factory, router_factory, vec![NoMoreEntitlement],).await, + execute( + server_factory, + router_factory, + stream::iter(vec![NoMoreEntitlement]) + ) + .await, Err(NoEntitlement) ); } @@ -562,12 +610,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(test_config_restricted()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::Entitled), Shutdown - ], + ]) ) .await, Ok(()) @@ -584,12 +632,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(test_config_restricted()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::EntitledHalt), Shutdown - ], + ]) ) .await, Ok(()) @@ -606,12 +654,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(test_config_restricted()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::EntitledWarn), Shutdown - ], + ]) ) .await, Ok(()) @@ -629,14 +677,14 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(test_config_restricted()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::Entitled), UpdateEntitlement(EntitlementState::Unentitled), UpdateConfiguration(test_config_restricted()), Shutdown - ], + ]) ) .await, Ok(()) @@ -653,12 +701,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(test_config_restricted()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::Unentitled), Shutdown - ], + ]) ) .await, Err(ApolloRouterError::EntitlementViolation) @@ -675,14 +723,14 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::Unentitled), UpdateConfiguration(test_config_restricted()), UpdateEntitlement(EntitlementState::Entitled), Shutdown - ], + ]) ) .await, Ok(()) @@ -703,7 +751,7 @@ mod tests { let router_factory = create_mock_router_configurator(0); let (server_factory, _) = create_mock_server_factory(0); assert_matches!( - execute(server_factory, router_factory, vec![Shutdown],).await, + execute(server_factory, router_factory, stream::iter(vec![Shutdown])).await, Ok(()) ); } @@ -717,12 +765,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), Shutdown - ], + ]) ) .await, Ok(()) @@ -739,13 +787,13 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(minimal_schema.to_owned()), UpdateEntitlement(EntitlementState::default()), UpdateSchema(example_schema()), Shutdown - ], + ]) ) .await, Ok(()) @@ -762,13 +810,13 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(minimal_schema.to_owned()), UpdateEntitlement(EntitlementState::default()), UpdateEntitlement(EntitlementState::default()), Shutdown - ], + ]) ) .await, Ok(()) @@ -785,7 +833,7 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), @@ -800,7 +848,7 @@ mod tests { .unwrap() ), Shutdown - ], + ]) ) .await, Ok(()) @@ -817,12 +865,12 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), Shutdown - ], + ]) ) .await, Ok(()) @@ -844,11 +892,11 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), - ], + ]) ) .await, Err(ApolloRouterError::ServiceCreationError(_)) @@ -882,13 +930,13 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), UpdateSchema(example_schema()), Shutdown - ], + ]) ) .await, Ok(()) @@ -933,7 +981,7 @@ mod tests { execute( server_factory, router_factory, - vec![ + stream::iter(vec![ UpdateConfiguration(Configuration::builder().build().unwrap()), UpdateSchema(example_schema()), UpdateEntitlement(EntitlementState::default()), @@ -945,7 +993,7 @@ mod tests { ), UpdateSchema(example_schema()), Shutdown - ], + ]), ) .await, Ok(()) @@ -1051,12 +1099,10 @@ mod tests { async fn execute( server_factory: MockMyHttpServerFactory, router_factory: MockMyRouterConfigurator, - events: Vec, + events: impl Stream + Unpin, ) -> Result<(), ApolloRouterError> { let state_machine = StateMachine::new(server_factory, router_factory); - state_machine - .process_events(stream::iter(events).boxed()) - .await + state_machine.process_events(events).await } fn create_mock_server_factory( diff --git a/apollo-router/src/testdata/supergraph.graphql b/apollo-router/src/testdata/supergraph.graphql index d9e761cd446..9a64dd4358f 100644 --- a/apollo-router/src/testdata/supergraph.graphql +++ b/apollo-router/src/testdata/supergraph.graphql @@ -18,10 +18,10 @@ directive @join__graph(name: String!, url: String!) on ENUM_VALUE scalar join__FieldSet enum join__Graph { - ACCOUNTS @join__graph(name: "accounts" url: "http://localhost:4001/graphql") - INVENTORY @join__graph(name: "inventory" url: "http://localhost:4004/graphql") - PRODUCTS @join__graph(name: "products" url: "http://localhost:4003/graphql") - REVIEWS @join__graph(name: "reviews" url: "http://localhost:4002/graphql") + ACCOUNTS @join__graph(name: "accounts" url: "https://accounts.demo.starstuff.dev/") + INVENTORY @join__graph(name: "inventory" url: "https://inventory.demo.starstuff.dev/") + PRODUCTS @join__graph(name: "products" url: "https://products.demo.starstuff.dev/") + REVIEWS @join__graph(name: "reviews" url: "https://reviews.demo.starstuff.dev/") } type Product diff --git a/apollo-router/src/testdata/supergraph_missing_name.graphql b/apollo-router/src/testdata/supergraph_missing_name.graphql new file mode 100644 index 00000000000..6b21b4f4e7d --- /dev/null +++ b/apollo-router/src/testdata/supergraph_missing_name.graphql @@ -0,0 +1,65 @@ +schema + @core(feature: "https://specs.apollo.dev/core/v0.1"), + @core(feature: "https://specs.apollo.dev/join/v0.1") +{ + query: Query +} + +directive @core(feature: String!) repeatable on SCHEMA + +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet) on FIELD_DEFINITION + +directive @join__type(graph: join__Graph!, key: join__FieldSet) repeatable on OBJECT | INTERFACE + +directive @join__owner(graph: join__Graph!) on OBJECT | INTERFACE + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +scalar join__FieldSet + +enum join__Graph { + ACCOUNTS @join__graph(name: "accounts" url: "https://accounts.demo.starstuff.dev/") + INVENTORY @join__graph(name: "inventory" url: "https://inventory.demo.starstuff.dev/") + PRODUCTS @join__graph(name: "products" url: "https://products.demo.starstuff.dev/") + REVIEWS @join__graph(name: "reviews" url: "https://reviews.demo.starstuff.dev/") +} + +type Product + @join__owner(graph: PRODUCTS) + @join__type(graph: PRODUCTS, key: "upc") + @join__type(graph: INVENTORY, key: "upc") + @join__type(graph: REVIEWS, key: "upc") +{ + upc: String! @join__field(graph: PRODUCTS) + name: String @join__field(graph: PRODUCTS) + price: Int @join__field(graph: PRODUCTS) + weight: Int @join__field(graph: PRODUCTS) + inStock: Boolean @join__field(graph: INVENTORY) + shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") + reviews: [Review] @join__field(graph: REVIEWS) +} + +type Query { + me: User @join__field(graph: ACCOUNTS) + topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) +} + +type Review + @join__owner(graph: REVIEWS) + @join__type(graph: REVIEWS, key: "id") +{ + id: ID! @join__field(graph: REVIEWS) + body: String @join__field(graph: REVIEWS) + author: User @join__field(graph: REVIEWS, provides: "username") + product: Product @join__field(graph: REVIEWS) +} + +type User + @join__owner(graph: ACCOUNTS) + @join__type(graph: ACCOUNTS, key: "id") + @join__type(graph: REVIEWS, key: "id") +{ + id: ID! @join__field(graph: ACCOUNTS) + username: String @join__field(graph: ACCOUNTS) + reviews: [Review] @join__field(graph: REVIEWS) +} diff --git a/apollo-router/src/uplink/mod.rs b/apollo-router/src/uplink/mod.rs index 3a6801be426..bdcb9df3e0d 100644 --- a/apollo-router/src/uplink/mod.rs +++ b/apollo-router/src/uplink/mod.rs @@ -418,40 +418,6 @@ mod test { } } - #[test] - #[cfg(not(windows))] // Don’t bother with line ending differences - fn test_uplink_schema_is_up_to_date() { - use std::path::PathBuf; - - use introspector_gadget::blocking::GraphQLClient; - use introspector_gadget::introspect; - use introspector_gadget::introspect::GraphIntrospectInput; - - let client = GraphQLClient::new( - "https://uplink.api.apollographql.com/", - reqwest::blocking::Client::new(), - ); - - let should_retry = true; - let introspection_response = introspect::run( - GraphIntrospectInput { - headers: Default::default(), - }, - &client, - should_retry, - ) - .unwrap(); - if introspection_response.schema_sdl != include_str!("uplink.graphql") { - let path = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("uplink.graphql"); - std::fs::write(&path, introspection_response.schema_sdl).unwrap(); - panic!( - "\n\nUplink schema is out of date. Run this command to update it:\n\n \ - mv {} apollo-router/src/uplink/uplink.graphql\n\n", - path.to_str().unwrap() - ); - } - } - #[test] fn test_round_robin_endpoints() { let url1 = Url::parse("http://example1.com").expect("url must be valid"); diff --git a/apollo-router/tests/redis_test.rs b/apollo-router/tests/redis_test.rs index dd361eb1cba..fccd0a93fe9 100644 --- a/apollo-router/tests/redis_test.rs +++ b/apollo-router/tests/redis_test.rs @@ -22,7 +22,7 @@ mod test { .expect("got redis connection"); connection - .del::<&'static str, ()>("plan\x005abb5fecf7df056396fb90fdf38d430b8c1fec55ec132fde878161608af18b76\x00{ topProducts { name name2:name } }\x00-").await.unwrap(); + .del::<&'static str, ()>("plan.5abb5fecf7df056396fb90fdf38d430b8c1fec55ec132fde878161608af18b76.4c45433039407593557f8a982dafd316a66ec03f0e1ed5fa1b7ef8060d76e8ec.3973e022e93220f9212c18d0d0c543ae7c309e46640da93a4a0314de999f5112").await.unwrap(); let supergraph = apollo_router::TestHarness::builder() .with_subgraph_network_requests() @@ -52,7 +52,7 @@ mod test { let _ = supergraph.oneshot(request).await?.next_response().await; let s:String = connection - .get("plan\x005abb5fecf7df056396fb90fdf38d430b8c1fec55ec132fde878161608af18b76\x00{ topProducts { name name2:name } }\x00-") + .get("plan.5abb5fecf7df056396fb90fdf38d430b8c1fec55ec132fde878161608af18b76.4c45433039407593557f8a982dafd316a66ec03f0e1ed5fa1b7ef8060d76e8ec.3973e022e93220f9212c18d0d0c543ae7c309e46640da93a4a0314de999f5112") .await .unwrap(); let query_plan_res: serde_json::Value = serde_json::from_str(&s).unwrap(); diff --git a/dockerfiles/Dockerfile.router b/dockerfiles/Dockerfile.router index f8b634cde07..55897acb387 100644 --- a/dockerfiles/Dockerfile.router +++ b/dockerfiles/Dockerfile.router @@ -1,15 +1,29 @@ -FROM debian:bullseye-slim - +FROM debian:bullseye-slim AS downloader ARG ROUTER_RELEASE=latest + +# Install curl +RUN \ + apt-get update -y \ + && apt-get install -y \ + curl + +WORKDIR /dist + +# Run the Router downloader which puts Router into current working directory +RUN curl -sSL https://router.apollo.dev/download/nix/${ROUTER_RELEASE}/ | sh + +FROM debian:bullseye-slim AS distro ARG DEBUG_IMAGE=false WORKDIR /dist -# Install curl +COPY --from=downloader /dist/router /dist + +# Update apt and install ca-certificates RUN \ apt-get update -y \ && apt-get install -y \ - curl + ca-certificates # If debug image, install heaptrack and make a data directory RUN \ @@ -21,9 +35,6 @@ RUN \ # Clean up apt lists RUN rm -rf /var/lib/apt/lists/* -# Run the Router downloader which puts Router into current working directory -RUN curl -sSL https://router.apollo.dev/download/nix/${ROUTER_RELEASE}/ | sh - # Make directories for config and schema RUN mkdir config schema diff --git a/dockerfiles/diy/dockerfiles/Dockerfile.repo b/dockerfiles/diy/dockerfiles/Dockerfile.repo index 63a5e41a8fc..0892d53c7f2 100644 --- a/dockerfiles/diy/dockerfiles/Dockerfile.repo +++ b/dockerfiles/diy/dockerfiles/Dockerfile.repo @@ -36,11 +36,11 @@ ARG DEBUG_IMAGE=false WORKDIR /dist -# Install curl +# Update apt and install ca-certificates RUN \ apt-get update -y \ && apt-get install -y \ - curl + ca-certificates # Copy in the required files from our build image COPY --from=build --chown=root:root /dist /dist diff --git a/dockerfiles/tracing/datadog-subgraph/package-lock.json b/dockerfiles/tracing/datadog-subgraph/package-lock.json index 12f38d9c43f..df2b4519cf8 100644 --- a/dockerfiles/tracing/datadog-subgraph/package-lock.json +++ b/dockerfiles/tracing/datadog-subgraph/package-lock.json @@ -17,7 +17,7 @@ "graphql": "^16.5.0" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } }, "node_modules/@apollo/cache-control-types": { @@ -203,29 +203,53 @@ } }, "node_modules/@datadog/native-appsec": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@datadog/native-appsec/-/native-appsec-1.2.1.tgz", - "integrity": "sha512-jF+k7xhBmJIYYLtjvhCey08RBbItTG7O2zcSCDGFffhvCvo3ZOoou+IKtAm9z+U7hOoeOmD+Xg+h29xj/BB9MA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@datadog/native-appsec/-/native-appsec-3.2.0.tgz", + "integrity": "sha512-biAa7EFfuavjSWgSQaCit9CqGzr6Af5nhzfNNGJ38Y/Y387hDvLivAR374kK1z6XoxGZEOa+XPbVogmV/2Bcjw==", "hasInstallScript": true, "dependencies": { - "detect-libc": "^1.0.3", - "minimist": "^1.2.6", - "tar": "^6.1.11" - }, - "bin": { - "appsec-reinstall": "bin/appsec-reinstall.js" + "node-gyp-build": "^3.9.0" }, "engines": { "node": ">=12" } }, + "node_modules/@datadog/native-iast-rewriter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.0.1.tgz", + "integrity": "sha512-Mm+FG3XxEbPrAfJQPOMHts7iZZXRvg9gnGeeFRGkyirmRcQcOpZO4wFe/8K61DUVa5pXpgAJQ2ZkBGYF1O9STg==", + "dependencies": { + "node-gyp-build": "^4.5.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@datadog/native-iast-rewriter/node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/@datadog/native-iast-taint-tracking": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-1.4.1.tgz", + "integrity": "sha512-wWJebnK5fADXGGwmoHi9ElMsvR/M4IZpRxBxzAfKU2WI1GRkCvSxQBhbIFUTQEuO7l6ZOpASWQ9yUXK3cx8n+w==", + "dependencies": { + "node-gyp-build": "^3.9.0" + } + }, "node_modules/@datadog/native-metrics": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@datadog/native-metrics/-/native-metrics-1.4.2.tgz", - "integrity": "sha512-ExSIZCEo3pXTNQRuyQllIa+0pc2bVDOntlx0JMnu7+GjeEjJxGyVLw8tTx5EQUmHSLt0Jm7aeMW63C8DJnO27A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@datadog/native-metrics/-/native-metrics-2.0.0.tgz", + "integrity": "sha512-YklGVwUtmKGYqFf1MNZuOHvTYdKuR4+Af1XkWcMD8BwOAjxmd9Z+97328rCOY8TFUJzlGUPaXzB8j2qgG/BMwA==", "hasInstallScript": true, "dependencies": { - "nan": "^2.15.0", + "node-addon-api": "^6.1.0", "node-gyp-build": "^3.9.0" }, "engines": { @@ -233,20 +257,16 @@ } }, "node_modules/@datadog/pprof": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-1.0.2.tgz", - "integrity": "sha512-AMTK55W3Aa2QX2X8mN9SQfDGw3HvwIK9Or8pXQFss+kjtH5pCkO9oqE5838MeXgRh9BR8HWrjAQE3Ji7FRCK2g==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-2.2.1.tgz", + "integrity": "sha512-kPxN9ADjajUEU1zRtVqLT/q5AP8Ge7S1R1UkpUlKOzNgBznFXmNzhTtQqGhB8ew6LPssfIQTDVd/rBIcJvuMOw==", "hasInstallScript": true, "dependencies": { "delay": "^5.0.0", - "findit2": "^2.2.3", - "nan": "^2.16.0", "node-gyp-build": "^3.9.0", "p-limit": "^3.1.0", "pify": "^5.0.0", - "protobufjs": "^7.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", + "pprof-format": "^2.0.6", "source-map": "^0.7.3", "split": "^1.0.1" }, @@ -254,24 +274,10 @@ "node": ">=12" } }, - "node_modules/@datadog/pprof/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@datadog/sketches-js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@datadog/sketches-js/-/sketches-js-2.0.0.tgz", - "integrity": "sha512-cR9r5sGYU64HLUe7vRvWuZO8qFrCPWanB/a2nrPPW5E7JVwt5j9QCEjhtPZo6LoImfVr3SajcbmyGwZfFLsHjw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@datadog/sketches-js/-/sketches-js-2.1.0.tgz", + "integrity": "sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew==" }, "node_modules/@graphql-tools/merge": { "version": "8.3.0", @@ -414,9 +420,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -425,9 +431,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -502,9 +508,9 @@ } }, "node_modules/apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -516,11 +522,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -561,18 +567,19 @@ } }, "node_modules/apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", + "deprecated": "The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -631,15 +638,10 @@ "retry": "0.13.1" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -649,7 +651,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -659,15 +661,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -688,24 +681,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -761,36 +741,59 @@ "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" }, "node_modules/dd-trace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dd-trace/-/dd-trace-3.0.0.tgz", - "integrity": "sha512-WIph8PS1U/1D+SahEPSAbt6sAdH9lbEzNmhmOBAhkxYdHbuuFlxqgq6YpGHB8BviRqs4oCsYmR1Sr4HkBuglNg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/dd-trace/-/dd-trace-3.21.0.tgz", + "integrity": "sha512-c86ZIVihUlIWx5XvzQ8xikgNwT7+w+2PllY7NRYRrxbN6ZjIqdg7tTkoUYMaIo1bvpNBGtW2mRV7JN6b76PlhA==", "hasInstallScript": true, "dependencies": { - "@datadog/native-appsec": "^1.2.1", - "@datadog/native-metrics": "^1.4.2", - "@datadog/pprof": "^1.0.2", - "@datadog/sketches-js": "^2.0.0", + "@datadog/native-appsec": "^3.1.0", + "@datadog/native-iast-rewriter": "2.0.1", + "@datadog/native-iast-taint-tracking": "^1.4.1", + "@datadog/native-metrics": "^2.0.0", + "@datadog/pprof": "^2.2.1", + "@datadog/sketches-js": "^2.1.0", "crypto-randomuuid": "^1.0.0", "diagnostics_channel": "^1.1.0", "ignore": "^5.2.0", - "import-in-the-middle": "^1.3.0", + "import-in-the-middle": "^1.3.5", + "ipaddr.js": "^2.0.1", + "istanbul-lib-coverage": "3.2.0", "koalas": "^1.0.2", "limiter": "^1.1.4", "lodash.kebabcase": "^4.1.1", "lodash.pick": "^4.4.0", "lodash.sortby": "^4.7.0", "lodash.uniq": "^4.5.0", + "lru-cache": "^7.14.0", "methods": "^1.1.2", "module-details-from-path": "^1.0.3", + "node-abort-controller": "^3.0.1", "opentracing": ">=0.12.1", "path-to-regexp": "^0.1.2", + "protobufjs": "^7.1.2", "retry": "^0.10.1", - "semver": "^5.5.0" + "semver": "^7.3.8" }, "engines": { "node": ">=14" } }, + "node_modules/dd-trace/node_modules/ipaddr.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/dd-trace/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, "node_modules/dd-trace/node_modules/retry": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", @@ -835,17 +838,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/diagnostics_channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/diagnostics_channel/-/diagnostics_channel-1.1.0.tgz", @@ -881,13 +873,13 @@ } }, "node_modules/express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -906,7 +898,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -943,14 +935,6 @@ "node": ">= 0.8" } }, - "node_modules/findit2": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz", - "integrity": "sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==", - "engines": { - "node": ">=0.8.22" - } - }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -967,63 +951,29 @@ "node": ">= 0.6" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -1053,6 +1003,17 @@ "node": ">= 0.4.0" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1099,22 +1060,13 @@ } }, "node_modules/import-in-the-middle": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.3.0.tgz", - "integrity": "sha512-esDCEWyzzg0bGShz1N5ybRrPIJFvKaJ7TfTaIFP1XovxFo98In2GiDpOR/Cn/8J1cfRO8i/RrQToQ9j0WL2b0Q==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.3.5.tgz", + "integrity": "sha512-yzHlBqi1EBFrkieAnSt8eTgO5oLSl+YJ7qaOpUH/PMqQOMZoQ/RmDlwnTLQrwYto+gHYjRG+i/IbsB1eDx32NQ==", "dependencies": { "module-details-from-path": "^1.0.3" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1128,6 +1080,14 @@ "node": ">= 0.10" } }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "engines": { + "node": ">=8" + } + }, "node_modules/koalas": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/koalas/-/koalas-1.0.2.tgz", @@ -1245,56 +1205,6 @@ "node": ">= 0.6" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "node_modules/minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/module-details-from-path": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", @@ -1305,11 +1215,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/nan": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", - "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -1323,6 +1228,11 @@ "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" }, + "node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -1361,9 +1271,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1379,14 +1289,6 @@ "node": ">= 0.8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/opentracing": { "version": "0.14.7", "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", @@ -1417,14 +1319,6 @@ "node": ">= 0.8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -1441,10 +1335,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pprof-format": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/pprof-format/-/pprof-format-2.0.7.tgz", + "integrity": "sha512-1qWaGAzwMpaXJP9opRa23nPnt2Egi7RMNoNBptEE/XwHbcn4fC2b/4U4bKc5arkGkIh2ZabpF2bEb+c5GNHEKA==" + }, "node_modules/protobufjs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.0.0.tgz", - "integrity": "sha512-ffNIEm+quOcYtQvHdW406v1NQmZSuqVklxsXk076BtuFnlYZfigLU+JOMrTD8TUOyqHYbRI/fSVNvgd25YeN3w==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", + "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -1457,7 +1356,6 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", "@types/node": ">=13.7.0", "long": "^5.0.0" }, @@ -1466,14 +1364,14 @@ } }, "node_modules/protobufjs/node_modules/@types/node": { - "version": "18.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.5.tgz", - "integrity": "sha512-NcKK6Ts+9LqdHJaW6HQmgr7dT/i3GOHG+pt6BiWv++5SnjtRd4NXeiuN2kA153SjhXPR/AhHIPHPbrsbpUVOww==" + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==" }, "node_modules/protobufjs/node_modules/long": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", - "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/proxy-addr": { "version": "2.0.7", @@ -1488,9 +1386,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -1531,20 +1429,6 @@ "node": ">= 4" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1570,11 +1454,17 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/send": { @@ -1676,22 +1566,6 @@ "node": ">= 0.8" } }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -1728,16 +1602,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unpipe": { @@ -1802,11 +1676,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, "node_modules/xss": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.13.tgz", @@ -1965,56 +1834,63 @@ } }, "@datadog/native-appsec": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@datadog/native-appsec/-/native-appsec-1.2.1.tgz", - "integrity": "sha512-jF+k7xhBmJIYYLtjvhCey08RBbItTG7O2zcSCDGFffhvCvo3ZOoou+IKtAm9z+U7hOoeOmD+Xg+h29xj/BB9MA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@datadog/native-appsec/-/native-appsec-3.2.0.tgz", + "integrity": "sha512-biAa7EFfuavjSWgSQaCit9CqGzr6Af5nhzfNNGJ38Y/Y387hDvLivAR374kK1z6XoxGZEOa+XPbVogmV/2Bcjw==", "requires": { - "detect-libc": "^1.0.3", - "minimist": "^1.2.6", - "tar": "^6.1.11" + "node-gyp-build": "^3.9.0" + } + }, + "@datadog/native-iast-rewriter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@datadog/native-iast-rewriter/-/native-iast-rewriter-2.0.1.tgz", + "integrity": "sha512-Mm+FG3XxEbPrAfJQPOMHts7iZZXRvg9gnGeeFRGkyirmRcQcOpZO4wFe/8K61DUVa5pXpgAJQ2ZkBGYF1O9STg==", + "requires": { + "node-gyp-build": "^4.5.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==" + } + } + }, + "@datadog/native-iast-taint-tracking": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@datadog/native-iast-taint-tracking/-/native-iast-taint-tracking-1.4.1.tgz", + "integrity": "sha512-wWJebnK5fADXGGwmoHi9ElMsvR/M4IZpRxBxzAfKU2WI1GRkCvSxQBhbIFUTQEuO7l6ZOpASWQ9yUXK3cx8n+w==", + "requires": { + "node-gyp-build": "^3.9.0" } }, "@datadog/native-metrics": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@datadog/native-metrics/-/native-metrics-1.4.2.tgz", - "integrity": "sha512-ExSIZCEo3pXTNQRuyQllIa+0pc2bVDOntlx0JMnu7+GjeEjJxGyVLw8tTx5EQUmHSLt0Jm7aeMW63C8DJnO27A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@datadog/native-metrics/-/native-metrics-2.0.0.tgz", + "integrity": "sha512-YklGVwUtmKGYqFf1MNZuOHvTYdKuR4+Af1XkWcMD8BwOAjxmd9Z+97328rCOY8TFUJzlGUPaXzB8j2qgG/BMwA==", "requires": { - "nan": "^2.15.0", + "node-addon-api": "^6.1.0", "node-gyp-build": "^3.9.0" } }, "@datadog/pprof": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-1.0.2.tgz", - "integrity": "sha512-AMTK55W3Aa2QX2X8mN9SQfDGw3HvwIK9Or8pXQFss+kjtH5pCkO9oqE5838MeXgRh9BR8HWrjAQE3Ji7FRCK2g==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-2.2.1.tgz", + "integrity": "sha512-kPxN9ADjajUEU1zRtVqLT/q5AP8Ge7S1R1UkpUlKOzNgBznFXmNzhTtQqGhB8ew6LPssfIQTDVd/rBIcJvuMOw==", "requires": { "delay": "^5.0.0", - "findit2": "^2.2.3", - "nan": "^2.16.0", "node-gyp-build": "^3.9.0", "p-limit": "^3.1.0", "pify": "^5.0.0", - "protobufjs": "^7.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", + "pprof-format": "^2.0.6", "source-map": "^0.7.3", "split": "^1.0.1" - }, - "dependencies": { - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@datadog/sketches-js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@datadog/sketches-js/-/sketches-js-2.0.0.tgz", - "integrity": "sha512-cR9r5sGYU64HLUe7vRvWuZO8qFrCPWanB/a2nrPPW5E7JVwt5j9QCEjhtPZo6LoImfVr3SajcbmyGwZfFLsHjw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@datadog/sketches-js/-/sketches-js-2.1.0.tgz", + "integrity": "sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew==" }, "@graphql-tools/merge": { "version": "8.3.0", @@ -2145,9 +2021,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -2156,9 +2032,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -2226,9 +2102,9 @@ } }, "apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "requires": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -2239,11 +2115,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -2270,18 +2146,18 @@ "requires": {} }, "apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", "requires": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -2319,15 +2195,10 @@ "retry": "0.13.1" } }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -2337,21 +2208,12 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -2366,21 +2228,11 @@ "get-intrinsic": "^1.0.2" } }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -2424,32 +2276,49 @@ "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" }, "dd-trace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dd-trace/-/dd-trace-3.0.0.tgz", - "integrity": "sha512-WIph8PS1U/1D+SahEPSAbt6sAdH9lbEzNmhmOBAhkxYdHbuuFlxqgq6YpGHB8BviRqs4oCsYmR1Sr4HkBuglNg==", - "requires": { - "@datadog/native-appsec": "^1.2.1", - "@datadog/native-metrics": "^1.4.2", - "@datadog/pprof": "^1.0.2", - "@datadog/sketches-js": "^2.0.0", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/dd-trace/-/dd-trace-3.21.0.tgz", + "integrity": "sha512-c86ZIVihUlIWx5XvzQ8xikgNwT7+w+2PllY7NRYRrxbN6ZjIqdg7tTkoUYMaIo1bvpNBGtW2mRV7JN6b76PlhA==", + "requires": { + "@datadog/native-appsec": "^3.1.0", + "@datadog/native-iast-rewriter": "2.0.1", + "@datadog/native-iast-taint-tracking": "^1.4.1", + "@datadog/native-metrics": "^2.0.0", + "@datadog/pprof": "^2.2.1", + "@datadog/sketches-js": "^2.1.0", "crypto-randomuuid": "^1.0.0", "diagnostics_channel": "^1.1.0", "ignore": "^5.2.0", - "import-in-the-middle": "^1.3.0", + "import-in-the-middle": "^1.3.5", + "ipaddr.js": "^2.0.1", + "istanbul-lib-coverage": "3.2.0", "koalas": "^1.0.2", "limiter": "^1.1.4", "lodash.kebabcase": "^4.1.1", "lodash.pick": "^4.4.0", "lodash.sortby": "^4.7.0", "lodash.uniq": "^4.5.0", + "lru-cache": "^7.14.0", "methods": "^1.1.2", "module-details-from-path": "^1.0.3", + "node-abort-controller": "^3.0.1", "opentracing": ">=0.12.1", "path-to-regexp": "^0.1.2", + "protobufjs": "^7.1.2", "retry": "^0.10.1", - "semver": "^5.5.0" + "semver": "^7.3.8" }, "dependencies": { + "ipaddr.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==" + }, + "lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" + }, "retry": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", @@ -2480,11 +2349,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==" - }, "diagnostics_channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/diagnostics_channel/-/diagnostics_channel-1.1.0.tgz", @@ -2511,13 +2375,13 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -2536,7 +2400,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -2567,11 +2431,6 @@ "unpipe": "~1.0.0" } }, - "findit2": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz", - "integrity": "sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==" - }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -2582,51 +2441,26 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" } }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==" + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==" }, "graphql-tag": { "version": "2.12.6", @@ -2644,6 +2478,11 @@ "function-bind": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2675,22 +2514,13 @@ "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "import-in-the-middle": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.3.0.tgz", - "integrity": "sha512-esDCEWyzzg0bGShz1N5ybRrPIJFvKaJ7TfTaIFP1XovxFo98In2GiDpOR/Cn/8J1cfRO8i/RrQToQ9j0WL2b0Q==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.3.5.tgz", + "integrity": "sha512-yzHlBqi1EBFrkieAnSt8eTgO5oLSl+YJ7qaOpUH/PMqQOMZoQ/RmDlwnTLQrwYto+gHYjRG+i/IbsB1eDx32NQ==", "requires": { "module-details-from-path": "^1.0.3" } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -2701,6 +2531,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==" + }, "koalas": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/koalas/-/koalas-1.0.2.tgz", @@ -2787,41 +2622,6 @@ "mime-db": "1.52.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, "module-details-from-path": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", @@ -2832,11 +2632,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "nan": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", - "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -2847,6 +2642,11 @@ "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" }, + "node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, "node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -2866,9 +2666,9 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" }, "on-finished": { "version": "2.4.1", @@ -2878,14 +2678,6 @@ "ee-first": "1.1.1" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, "opentracing": { "version": "0.14.7", "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.7.tgz", @@ -2904,11 +2696,6 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" - }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -2919,10 +2706,15 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", "integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==" }, + "pprof-format": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/pprof-format/-/pprof-format-2.0.7.tgz", + "integrity": "sha512-1qWaGAzwMpaXJP9opRa23nPnt2Egi7RMNoNBptEE/XwHbcn4fC2b/4U4bKc5arkGkIh2ZabpF2bEb+c5GNHEKA==" + }, "protobufjs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.0.0.tgz", - "integrity": "sha512-ffNIEm+quOcYtQvHdW406v1NQmZSuqVklxsXk076BtuFnlYZfigLU+JOMrTD8TUOyqHYbRI/fSVNvgd25YeN3w==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.3.tgz", + "integrity": "sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -2934,20 +2726,19 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", "@types/node": ">=13.7.0", "long": "^5.0.0" }, "dependencies": { "@types/node": { - "version": "18.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.5.tgz", - "integrity": "sha512-NcKK6Ts+9LqdHJaW6HQmgr7dT/i3GOHG+pt6BiWv++5SnjtRd4NXeiuN2kA153SjhXPR/AhHIPHPbrsbpUVOww==" + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==" }, "long": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", - "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" } } }, @@ -2961,9 +2752,9 @@ } }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -2989,14 +2780,6 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==" }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3008,9 +2791,12 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "requires": { + "lru-cache": "^6.0.0" + } }, "send": { "version": "0.18.0", @@ -3092,19 +2878,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, - "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -3135,9 +2908,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unpipe": { @@ -3184,11 +2957,6 @@ "webidl-conversions": "^3.0.0" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, "xss": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.13.tgz", diff --git a/dockerfiles/tracing/datadog-subgraph/package.json b/dockerfiles/tracing/datadog-subgraph/package.json index 5b87f1f38b7..b4ea6222529 100644 --- a/dockerfiles/tracing/datadog-subgraph/package.json +++ b/dockerfiles/tracing/datadog-subgraph/package.json @@ -18,6 +18,6 @@ "graphql": "^16.5.0" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } } diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index 62aa0e247ca..f90cb096b5e 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.19.0 + image: ghcr.io/apollographql/router:v1.20.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 fecd8f38a2b..0dadb51f842 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.19.0 + image: ghcr.io/apollographql/router:v1.20.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 f73c5a9d47a..f1de0bb17d8 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.19.0 + image: ghcr.io/apollographql/router:v1.20.0 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml @@ -36,6 +36,6 @@ services: zipkin: container_name: zipkin - image: openzipkin/zipkin:2.24.0 + image: openzipkin/zipkin:2.24.1 ports: - 9411:9411 diff --git a/dockerfiles/tracing/jaeger-subgraph/package-lock.json b/dockerfiles/tracing/jaeger-subgraph/package-lock.json index a63f42a7fcd..83f36bd4fe7 100644 --- a/dockerfiles/tracing/jaeger-subgraph/package-lock.json +++ b/dockerfiles/tracing/jaeger-subgraph/package-lock.json @@ -18,7 +18,7 @@ "opentracing": "^0.14.7" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } }, "node_modules/@apollo/cache-control-types": { @@ -344,9 +344,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -355,9 +355,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -440,9 +440,9 @@ } }, "node_modules/apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -454,11 +454,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -507,18 +507,19 @@ } }, "node_modules/apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", + "deprecated": "The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -578,9 +579,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -590,7 +591,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -749,13 +750,13 @@ } }, "node_modules/express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -774,7 +775,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -833,12 +834,13 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -846,9 +848,9 @@ } }, "node_modules/graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -878,6 +880,17 @@ "node": ">= 0.4.0" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1105,9 +1118,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1165,9 +1178,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -1372,16 +1385,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unpipe": { @@ -1734,9 +1747,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -1745,9 +1758,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -1820,9 +1833,9 @@ } }, "apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "requires": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -1833,11 +1846,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -1871,18 +1884,18 @@ "requires": {} }, "apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", "requires": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -1921,9 +1934,9 @@ } }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -1933,7 +1946,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -2054,13 +2067,13 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -2079,7 +2092,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -2126,19 +2139,20 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" } }, "graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==" + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==" }, "graphql-tag": { "version": "2.12.6", @@ -2156,6 +2170,11 @@ "function-bind": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2314,9 +2333,9 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" }, "on-finished": { "version": "2.4.1", @@ -2356,9 +2375,9 @@ } }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -2508,9 +2527,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unpipe": { diff --git a/dockerfiles/tracing/jaeger-subgraph/package.json b/dockerfiles/tracing/jaeger-subgraph/package.json index c5a7907fba9..ee41d863203 100644 --- a/dockerfiles/tracing/jaeger-subgraph/package.json +++ b/dockerfiles/tracing/jaeger-subgraph/package.json @@ -19,6 +19,6 @@ "opentracing": "^0.14.7" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } } diff --git a/dockerfiles/tracing/zipkin-subgraph/package-lock.json b/dockerfiles/tracing/zipkin-subgraph/package-lock.json index b736a93a0cb..1b58a4da752 100644 --- a/dockerfiles/tracing/zipkin-subgraph/package-lock.json +++ b/dockerfiles/tracing/zipkin-subgraph/package-lock.json @@ -19,7 +19,7 @@ "zipkin-javascript-opentracing": "^3.0.0" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } }, "node_modules/@apollo/cache-control-types": { @@ -345,9 +345,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -356,9 +356,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -441,9 +441,9 @@ } }, "node_modules/apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -455,11 +455,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -508,18 +508,19 @@ } }, "node_modules/apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", + "deprecated": "The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -599,9 +600,9 @@ "peer": true }, "node_modules/body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -611,7 +612,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -770,13 +771,13 @@ } }, "node_modules/express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -795,7 +796,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -854,12 +855,13 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -867,9 +869,9 @@ } }, "node_modules/graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==", + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -899,6 +901,17 @@ "node": ">= 0.4.0" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1132,9 +1145,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1192,9 +1205,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -1399,16 +1412,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/unpipe": { @@ -1793,9 +1806,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -1804,9 +1817,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.29", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.29.tgz", - "integrity": "sha512-uMd++6dMKS32EOuw1Uli3e3BPgdLIXmezcfHv7N4c1s3gkhikBplORPpMq3fuWkxncZN1reb16d5n8yhQ80x7Q==", + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -1879,9 +1892,9 @@ } }, "apollo-server-core": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.0.tgz", - "integrity": "sha512-5iRlkbilXpQeY66/F2/t2oNO0YSqb+kFb5lyMUIqK9VLuBfI/hILQDa5H71ar7hhexKwoDzIDfSJRg5ASNmnQw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.0.tgz", + "integrity": "sha512-hq7iH6Cgldgmnjs9FVSZeKWRpi0/ZR+iJ1arzeD2VXGxxgk1mAm/cz1Tx0TYgegZI+FvvrRl0UhKEx7sLnIxIg==", "requires": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -1892,11 +1905,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.0", - "apollo-server-types": "^3.7.0", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -1930,18 +1943,18 @@ "requires": {} }, "apollo-server-express": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.10.0.tgz", - "integrity": "sha512-ww3tZq9I/x3Oxtux8xlHAZcSB0NNQ17lRlY6yCLk1F+jCzdcjuj0x8XNg0GdTrMowt5v43o786bU9VYKD5OVnA==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.0.tgz", + "integrity": "sha512-m8FaGPUfDOEGSm7QRWRmUUGjG/vqvpQoorkId9/FXkC57fz/A59kEdrzkMt9538Xgsa5AV+X4MEWLJhTvlW3LQ==", "requires": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", "@types/cors": "2.8.12", - "@types/express": "4.17.13", - "@types/express-serve-static-core": "4.17.29", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.10.0", - "apollo-server-types": "^3.6.2", + "apollo-server-core": "^3.12.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -1986,9 +1999,9 @@ "peer": true }, "body-parser": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", - "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -1998,7 +2011,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -2119,13 +2132,13 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", - "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -2144,7 +2157,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -2191,19 +2204,20 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" } }, "graphql": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.5.0.tgz", - "integrity": "sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA==" + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.6.0.tgz", + "integrity": "sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==" }, "graphql-tag": { "version": "2.12.6", @@ -2221,6 +2235,11 @@ "function-bind": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2385,9 +2404,9 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==" + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" }, "on-finished": { "version": "2.4.1", @@ -2427,9 +2446,9 @@ } }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -2579,9 +2598,9 @@ } }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "unpipe": { diff --git a/dockerfiles/tracing/zipkin-subgraph/package.json b/dockerfiles/tracing/zipkin-subgraph/package.json index 92a1597083a..f0a98da3e50 100644 --- a/dockerfiles/tracing/zipkin-subgraph/package.json +++ b/dockerfiles/tracing/zipkin-subgraph/package.json @@ -20,6 +20,6 @@ "zipkin-javascript-opentracing": "^3.0.0" }, "devDependencies": { - "typescript": "4.9.5" + "typescript": "5.0.4" } } diff --git a/docs/source/configuration/logging.mdx b/docs/source/configuration/logging.mdx index 832cdccddb1..a6f902970d5 100644 --- a/docs/source/configuration/logging.mdx +++ b/docs/source/configuration/logging.mdx @@ -71,9 +71,13 @@ JSON-formatted logging provides compatibility with common searchable logging too > This is part of an experimental feature, it means any time until it's stabilized (without the prefix `experimental_`) we might change the configuration shape or adding/removing features. > If you want to give feedback or participate in that feature feel free to join [this discussion on GitHub](https://github.com/apollographql/router/discussions/1961). -By default some of our logs containing sensitive data (like request body, response body, headers) are not displayed even if we are in the right log level. -For example if you need to display raw responses from one of your subgraph it won't be displayed by default. To enable them you have to configure it thanks to the `contains_attributes` setting. -Here is an example on how you can configure it: +By default, the router _doesn't_ log certain values that might contain sensitive data, even if a sufficient log level is set: + + - Request bodies + - Response bodies + - Headers + +You can enable selective logging of these values via the `when_header` option: ```yaml title="router.yaml" telemetry: diff --git a/docs/source/configuration/metrics.mdx b/docs/source/configuration/metrics.mdx index f68a8f1d770..8abef3d50ed 100644 --- a/docs/source/configuration/metrics.mdx +++ b/docs/source/configuration/metrics.mdx @@ -233,6 +233,26 @@ To fetch the value of the field `x`, the corresponding path is `.items[0].wanted JSON path queries always begin with a period `.` +## Changing default buckets for histograms + +You can customize the buckets for all generated histograms: + +```yaml title="router.yaml" +telemetry: + metrics: + common: + buckets: + - 0.05 + - 0.10 + - 0.25 + - 0.50 + - 1.00 + - 2.50 + - 5.00 + - 10.00 + - 20.00 +``` + ## Adding custom resources Resources are similar to [attributes](#adding-custom-attributeslabels), but there are more globals. They're configured directly on the metrics exporter, which means they're always present on each of your metrics. diff --git a/docs/source/containerization/docker.mdx b/docs/source/containerization/docker.mdx index 1a433a33273..bcf7e60371a 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.19.0` +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.20.0` ## Override the configuration diff --git a/docs/source/containerization/kubernetes.mdx b/docs/source/containerization/kubernetes.mdx index c31862d7403..18e210d38df 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.19.0/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.20.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.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.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.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.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.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.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.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.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.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.0" app.kubernetes.io/managed-by: Helm annotations: @@ -172,7 +172,7 @@ spec: - name: router securityContext: {} - image: "ghcr.io/apollographql/router:v1.19.0" + image: "ghcr.io/apollographql/router:v1.20.0" imagePullPolicy: IfNotPresent args: - --hot-reload @@ -223,19 +223,19 @@ kind: Pod metadata: name: "release-name-router-test-connection" labels: - helm.sh/chart: router-1.19.0 + helm.sh/chart: router-1.20.0 app.kubernetes.io/name: router app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v1.19.0" + app.kubernetes.io/version: "v1.20.0" app.kubernetes.io/managed-by: Helm annotations: "helm.sh/hook": test spec: containers: - - name: wget + - name: netcat image: busybox - command: ['wget'] - args: ['release-name-router:80'] + command: ['nc'] + args: ['-vz','-w','1','release-name-router:80'] restartPolicy: Never ``` diff --git a/docs/source/customizations/coprocessor.mdx b/docs/source/customizations/coprocessor.mdx index 836e608068d..e8626a36b3b 100644 --- a/docs/source/customizations/coprocessor.mdx +++ b/docs/source/customizations/coprocessor.mdx @@ -63,8 +63,6 @@ At _every_ stage, the router waits for your coprocessor's response before it con If your coprocessor hooks into your router's `SubgraphService`, the router sends a separate coprocessor request _for each subgraph request in its query plan._ In other words, if your router needs to query three separate subgraphs to fully resolve a client operation, it sends three separate coprocessor requests. Each coprocessor request includes the [name](#servicename) and [URL](#uri) of the subgraph being queried. -> This behavior differs from hooking into `RouterService`, which can trigger exactly one coprocessor request per stage. - ## Setup > **First, make sure your router is [connected to a GraphOS Enterprise organization](../enterprise-features/#enabling-enterprise-features).** @@ -87,7 +85,7 @@ coprocessor: sdl: false path: false method: false - response: # By including this key, the `RouterService` sends a coprocessor request whenever it's about to send a client response. + response: # By including this key, the `RouterService` sends a coprocessor request whenever it's about to send response data to a client (including incremental data via @defer). headers: true body: false context: false @@ -180,9 +178,9 @@ Properties of the JSON body are divided into two high-level categories: "46" ] }, - "body": { - "query": "query GetActiveUser {\n me {\n name\n}\n}" - }, + "body": "{ + \"query\": \"query GetActiveUser {\n me {\n name\n}\n}\" + }", "context": { "entries": { "accepts-json": false, @@ -219,13 +217,13 @@ Properties of the JSON body are divided into two high-level categories: "application/json" ] }, - "body": { - "data": { - "me": { - "name": "Ada Lovelace" + "body": "{ + \"data\": { + \"me\": { + \"name\": \"Ada Lovelace\" } } - }, + }", "context": { "entries": { "apollo_telemetry::subgraph_metrics_attributes": {}, @@ -492,7 +490,7 @@ Properties of the JSON body are divided into two high-level categories: ##### `control` -`string` | `object` +`string | object` @@ -515,56 +513,56 @@ For details, see [Terminating a client request](#terminating-a-client-request). -##### `stage` +##### `id` `string` -Indicates which stage of the router's [request-handling lifecycle](./rhai/#router-request-lifecycle) this coprocessor request corresponds to. - -This value is one of the following: - -- `RouterRequest`: The `RouterService` has just received a client request. -- `RouterResponse`: The `RouterService` is about to send a client response. -- `SubgraphRequest`: The `SubgraphService` is about to send a request to a subgraph. -- `SubgraphResponse`: The `SubgraphService` has just received a subgraph response. +A unique ID corresponding to the client request associated with this coprocessor request. **Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. + -##### `version` +##### `stage` -`number` +`string` -Indicates which version of the coprocessor request protocol the router is using. +Indicates which stage of the router's [request-handling lifecycle](./rhai/#router-request-lifecycle) this coprocessor request corresponds to. -Currently, this value is always `1`. +This value is one of the following: -**Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. +- `RouterRequest`: The `RouterService` has just received a client request. +- `RouterResponse`: The `RouterService` is about to send response data to a client. +- `SubgraphRequest`: The `SubgraphService` is about to send a request to a subgraph. +- `SubgraphResponse`: The `SubgraphService` has just received a subgraph response. +**Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. -##### `id` +##### `version` -`string` +`number` -A unique ID corresponding to the client request associated with this coprocessor request. +Indicates which version of the coprocessor request protocol the router is using. + +Currently, this value is always `1`. **Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. @@ -582,18 +580,31 @@ A unique ID corresponding to the client request associated with this coprocessor -##### `serviceName` +##### `body` -`string` +`string | object` -The name of the subgraph that this coprocessor request pertains to. +The body of the corresponding request or response. -This value is present only for coprocessor requests from the router's `SubgraphService`. +If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `body`, the router replaces the existing body with that value. This is common when [terminating a client request](#terminating-a-client-request). -**Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. +This field's type depends on the coprocessor request's [`stage`](#stage): + +- For `SubgraphService` stages, `body` is a JSON _object_. +- For `RouterService` stages, `body` is a JSON _string_. + - This is necessary to support handling [deferred queries](#handling-deferred-query-responses). + - If you modify `body` during the `RouterRequest` stage, the new value must be a valid string serialization of a JSON object. If it isn't, the router detects that the body is malformed and returns an error to the client. + +This field's structure depends on whether the coprocessor request corresponds to a request, a standard response, or a response "chunk" for a deferred query: + +- **If a request,** `body` usually contains a `query` property containing the GraphQL query string. +- **If a standard response,** `body` usually contains `data` and/or `errors` properties for the GraphQL operation result. +- **If a response "chunk",** `body` contains `data` for _some_ of the operation fields. + +> By default, the `RouterResponse` stage returns _redacted_ errors within the `errors` field. To process subgraph errors manually in your coprocessor, enable [subgraph error inclusion](../configuration/subgraph-error-inclusion). @@ -601,14 +612,16 @@ This value is present only for coprocessor requests from the router's `SubgraphS -##### `path` +##### `context` -`string` +`object` -The `RouterService` path that this coprocessor request pertains to. +An object representing the router's shared context for the corresponding client request. + +If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `context`, the router replaces the existing context with that value. @@ -616,14 +629,16 @@ The `RouterService` path that this coprocessor request pertains to. -##### `uri` +##### `headers` -`string` +`object` -The full URI the subgraph request will be made to. +An object mapping of all HTTP header names and values for the corresponding request or response. + +If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `headers`, the router replaces the existing headers with that value. @@ -646,14 +661,14 @@ The HTTP method that is used by the request. -##### `status_code` +##### `path` -`number` +`string` -The HTTP status code received by a response. +The `RouterService` path that this coprocessor request pertains to. @@ -661,21 +676,19 @@ The HTTP status code received by a response. -##### `body` +##### `sdl` -`object` +`string` -The JSON body of the corresponding request or response, depending on this coprocessor request's [`stage`](#stage). +A string representation of the router's current supergraph schema. -- If a request, this usually contains a `query` property containing the GraphQL query string. -- If a response, this usually contains `data` and/or `errors` properties for the GraphQL operation result. +This value can be very large, so you should avoid including it in coprocessor requests if possible. -> The `RouterResponse` stage will return _redacted_ errors within the `errors` by default. If you wish to process subgraph errors manually in your coprocessor you can enable [subgraph error inclusion](../configuration/subgraph-error-inclusion). +The router ignores modifications to this value. -If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `body`, the router replaces the existing body with that value. This is common when [terminating a client request](#terminating-a-client-request). @@ -683,16 +696,18 @@ If your coprocessor [returns a _different_ value](#responding-to-coprocessor-req -##### `headers` +##### `serviceName` -`object` +`string` -An object mapping of all HTTP header names and values for the corresponding request or response. +The name of the subgraph that this coprocessor request pertains to. -If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `headers`, the router replaces the existing headers with that value. +This value is present only for coprocessor requests from the router's `SubgraphService`. + +**Do not return a _different_ value for this property.** If you do, the router treats the coprocessor request as if it failed. @@ -700,16 +715,14 @@ If your coprocessor [returns a _different_ value](#responding-to-coprocessor-req -##### `context` +##### `status_code` -`object` +`number` -An object representing the router's shared context for the corresponding client request. - -If your coprocessor [returns a _different_ value](#responding-to-coprocessor-requests) for `context`, the router replaces the existing context with that value. +The HTTP status code returned with a response. @@ -717,19 +730,14 @@ If your coprocessor [returns a _different_ value](#responding-to-coprocessor-req -##### `sdl` +##### `uri` `string` -A string representation of the router's current supergraph schema. - -This value can be very large, so you should avoid including it in coprocessor requests if possible. - -The router ignores modifications to this value. - +When `stage` is `SubgraphRequest`, this is the full URI of the subgraph the router will query. @@ -737,7 +745,6 @@ The router ignores modifications to this value. - ## Responding to coprocessor requests The router expects your coprocessor to respond with a `200` status code and a JSON body that matches the structure of the [request body](#example-requests-by-stage). @@ -812,3 +819,85 @@ Your router considers all of the following scenarios to be a **failed response** - Your coprocessor responds with a non-`2xx` HTTP code. - Your coprocessor's response body doesn't match the JSON structure of the corresponding [request body](#example-requests-by-stage). - Your coprocessor's response body sets different values for [control properties](#property-reference) that must not change, such as `stage` and `version`. + + +## Handling deferred query responses + +The Apollo Router supports the incremental delivery of query response data via [the `@defer` directive](../executing-operations/defer-support/): + +```mermaid +sequenceDiagram + Client->>Router: Sends a query that
defers some fields + Note over Router: Resolves non-deferred
fields + Router->>Client: Returns data for
non-deferred fields + Note over Router: Resolves deferred
fields + Router->>Client: Returns data for
deferred fields +``` + +For a single query with deferred fields, your router sends multiple "chunks" of response data to the client. If you enable coprocessor requests for the `RouterResponse` stage, your router sends a separate coprocessor request for _each chunk_ it returns as part of a deferred query. + +**Note the following about handling deferred response chunks:** + +- The [`status_code`](#status_code) and [`headers`](#headers) fields are included only in the coprocessor request for any response's _first_ chunk. These values can't change after the first chunk is returned to the client, so they're subsequently omitted. + +- If your coprocessor modifes the response [`body`](#body) for a response chunk, it must provide the new value as a _string_, _not_ as an object. This is because response chunk bodies include multipart boundary information in addition to the actual serialized JSON response data. [See examples.](#examples-of-deferred-response-chunks) + - Many responses will not contain deferred streams and for these the body string can usually be fairly reliably transformed into a JSON object for easy manipulation within the coprocessor. Coprocessors should be carefully coded to allow for the presence of a body that is not a valid JSON object. + +- Because the data is a JSON string at both `RouterRequest` and `RouterResponse`, it's entirely possible for a coprocessor to rewrite the body from invalid JSON content into valid JSON content. This is one of the primary use cases for `RouterRequest` body processing. + +### Examples of deferred response chunks + +The examples below illustrate the differences between the _first_ chunk of a deferred response and all subsequent chunks: + +#### First response chunk + +The first response chunk includes `headers` and `statusCode` fields: + +```json +{ + "version": 1, + "stage": "RouterResponse", + "id": "8dee7fe947273640a5c2c7e1da90208c", + "sdl": "...", // String omitted due to length + // highlight-start + "headers": { + "content-type": [ + "multipart/mixed;boundary=\"graphql\";deferSpec=20220824" + ], + "vary": [ + "origin" + ] + }, + // highlight-end + "body": "\r\n--graphql\r\ncontent-type: application/json\r\n\r\n{\"data\":{\"me\":{\"id\":\"1\"}},\"hasNext\":true}\r\n--graphql\r\n", + "context": { + "entries": { + "apollo_telemetry::operation_kind": "query", + "apollo_telemetry::client_version": "", + "apollo_telemetry::client_name": "manual" + } + }, + "statusCode": 200 //highlight-line +} +``` + +#### Subsequent response chunk + +Subsequent response chunks omit the `headers` and `statusCode` fields: + +```json +{ + "version": 1, + "stage": "RouterResponse", + "id": "8dee7fe947273640a5c2c7e1da90208c", + "sdl": "...", // String omitted due to length + "body": "content-type: application/json\r\n\r\n{\"hasNext\":false,\"incremental\":[{\"data\":{\"name\":\"Ada Lovelace\"},\"path\":[\"me\"]}]}\r\n--graphql--\r\n", + "context": { + "entries": { + "apollo_telemetry::operation_kind": "query", + "apollo_telemetry::client_version": "", + "apollo_telemetry::client_name": "manual" + } + } +} +``` diff --git a/docs/source/customizations/custom-binary.mdx b/docs/source/customizations/custom-binary.mdx index 5a3c8ed6e98..d8fb7372094 100644 --- a/docs/source/customizations/custom-binary.mdx +++ b/docs/source/customizations/custom-binary.mdx @@ -160,6 +160,24 @@ cargo router plugin remove hello_world Note that depending on the structure of your plugin, the command might fail to remove all of its associated files. +## Memory allocator + +On Linux the `apollo-router` crate sets [jemalloc](http://jemalloc.net/) +as [the global memory allocator for Rust](https://doc.rust-lang.org/std/alloc/index.html#the-global_allocator-attribute) +to reduce memory fragmentation. +Future versions may do so on more platforms, or switch to yet a different allocator. +This is enabled by default and controlled by a `global-allocator` Cargo feature flag. +If you want to choose a different allocator, disable it in your `Cargo.toml`: + +```toml +[dependencies] +apollo-router = {version = "[…]", default-features = false} +``` + +If you make a library crate, also specify `default-features = false` +in order to leave the choice open for the eventual executable crate. +(Cargo default features are only disabled if *all* dependents specify `default-features = false`.) + ## Docker You can use the provided [Dockerfile](https://github.com/apollographql/router/tree/main/apollo-router-scaffold/templates/base/Dockerfile) to build a release container. diff --git a/docs/source/federation-version-support.mdx b/docs/source/federation-version-support.mdx index 89d50ba4431..ac82b8af1ad 100644 --- a/docs/source/federation-version-support.mdx +++ b/docs/source/federation-version-support.mdx @@ -25,9 +25,25 @@ The table below shows which version of federation each router release is compile + + + v1.20.0 and later (see latest releases) + + + 2.4.7 + + + + + ️⚠️ v1.19.1 + + + 2.4.6 + + - v1.19.0 and later (see latest releases) + ⚠️ v1.19.0 2.4.5 diff --git a/examples/custom-global-allocator/.gitignore b/examples/custom-global-allocator/.gitignore new file mode 100644 index 00000000000..ffa3bbd20ea --- /dev/null +++ b/examples/custom-global-allocator/.gitignore @@ -0,0 +1 @@ +Cargo.lock \ No newline at end of file diff --git a/examples/custom-global-allocator/Cargo.toml b/examples/custom-global-allocator/Cargo.toml new file mode 100644 index 00000000000..6689b745ba0 --- /dev/null +++ b/examples/custom-global-allocator/Cargo.toml @@ -0,0 +1,19 @@ +[workspace] +# Make this a separate workspace. +# +# If this package was in the same workspace as other examples +# which don’t specify `default-features = false`, then apollo-router +# would be compiled with its default global-allocator feature +# and compilation of this example would fail. +# +# To manually test this example: +# cargo run --manifest-path examples/custom-global-allocator/Cargo.toml -- --help + +[package] +name = "custom-global-allocator" +version = "0.1.0" +edition = "2021" + +[dependencies] +# The apollo-router/global-allocator feature is enabled by default, disable it here +apollo-router = {path = "../../apollo-router", default-features = false} \ No newline at end of file diff --git a/examples/custom-global-allocator/src/main.rs b/examples/custom-global-allocator/src/main.rs new file mode 100644 index 00000000000..7508c888376 --- /dev/null +++ b/examples/custom-global-allocator/src/main.rs @@ -0,0 +1,38 @@ +use std::alloc::GlobalAlloc; +use std::alloc::Layout; +use std::alloc::System; + +#[global_allocator] +static ALLOC: CustomAlloc = CustomAlloc; + +struct CustomAlloc; + +// This is where one would do something interesting. +// Alternatively, use an existing type and impl from a library crate like `tikv-jemallocator` +unsafe impl GlobalAlloc for CustomAlloc { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + System.alloc(layout) + } + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + System.dealloc(ptr, layout) + } + + unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { + System.alloc_zeroed(layout) + } + + unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + System.realloc(ptr, layout, new_size) + } +} + +fn main() { + match apollo_router::main() { + Ok(_) => {} + Err(e) => { + eprintln!("{e}"); + std::process::exit(1) + } + } +} diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index 785c5719754..d7042ff3638 100644 --- a/helm/chart/router/Chart.yaml +++ b/helm/chart/router/Chart.yaml @@ -20,10 +20,10 @@ type: application # so it matches the shape of our release process and release automation. # By proxy of that decision, this version uses SemVer 2.0.0, though the prefix # of "v" is not included. -version: 1.19.0 +version: 1.20.0 # 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.19.0" +appVersion: "v1.20.0" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index 78d198670d2..8db7b2d8aa7 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.19.0](https://img.shields.io/badge/Version-1.19.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.19.0](https://img.shields.io/badge/AppVersion-v1.19.0-informational?style=flat-square) +![Version: 1.20.0](https://img.shields.io/badge/Version-1.20.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.20.0](https://img.shields.io/badge/AppVersion-v1.20.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.19.0 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.20.0 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.19.0 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.19.0 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.20.0 --values my-values.yaml ``` _See [configuration](#configuration) below._ diff --git a/helm/chart/router/templates/tests/test-connection.yaml b/helm/chart/router/templates/tests/test-connection.yaml index 286fd508dcd..0bf06127190 100644 --- a/helm/chart/router/templates/tests/test-connection.yaml +++ b/helm/chart/router/templates/tests/test-connection.yaml @@ -8,8 +8,8 @@ metadata: "helm.sh/hook": test spec: containers: - - name: wget + - name: netcat image: busybox - command: ['wget'] - args: ['{{ include "router.fullname" . }}:{{ .Values.service.port }}'] + command: ['nc'] + args: ['-vz','-w','1','{{ include "router.fullname" . }}:{{.Values.service.port }}'] restartPolicy: Never diff --git a/licenses.html b/licenses.html index 9f673ea53b5..2b2f123efe9 100644 --- a/licenses.html +++ b/licenses.html @@ -46,8 +46,8 @@

Overview of licenses:

../../LICENSE-APACHE
@@ -10310,6 +10313,7 @@

Used by:

Apache License 2.0

Used by:

    +
  • apollo-parser
  • askama_shared
  • backtrace-ext
  • block-modes
  • @@ -10744,6 +10748,41 @@

    Used by:

    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +
  • +

    BSD 3-Clause "New" or "Revised" License

    +

    Used by:

    + +
    // Copyright 2015 The Chromium Authors. All rights reserved.
    +//
    +// Redistribution and use in source and binary forms, with or without
    +// modification, are permitted provided that the following conditions are
    +// met:
    +//
    +//    * Redistributions of source code must retain the above copyright
    +// notice, this list of conditions and the following disclaimer.
    +//    * Redistributions in binary form must reproduce the above
    +// copyright notice, this list of conditions and the following disclaimer
    +// in the documentation and/or other materials provided with the
    +// distribution.
    +//    * Neither the name of Google Inc. nor the names of its
    +// contributors may be used to endorse or promote products derived from
    +// this software without specific prior written permission.
    +//
    +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     
  • @@ -11633,6 +11672,22 @@

    Used by:

    The files under third-party/chromium are licensed as described in third-party/chromium/LICENSE. + +
  • +
  • +

    ISC License

    +

    Used by:

    + +
    ISC License:
    +
    +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
    +Copyright (c) 1995-2003 by Internet Software Consortium
    +
    +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
    +
    +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     
  • @@ -12661,7 +12716,6 @@

    MIT License

    Used by:

    Copyright (c) 2019-2021 Tower Contributors
     
    @@ -12723,8 +12777,10 @@ 

    MIT License

    Used by:

    -
    Copyright (c) 2022 Tokio Contributors
    +                
    Copyright (c) 2023 Tokio Contributors
     
     Permission is hereby granted, free of charge, to any
     person obtaining a copy of this software and associated
    @@ -12757,7 +12813,7 @@ 

    Used by:

    -
    Copyright (c) 2022 Tokio Contributors
    +                
    Copyright (c) 2023 Tokio Contributors
     
     Permission is hereby granted, free of charge, to any
     person obtaining a copy of this software and associated
    @@ -12804,40 +12860,6 @@ 

    Used by:

    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -
    -
  • -
  • -

    MIT License

    -

    Used by:

    - -
    Copyright (c) 2023 Tokio Contributors
    -
    -Permission is hereby granted, free of charge, to any
    -person obtaining a copy of this software and associated
    -documentation files (the "Software"), to deal in the
    -Software without restriction, including without
    -limitation the rights to use, copy, modify, merge,
    -publish, distribute, sublicense, and/or sell copies of
    -the Software, and to permit persons to whom the Software
    -is furnished to do so, subject to the following
    -conditions:
    -
    -The above copyright notice and this permission notice
    -shall be included in all copies or substantial portions
    -of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
    -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
    -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
    -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
    -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    -DEALINGS IN THE SOFTWARE.
     
  • @@ -13022,6 +13044,35 @@

    Used by:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +
  • +
  • +

    MIT License

    +

    Used by:

    + +
    MIT License
    +
    +Copyright (c) 2018 Canop
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    @@ -13394,6 +13445,7 @@ 

    Used by:

  • deno_webidl
  • difflib
  • jsonschema
  • +
  • lazy-regex-proc_macros
  • serde_v8
  • v8
  • valuable
  • @@ -13752,6 +13804,7 @@

    Used by:

    MIT License

    Used by:

      +
    • aho-corasick
    • aho-corasick
    • byteorder
    • globset
    • @@ -14370,6 +14423,7 @@

      Used by:

      MIT License

      Used by:

        +
      • aho-corasick
      • aho-corasick
      • byteorder
      • globset
      • diff --git a/scripts/install.sh b/scripts/install.sh index 8e84dab7659..af6b3aae829 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.19.0" +PACKAGE_VERSION="v1.20.0" download_binary() { downloader --check diff --git a/xtask/Cargo.lock b/xtask/Cargo.lock index 07d60c7734b..096a137719c 100644 --- a/xtask/Cargo.lock +++ b/xtask/Cargo.lock @@ -10,13 +10,19 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -28,49 +34,58 @@ dependencies = [ [[package]] name = "anstream" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ "anstyle", "anstyle-parse", + "anstyle-query", "anstyle-wincon", - "concolor-override", - "concolor-query", + "colorchoice", "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "0.3.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" [[package]] name = "anstyle-parse" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" dependencies = [ "utf8parse", ] +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "anstyle-wincon" -version = "0.2.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "ascii" @@ -78,40 +93,12 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" -[[package]] -name = "async-recursion" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", -] - -[[package]] -name = "async-trait" -version = "0.1.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", -] - [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.20.0" @@ -120,9 +107,9 @@ checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bitflags" @@ -130,11 +117,20 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -144,9 +140,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "camino" @@ -185,9 +181,6 @@ name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] [[package]] name = "cfg-if" @@ -197,25 +190,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", - "js-sys", - "num-integer", "num-traits", - "serde", - "time 0.1.45", - "wasm-bindgen", "winapi", ] [[package]] name = "clap" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" dependencies = [ "clap_builder", "clap_derive", @@ -224,9 +213,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" dependencies = [ "anstream", "anstyle", @@ -237,31 +226,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.18", ] [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "combine" @@ -276,32 +261,17 @@ dependencies = [ "unreachable", ] -[[package]] -name = "concolor-override" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" - -[[package]] -name = "concolor-query" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" -dependencies = [ - "windows-sys 0.45.0", -] - [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -321,22 +291,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] -name = "crc32fast" -version = "1.3.2" +name = "cpufeatures" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ - "cfg-if", + "libc", ] [[package]] -name = "crossbeam-channel" -version = "0.5.7" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] @@ -349,54 +318,20 @@ dependencies = [ ] [[package]] -name = "cxx" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.13", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", + "generic-array", + "typenum", ] [[package]] name = "dialoguer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" dependencies = [ "console", "shell-words", @@ -405,10 +340,14 @@ dependencies = [ ] [[package]] -name = "dyn-clone" -version = "1.0.11" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] [[package]] name = "either" @@ -433,13 +372,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -463,21 +402,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -491,29 +430,13 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.28" @@ -521,7 +444,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -530,34 +452,12 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - [[package]] name = "futures-io" version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", -] - [[package]] name = "futures-sink" version = "0.3.28" @@ -576,11 +476,8 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ - "futures-channel", "futures-core", "futures-io", - "futures-macro", - "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -589,40 +486,24 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "typenum", + "version_check", ] [[package]] name = "getrandom" -version = "0.2.8" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "git2" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf7f68c2995f392c49fffb4f95ae2c873297830eb25c6bc4c114ce8f4562acc" -dependencies = [ - "bitflags", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", + "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] @@ -686,9 +567,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -766,9 +647,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -790,9 +671,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", @@ -801,22 +682,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "hyperx" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5617e92fc2f2501c3e2bc6ce547cad841adba2bae5b921c7e52510beca6d084c" -dependencies = [ - "base64 0.13.1", - "bytes", - "http", - "httpdate", - "language-tags", - "mime", - "percent-encoding", - "unicase", -] - [[package]] name = "iana-time-zone" version = "0.1.56" @@ -833,21 +698,19 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -862,6 +725,22 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "insta" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "pest", + "pest_derive", + "serde", + "similar", + "yaml-rust", +] + [[package]] name = "instant" version = "0.1.12" @@ -873,9 +752,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -890,14 +769,14 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -915,44 +794,15 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.0", - "pem", - "ring", - "serde", - "serde_json", - "simple_asn1", -] - -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lazy_static" version = "1.4.0" @@ -961,74 +811,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.141" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] -name = "libgit2-sys" -version = "0.14.2+1.5.1" +name = "linked-hash-map" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libssh2-sys" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" - -[[package]] -name = "lock_api" -version = "0.4.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "log" @@ -1037,15 +834,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", - "serde", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "memchr" version = "2.5.0" @@ -1058,7 +848,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673c6a442e72f0bca457afb369a8130596eeeb51c80a38b1dd39b6c490ed36c1" dependencies = [ - "rand 0.7.3", + "rand", ] [[package]] @@ -1067,21 +857,11 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -1107,27 +887,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -1147,36 +906,6 @@ dependencies = [ "libc", ] -[[package]] -name = "octorust" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8026de41fd49716168781d4737b200d1e20aeda7ff96d5521ac0cafa4898defa" -dependencies = [ - "anyhow", - "async-recursion", - "chrono", - "http", - "hyperx", - "jsonwebtoken", - "log", - "mime", - "pem", - "percent-encoding", - "reqwest", - "reqwest-conditional-middleware", - "reqwest-middleware", - "reqwest-retry", - "reqwest-tracing", - "ring", - "schemars", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "url", -] - [[package]] name = "once_cell" version = "1.17.1" @@ -1190,102 +919,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "openssl-src" -version = "111.25.2+1.1.1t" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.84" +name = "percent-encoding" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a20eace9dc2d82904039cb76dcf50fb1a0bba071cfd1629720b5d6f1ddba0fa" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] -name = "opentelemetry" -version = "0.17.0" +name = "pest" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", "thiserror", + "ucd-trie", ] [[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "windows-sys 0.45.0", -] - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pin-project" -version = "1.0.12" +name = "pest_derive" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" dependencies = [ - "pin-project-internal", + "pest", + "pest_generator", ] [[package]] -name = "pin-project-internal" -version = "1.0.12" +name = "pest_generator" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" dependencies = [ + "pest", + "pest_meta", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", +] + +[[package]] +name = "pest_meta" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +dependencies = [ + "once_cell", + "pest", + "sha2", ] [[package]] @@ -1300,12 +980,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1314,18 +988,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -1336,24 +1010,13 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.16", + "getrandom", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", "rand_hc", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -1361,17 +1024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -1380,16 +1033,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.8", + "getrandom", ] [[package]] @@ -1398,7 +1042,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1", + "rand_core", ] [[package]] @@ -1421,9 +1065,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", @@ -1432,17 +1076,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reqwest" -version = "0.11.16" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -1456,7 +1100,6 @@ dependencies = [ "js-sys", "log", "mime", - "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", @@ -1477,81 +1120,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "reqwest-conditional-middleware" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bce134f515eb4c2748bbd928086e7b0aae0d1568daf6c63b51e829aa6f2cf464" -dependencies = [ - "async-trait", - "reqwest", - "reqwest-middleware", - "task-local-extensions", -] - -[[package]] -name = "reqwest-middleware" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69539cea4148dce683bec9dc95be3f0397a9bb2c248a49c8296a9d21659a8cdd" -dependencies = [ - "anyhow", - "async-trait", - "futures", - "http", - "reqwest", - "serde", - "task-local-extensions", - "thiserror", -] - -[[package]] -name = "reqwest-retry" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce246a729eaa6aff5e215aee42845bf5fed9893cc6cd51aeeb712f34e04dd9f3" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "futures", - "http", - "hyper", - "reqwest", - "reqwest-middleware", - "retry-policies", - "task-local-extensions", - "tokio", - "tracing", -] - -[[package]] -name = "reqwest-tracing" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64977f9a47fa7768cc88751e29026e569730ac1667c2eaeaac04b32624849fbe" -dependencies = [ - "async-trait", - "opentelemetry", - "reqwest", - "reqwest-middleware", - "task-local-extensions", - "tokio", - "tracing", - "tracing-opentelemetry", -] - -[[package]] -name = "retry-policies" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09bbcb5003282bcb688f0bae741b278e9c7e8f378f561522c9806c58e075d9b" -dependencies = [ - "anyhow", - "chrono", - "rand 0.8.5", -] - [[package]] name = "ring" version = "0.16.20" @@ -1569,28 +1137,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.7" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -1611,7 +1179,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -1638,46 +1216,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "schemars" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" -dependencies = [ - "bytes", - "chrono", - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", - "url", - "uuid", -] - -[[package]] -name = "schemars_derive" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 1.0.109", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "sct" version = "0.7.0" @@ -1690,9 +1228,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", @@ -1703,9 +1241,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -1722,40 +1260,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.159" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -1781,12 +1308,14 @@ dependencies = [ ] [[package]] -name = "sharded-slab" -version = "0.1.4" +name = "sha2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "lazy_static", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] @@ -1796,25 +1325,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] -name = "signal-hook-registry" -version = "1.4.1" +name = "similar" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time 0.3.20", -] +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" [[package]] name = "slab" @@ -1825,12 +1339,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - [[package]] name = "socket2" version = "0.4.9" @@ -1866,9 +1374,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -1892,15 +1400,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "task-local-extensions" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" -dependencies = [ - "pin-utils", -] - [[package]] name = "tempfile" version = "3.5.0" @@ -1914,15 +1413,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.40" @@ -1940,55 +1430,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" -dependencies = [ - "itoa", - "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.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" -dependencies = [ - "time-core", + "syn 2.0.18", ] [[package]] @@ -2018,50 +1460,35 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", - "signal-hook-registry", "socket2", - "tokio-macros", - "windows-sys 0.45.0", -] - -[[package]] -name = "tokio-macros" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.13", + "windows-sys 0.48.0", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -2085,65 +1512,16 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", ] [[package]] @@ -2153,13 +1531,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] -name = "unicase" -version = "2.6.0" +name = "typenum" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-bidi" @@ -2169,9 +1550,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -2205,14 +1586,13 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] @@ -2221,24 +1601,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" @@ -2277,12 +1639,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2291,9 +1647,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2301,24 +1657,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", @@ -2328,9 +1684,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2338,28 +1694,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -2613,13 +1969,12 @@ dependencies = [ "console", "dialoguer", "flate2", - "git2", "graphql_client", + "insta", "itertools", "libc", "memorable-wordlist", "nu-ansi-term", - "octorust", "once_cell", "regex", "reqwest", @@ -2636,6 +1991,15 @@ dependencies = [ "zip", ] +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -2644,9 +2008,9 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zip" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "byteorder", "crc32fast", diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 577d83744aa..2e46c3fd4f4 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -12,34 +12,38 @@ publish = false anyhow = "1" base64 = "0.20" camino = "1" -clap = { version = "4.1.10", features = ["derive"] } +clap = { version = "4.3.0", features = ["derive"] } cargo_metadata = "0.15" -chrono = "0.4.24" -console = "0.15.5" -dialoguer = "0.10.3" +# Only use the `clock` features of `chrono` to avoid the `time` dependency +# impacted by CVE-2020-26235. https://github.com/chronotope/chrono/issues/602 +# and https://github.com/chronotope/chrono/issues/1073 will explain more. +chrono = { version = "0.4.26", default-features = false, features = ["clock"] } +console = "0.15.7" +dialoguer = "0.10.4" flate2 = "1" graphql_client = { version = "0.12.0", features = ["reqwest-rustls"] } -git2 = { version = "0.16.1", features = ["vendored-openssl"] } itertools = "0.10.5" libc = "0.2" memorable-wordlist = "0.1.7" nu-ansi-term = "0.47" -octorust = "0.2.2" once_cell = "1" -regex="1.7.1" +regex="1.8.3" reqwest = { version = "0.11", default-features = false, features = [ "blocking", "rustls-tls", "rustls-tls-native-roots", ] } -serde = { version = "1.0.152", features = ["derive"] } +serde = { version = "1.0.163", features = ["derive"] } serde_json = "1" serde_json_traversal = "0.2" tar = "0.4" tempfile = "3" tap = "1.0.1" tinytemplate = "1.2.1" -tokio = "1.25.0" +tokio = "1.28.2" which = "4" zip = { version = "0.6", default-features = false } -walkdir = "2.3.2" +walkdir = "2.3.3" + +[dev-dependencies] +insta = { version = "1.29.0", features = ["json", "redactions", "yaml"] } diff --git a/xtask/src/commands/changeset/mod.rs b/xtask/src/commands/changeset/mod.rs index 4872e04c7e1..005e2ea446e 100644 --- a/xtask/src/commands/changeset/mod.rs +++ b/xtask/src/commands/changeset/mod.rs @@ -39,7 +39,6 @@ use dialoguer::Confirm; use dialoguer::Editor; use dialoguer::Input; use dialoguer::Select; -use git2; use itertools::Itertools; use matching_pull_request::matching_pull_request::ResponseData; use matching_pull_request::matching_pull_request::Variables; @@ -67,15 +66,29 @@ struct TemplateContext { const REPO_WITH_OWNER: &'static str = "apollographql/router"; -const EXAMPLE_TEMPLATE: &'static str = "### {title} {{ for issue in issues -}} -([Issue #{issue.number}]({issue.url})){{ if not @last }}, {{ endif }} -{{- endfor }} +const EXAMPLE_TEMPLATE: &'static str = "### { title } +{{- if issues -}} + {{- if issues }} {{ endif -}} + {{- for issue in issues -}} + ([Issue #{issue.number}]({issue.url})) + {{- if not @last }}, {{ endif -}} + {{- endfor -}} +{{ else -}} + {{- if pulls -}} + {{- if pulls }} {{ endif -}} + {{- for pull in pulls -}} + ([PR #{pull.number}]({pull.url})) + {{- if not @last }}, {{ endif -}} + {{- endfor -}} + {{- else -}} + {{- endif -}} +{{- endif }} {body} -By [@{author}](https://github.com/{author}) in {{ for pull in pulls -}} +By [@{author}](https://github.com/{author}){{ if pulls }} in {{ for pull in pulls -}} {pull.url}{{ if not @last }}, {{ endif }} -{{- endfor }} +{{- endfor }}{{ endif }} "; impl Command { @@ -284,12 +297,16 @@ impl Create { selection == 0 }; - let branch_name: Option = match git2::Repository::open_from_env() { - Ok(repo) => { - let refr = repo.head().unwrap(); - if refr.is_branch() { - Some(refr.shorthand() - .expect("no shorthand Git branch name available").to_string()) + // Get the branch name, optionally, using `git rev-parse --abbrev-ref HEAD`. + let branch_name: Option = match std::process::Command::new("git") + .arg("rev-parse") + .arg("--abbrev-ref") + .arg("HEAD") + .output() + { + Ok(output) => { + if output.status.success() { + Some(String::from_utf8(output.stdout).unwrap().trim().to_string()) } else { None } @@ -607,3 +624,218 @@ impl TryFrom<&DirEntry> for Changeset { }) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER2"), + }, + ], + pulls: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER2"), + }, + ], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_multiple_prs_in_footer() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER"), + }], + pulls: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER2"), + }, + ], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_multiple_issues_in_title() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER2"), + }, + ], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_prs_in_title_when_empty_issues() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_without_prs_in_title_when_issues_present() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/ISSUE_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER"), + }], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_neither_issues_or_prs() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![], + pulls: vec![], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } +} diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap new file mode 100644 index 00000000000..da70c69e359 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER1](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER1)), ([Issue #ISSUE_NUMBER2](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER2)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap new file mode 100644 index 00000000000..eebeb051aa0 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER1](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER1)), ([Issue #ISSUE_NUMBER2](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER2)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER1, https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER2 + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap new file mode 100644 index 00000000000..03483bda37a --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER1, https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER2 + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap new file mode 100644 index 00000000000..11751d066f4 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap new file mode 100644 index 00000000000..c9c293d6840 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([PR #PULL_NUMBER](https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap new file mode 100644 index 00000000000..e0f310c4ae1 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Pull #PULL_NUMBER](https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap new file mode 100644 index 00000000000..06e4c08b512 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/pull/ISSUE_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/release.rs b/xtask/src/commands/release.rs index 8fe33358ae2..497ce4f7360 100644 --- a/xtask/src/commands/release.rs +++ b/xtask/src/commands/release.rs @@ -5,10 +5,6 @@ use anyhow::Error; use anyhow::Result; use cargo_metadata::MetadataCommand; use chrono::prelude::Utc; -use git2::Repository; -use octorust::types::PullsCreateRequest; -use octorust::Client; -use tap::TapFallible; use walkdir::WalkDir; use xtask::*; @@ -56,32 +52,14 @@ impl FromStr for Version { #[derive(Debug, clap::Parser)] pub struct Prepare { - /// Release from the current branch rather than creating a new one. - #[clap(long)] - current_branch: bool, - /// Skip the license check #[clap(long)] skip_license_ckeck: bool, - /// Dry run, don't commit the changes and create the PR. - #[clap(long)] - dry_run: bool, - /// The new version that is being created OR to bump (major|minor|patch|current). version: Version, } -macro_rules! git { - ($( $i:expr ),*) => { - let git = which::which("git")?; - let result = std::process::Command::new(git).args([$( $i ),*]).status()?; - if !result.success() { - return Err(anyhow!("git {}", [$( $i ),*].join(","))); - } - }; -} - macro_rules! replace_in_file { ($path:expr, $regex:expr, $replacement:expr) => { let before = std::fs::read_to_string($path)?; @@ -104,33 +82,17 @@ impl Prepare { self.ensure_pristine_checkout()?; self.ensure_prereqs()?; let version = self.update_cargo_tomls(&self.version)?; - let github = octorust::Client::new( - "router-release".to_string(), - octorust::auth::Credentials::Token( - std::env::var("GITHUB_TOKEN").expect("GITHUB_TOKEN env variable must be set"), - ), - )?; self.update_lock()?; self.check_compliance()?; if let Version::Nightly = &self.version { - println!("Skipping various steps becasuse this is a nightly build."); + println!("Skipping various steps because this is a nightly build."); } else { self.update_install_script(&version)?; self.update_helm_charts(&version)?; self.update_docs(&version)?; self.docker_files(&version)?; self.finalize_changelog(&version)?; - - if !self.dry_run { - if !self.current_branch { - self.switch_to_release_branch(&version)?; - } - - // This also commits all changes to previously tracked files - // created by this script. - self.create_release_pr(&github, &version).await?; - } } Ok(()) @@ -176,25 +138,9 @@ impl Prepare { if which::which("cargo-deny").is_err() { return Err(anyhow!("the 'cargo-deny' executable could not be found in your PATH. Install it by running `cargo install --locked cargo-deny")); } - - if let Version::Nightly = &self.version { - println!("Skipping requirement that GITHUB_TOKEN is set in the environment because this is a nightly release which doesn't yet need it."); - } else if std::env::var("GITHUB_TOKEN").is_err() { - return Err(anyhow!("the GITHUB_TOKEN environment variable must be set to a valid personal access token prior to starting a release. Obtain a personal access token at https://github.com/settings/tokens which has the 'repo' scope.")); - } - Ok(()) - } - - /// Create a new branch "#.#.#" where "#.#.#" is this release's version - /// (release) or "#.#.#-rc.#" (release candidate) - fn switch_to_release_branch(&self, version: &str) -> Result<()> { - println!("creating release branch"); - git!("fetch", "origin", &format!("dev:{version}")); - git!("checkout", version); Ok(()) } - /// Update the `version` in `*/Cargo.toml` (do not forget the ones in scaffold templates). /// Update the `apollo-router` version in the `dependencies` sections of the `Cargo.toml` files in `apollo-router-scaffold/templates/**`. fn update_cargo_tomls(&self, version: &Version) -> Result { println!("updating Cargo.toml files"); @@ -222,19 +168,27 @@ impl Prepare { "apollo-router" ]), Version::Nightly => { - let head_commit: String = match Repository::open_from_env() { - Ok(repo) => { - let revspec = repo.revparse("HEAD")?; - if revspec.mode().contains(git2::RevparseMode::SINGLE) { - let mut full_hash = revspec.from().unwrap().id().to_string(); - full_hash.truncate(8); - full_hash - } else { - panic!("unexpected rev-parse HEAD"); - } - } - Err(e) => panic!("failed to open: {e}"), - }; + // Get the first 8 characters of the current commit hash by running + // the Command::new("git") command. Be sure to take the output and + // run that through String::from_utf8(output.stdout) to get exactly + // an 8 character string. + let head_commit = std::process::Command::new("git") + .args(["rev-parse", "HEAD"]) + .output() + .expect("failed to execute 'git rev-parse HEAD'") + .stdout; + + // If it's empty, then we're in a bad state. + if head_commit.is_empty() { + return Err(anyhow!("failed to get the current commit hash")); + } + + // Convert it using `String::from_utf8_lossy`, which will turn + // any funky characters into something really noticeable. + let head_commit = String::from_utf8_lossy(&head_commit); + + // Just get the first 8 characters, for brevity. + let head_commit = head_commit.chars().take(8).collect::(); replace_in_file!( "./apollo-router/Cargo.toml", @@ -434,44 +388,4 @@ impl Prepare { cargo!(["check"]); Ok(()) } - - /// Create the release PR - async fn create_release_pr(&self, github: &Client, version: &str) -> Result<()> { - let git = which::which("git")?; - let result = std::process::Command::new(git) - .args(["branch", "--show-current"]) - .output()?; - if !result.status.success() { - return Err(anyhow!("failed to get git current branch")); - } - let current_branch = String::from_utf8(result.stdout)?; - - println!("creating release PR"); - git!("add", "-u"); - git!("commit", "-m", &format!("release {version}")); - git!( - "push", - "--set-upstream", - "origin", - &format!("{}:{}", current_branch.trim(), version) - ); - github - .pulls() - .create( - "apollographql", - "router", - &PullsCreateRequest { - base: "main".to_string(), - body: format!("Release {version}"), - draft: None, - head: version.to_string(), - issue: 0, - maintainer_can_modify: None, - title: format!("Release {version}"), - }, - ) - .await - .tap_err(|_| eprintln!("failed to create release PR"))?; - Ok(()) - } }