Skip to content

Commit

Permalink
release: v1.10.3 (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Feb 10, 2023
2 parents 5c21ca5 + 7391fd2 commit 46f4079
Show file tree
Hide file tree
Showing 64 changed files with 2,326 additions and 1,179 deletions.
2 changes: 1 addition & 1 deletion .changesets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The convention used in this directory and obeyed by the `cargo xtask changeset c
- **Maintenance**: `maint_`
- **Documentation**: `docs_`
- **Experimental**: `exp_`
4. The pattern proceeding the prefix can be anything that matches `[a-z_]+` (i.e., any number of lowercased `a-z` and `_`). Again, `.md` must be on the end as the extension. For example, `feat_flying_forest_foxes.md`.
4. The pattern following the prefix can be anything that matches `[a-z_]+` (i.e., any number of lowercased `a-z` and `_`). Again, `.md` must be on the end as the extension. For example, `feat_flying_forest_foxes.md`.
5. Other files not matching the above convention will be ignored, including this `README.md`.
6. The files must use the following format:

Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,45 @@ 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.10.3] - 2023-02-10

## 🐛 Fixes

### Per-type metrics based on FTV1 from subgraphs ([Issue #2551](https://github.com/apollographql/router/issues/2551))

[Since version 1.7.0](https://github.com/apollographql/router/blob/dev/CHANGELOG.md#traces-wont-cause-missing-field-stats-issue-2267), Apollo Router generates metrics directly instead of deriving them from traces being sent to Apollo Studio. However, these metrics were incomplete. This adds, based on data reported by subgraphs, the following:

- Statistics about each field of each type of the GraphQL type system
- Statistics about errors at each path location of GraphQL responses

By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/2541

## 🛠 Maintenance

### Run `rustfmt` on `xtask/`, too ([Issue #2557](https://github.com/apollographql/router/issues/2557))

Our `xtask` runs `cargo fmt --all` which reformats of Rust code in all crates of the workspace. However, the code of xtask itself is a separate workspace. In order for it to be formatted with the same configuration, running a second `cargo` command is required. This adds that second command, and applies the corresponding formatting.

Fixes https://github.com/apollographql/router/issues/2557

By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/2561

## 🧪 Experimental

### Add support to JWT Authentication for JWK without specified `alg`

Prior to this change, the router would only make use of a JWK for JWT verification if the key had an `alg` property.

Now, the router searches through the set of configured JWKS (JSON Web Key Sets) to find the best matching JWK according to the following criteria:

- a matching `kid` and `alg`; or
- a matching `kid` and _algorithm family_ (`kty`, per the [RFC 7517](https://www.rfc-editor.org/rfc/rfc7517); or
- a matching _algorithm family_ (`kty`)

The algorithm family is used when the JWKS contain a JWK for which no `alg` is specified.

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/2540

# [1.10.2] - 2023-02-08

## 🐛 Fixes
Expand Down
35 changes: 4 additions & 31 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -169,13 +168,12 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.10.2"
version = "1.10.3"
dependencies = [
"access-json",
"ansi_term",
"anyhow",
"apollo-compiler",
"apollo-encoder 0.4.0",
"apollo-parser 0.4.1",
"arc-swap",
"askama",
Expand Down Expand Up @@ -298,27 +296,23 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.10.2"
version = "1.10.3"
dependencies = [
"apollo-parser 0.4.1",
"apollo-router",
"apollo-smith",
"arbitrary",
"async-trait",
"criterion",
"futures",
"memory-stats",
"once_cell",
"serde_json",
"serde_json_bytes",
"tokio",
"tower",
"tracing-subscriber",
]

[[package]]
name = "apollo-router-scaffold"
version = "1.10.2"
version = "1.10.3"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -429,7 +423,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"http",
"schemars",
"serde",
Expand Down Expand Up @@ -940,10 +933,7 @@ dependencies = [
name = "compose-your-graphql-router"
version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"serde_json",
"tokio",
"tower",
]
Expand Down Expand Up @@ -1081,7 +1071,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"http",
"tower",
"tracing",
Expand All @@ -1099,7 +1088,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -1761,7 +1749,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"http",
"serde_json",
"tokio",
Expand All @@ -1775,7 +1762,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -2217,7 +2203,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"schemars",
"serde",
"serde_json",
Expand Down Expand Up @@ -2697,7 +2682,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"hex",
"http",
"jwt-simple",
Expand All @@ -2716,7 +2700,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -3343,7 +3326,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -4006,7 +3988,6 @@ dependencies = [
"anyhow",
"apollo-router",
"async-trait",
"futures",
"http",
"schemars",
"serde",
Expand Down Expand Up @@ -4368,7 +4349,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand All @@ -4381,7 +4361,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand All @@ -4394,7 +4373,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand All @@ -4407,7 +4385,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand All @@ -4420,7 +4397,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-router",
"futures",
"http",
"serde_json",
"tokio",
Expand Down Expand Up @@ -5221,12 +5197,8 @@ version = "0.1.0"
dependencies = [
"anyhow",
"apollo-compiler",
"apollo-parser 0.4.1",
"apollo-router",
"async-trait",
"futures",
"http",
"once_cell",
"tower",
"tracing",
]
Expand Down Expand Up @@ -5625,6 +5597,7 @@ dependencies = [
"futures-core",
"futures-sink",
"pin-project-lite",
"slab",
"tokio",
"tracing",
]
Expand Down
6 changes: 1 addition & 5 deletions apollo-router-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-benchmarks"
version = "1.10.2"
version = "1.10.3"
authors = ["Apollo Graph, Inc. <[email protected]>"]
edition = "2021"
license = "Elastic-2.0"
Expand All @@ -11,14 +11,10 @@ publish = false
[dev-dependencies]
apollo-router = { path = "../apollo-router" }
criterion = { version = "0.4", features = ["async_tokio", "async_futures"] }
futures = "0.3"
memory-stats = "1.1.0"
once_cell = "1"
serde_json = { version = "1", features = ["preserve_order"] }
serde_json_bytes = { version = "0.2.0", features = ["preserve_order"] }
tokio = { version = "1", features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
async-trait = "0.1"
tower = "0.4"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-scaffold"
version = "1.10.2"
version = "1.10.3"
authors = ["Apollo Graph, Inc. <[email protected]>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.2"
apollo-router = "1.10.3"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.2" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.10.3" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
7 changes: 3 additions & 4 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.10.2"
version = "1.10.3"
authors = ["Apollo Graph, Inc. <[email protected]>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://www.apollographql.com/docs/router/"
Expand Down Expand Up @@ -42,7 +42,6 @@ access-json = "0.1.0"
anyhow = "1.0.68"
ansi_term = "0.12"
apollo-compiler = "0.6.0"
apollo-encoder = "0.4.0"
apollo-parser = "0.4.1"
arc-swap = "1.6.0"
async-compression = { version = "0.3.15", features = [
Expand Down Expand Up @@ -159,7 +158,7 @@ reqwest = { version = "0.11.14", default-features = false, features = [
"json",
"stream",
] }
router-bridge = "0.1.15+v2.3.1"
router-bridge = "0.1.15"
rust-embed="6.4.2"
rustls = "0.20.8"
rustls-pemfile = "1.0.2"
Expand All @@ -178,7 +177,7 @@ sys-info = "0.9.1"
thiserror = "1.0.38"
tokio = { version = "1.25.0", features = ["full"] }
tokio-stream = { version = "0.1.11", features = ["sync", "net"] }
tokio-util = { version = "0.7.4", features = ["net", "codec"] }
tokio-util = { version = "0.7.4", 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 = [
Expand Down
15 changes: 15 additions & 0 deletions apollo-router/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ impl Context {
result.map_err(|e| e.into())
}

/// Upsert a JSON value in the context using the provided key and resolving
/// function.
///
/// The resolving function must yield a value to be used in the context. It
/// is provided with the current value to use in evaluating which value to
/// yield.
pub(crate) fn upsert_json_value<K>(&self, key: K, upsert: impl Fn(Value) -> Value)
where
K: Into<String>,
{
let key = key.into();
self.entries.entry(key.clone()).or_insert(Value::Null);
self.entries.alter(&key, |_, v| upsert(v));
}

/// Iterate over the entries.
pub fn iter(&self) -> impl Iterator<Item = RefMulti<'_, String, Value>> + '_ {
self.entries.iter()
Expand Down
Loading

0 comments on commit 46f4079

Please sign in to comment.