Skip to content

Commit d1cf876

Browse files
chore(release): router crates and artifacts (#583)
> [!IMPORTANT] > Merging this pull request will create these releases # query-planner 2.1.0 (2025-11-24) ## Features ### Directive-Based Authorization Introducing directive-based authorization. This allows you to enforce fine-grained access control directly from your subgraph schemas using the `@authenticated` and `@requiresScopes` directives. This new authorization layer runs before the query planner, ensuring that unauthorized requests are handled efficiently without reaching your subgraphs. ### Configuration You can configure how the router handles unauthorized requests with two modes: - **`filter`** (default): Silently removes any fields the user is not authorized to see from the query. The response will contain `null` for the removed fields and an error in the `errors` array. - **`reject`**: Rejects the entire GraphQL operation if it requests any field the user is not authorized to access. To configure this, add the following to your `router.yaml` configuration file: ```yaml authentication: directives: unauthorized: # "filter" (default): Removes unauthorized fields from the query and returns errors. # "reject": Rejects the entire request if any unauthorized field is requested. mode: reject ``` If this section is omitted, the router will use `filter` mode by default. ### JWT Scope Requirements When using the `@requiresScopes` directive, the router expects the user's granted scopes to be present in the JWT payload. The scopes should be in an array of strings or a string (scopes separated by space), within a claim named `scope`. Here is an example of a JWT payload with the correct format: ```json { "sub": "user-123", "scope": [ "read:products", "write:reviews" ], "iat": 1516239022 } ``` ## Fixes ### Avoid extra `query` prefix for anonymous queries When there is no variable definitions and no operation name, GraphQL queries can be sent without the `query` prefix. For example, instead of sending: ```diff - query { + { user(id: "1") { name } } ``` # config 0.0.12 (2025-11-24) ## Features ### Breaking Removed `pool_idle_timeout_seconds` from `traffic_shaping`, instead use `pool_idle_timeout` with duration format. ```diff traffic_shaping: - pool_idle_timeout_seconds: 30 + pool_idle_timeout: 30s ``` #540 by @ardatan # node-addon 0.0.4 (2025-11-24) ## Fixes ### Avoid extra `query` prefix for anonymous queries When there is no variable definitions and no operation name, GraphQL queries can be sent without the `query` prefix. For example, instead of sending: ```diff - query { + { user(id: "1") { name } } ``` # executor 6.1.0 (2025-11-24) ## Features ### Directive-Based Authorization Introducing directive-based authorization. This allows you to enforce fine-grained access control directly from your subgraph schemas using the `@authenticated` and `@requiresScopes` directives. This new authorization layer runs before the query planner, ensuring that unauthorized requests are handled efficiently without reaching your subgraphs. ### Configuration You can configure how the router handles unauthorized requests with two modes: - **`filter`** (default): Silently removes any fields the user is not authorized to see from the query. The response will contain `null` for the removed fields and an error in the `errors` array. - **`reject`**: Rejects the entire GraphQL operation if it requests any field the user is not authorized to access. To configure this, add the following to your `router.yaml` configuration file: ```yaml authentication: directives: unauthorized: # "filter" (default): Removes unauthorized fields from the query and returns errors. # "reject": Rejects the entire request if any unauthorized field is requested. mode: reject ``` If this section is omitted, the router will use `filter` mode by default. ### JWT Scope Requirements When using the `@requiresScopes` directive, the router expects the user's granted scopes to be present in the JWT payload. The scopes should be in an array of strings or a string (scopes separated by space), within a claim named `scope`. Here is an example of a JWT payload with the correct format: ```json { "sub": "user-123", "scope": [ "read:products", "write:reviews" ], "iat": 1516239022 } ``` ### Breaking Removed `pool_idle_timeout_seconds` from `traffic_shaping`, instead use `pool_idle_timeout` with duration format. ```diff traffic_shaping: - pool_idle_timeout_seconds: 30 + pool_idle_timeout: 30s ``` #540 by @ardatan # router 0.0.20 (2025-11-24) ## Features - support authenticated and requiresScopes directives (#538) ### Directive-Based Authorization Introducing directive-based authorization. This allows you to enforce fine-grained access control directly from your subgraph schemas using the `@authenticated` and `@requiresScopes` directives. This new authorization layer runs before the query planner, ensuring that unauthorized requests are handled efficiently without reaching your subgraphs. ### Configuration You can configure how the router handles unauthorized requests with two modes: - **`filter`** (default): Silently removes any fields the user is not authorized to see from the query. The response will contain `null` for the removed fields and an error in the `errors` array. - **`reject`**: Rejects the entire GraphQL operation if it requests any field the user is not authorized to access. To configure this, add the following to your `router.yaml` configuration file: ```yaml authentication: directives: unauthorized: # "filter" (default): Removes unauthorized fields from the query and returns errors. # "reject": Rejects the entire request if any unauthorized field is requested. mode: reject ``` If this section is omitted, the router will use `filter` mode by default. ### JWT Scope Requirements When using the `@requiresScopes` directive, the router expects the user's granted scopes to be present in the JWT payload. The scopes should be in an array of strings or a string (scopes separated by space), within a claim named `scope`. Here is an example of a JWT payload with the correct format: ```json { "sub": "user-123", "scope": [ "read:products", "write:reviews" ], "iat": 1516239022 } ``` ### Breaking Removed `pool_idle_timeout_seconds` from `traffic_shaping`, instead use `pool_idle_timeout` with duration format. ```diff traffic_shaping: - pool_idle_timeout_seconds: 30 + pool_idle_timeout: 30s ``` #540 by @ardatan ## Fixes ### Avoid extra `query` prefix for anonymous queries When there is no variable definitions and no operation name, GraphQL queries can be sent without the `query` prefix. For example, instead of sending: ```diff - query { + { user(id: "1") { name } } ``` Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
1 parent 5da9f86 commit d1cf876

File tree

16 files changed

+248
-102
lines changed

16 files changed

+248
-102
lines changed

.changeset/authz-directives.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

.changeset/extra-query-avoid.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

.changeset/shared_utilities_to_handle_vrl_expressions.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/router/CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
116116
### Other
117117

118118
- *(deps)* update release-plz/action action to v0.5.113 ([#389](https://github.com/graphql-hive/router/pull/389))
119+
## 0.0.20 (2025-11-24)
120+
121+
### Features
122+
123+
- support authenticated and requiresScopes directives (#538)
124+
125+
#### Directive-Based Authorization
126+
127+
Introducing directive-based authorization. This allows you to enforce fine-grained access control directly from your subgraph schemas using the `@authenticated` and `@requiresScopes` directives.
128+
129+
This new authorization layer runs before the query planner, ensuring that unauthorized requests are handled efficiently without reaching your subgraphs.
130+
131+
#### Configuration
132+
133+
You can configure how the router handles unauthorized requests with two modes:
134+
135+
- **`filter`** (default): Silently removes any fields the user is not authorized to see from the query. The response will contain `null` for the removed fields and an error in the `errors` array.
136+
- **`reject`**: Rejects the entire GraphQL operation if it requests any field the user is not authorized to access.
137+
138+
To configure this, add the following to your `router.yaml` configuration file:
139+
140+
```yaml
141+
authentication:
142+
directives:
143+
unauthorized:
144+
# "filter" (default): Removes unauthorized fields from the query and returns errors.
145+
# "reject": Rejects the entire request if any unauthorized field is requested.
146+
mode: reject
147+
```
148+
149+
If this section is omitted, the router will use `filter` mode by default.
150+
151+
#### JWT Scope Requirements
152+
153+
When using the `@requiresScopes` directive, the router expects the user's granted scopes to be present in the JWT payload. The scopes should be in an array of strings or a string (scopes separated by space), within a claim named `scope`.
154+
155+
Here is an example of a JWT payload with the correct format:
156+
157+
```json
158+
{
159+
"sub": "user-123",
160+
"scope": [
161+
"read:products",
162+
"write:reviews"
163+
],
164+
"iat": 1516239022
165+
}
166+
```
167+
168+
#### Breaking
169+
170+
Removed `pool_idle_timeout_seconds` from `traffic_shaping`, instead use `pool_idle_timeout` with duration format.
171+
172+
```diff
173+
traffic_shaping:
174+
- pool_idle_timeout_seconds: 30
175+
+ pool_idle_timeout: 30s
176+
```
177+
178+
##540 by @ardatan
179+
180+
### Fixes
181+
182+
#### Avoid extra `query` prefix for anonymous queries
183+
184+
When there is no variable definitions and no operation name, GraphQL queries can be sent without the `query` prefix. For example, instead of sending:
185+
186+
```diff
187+
- query {
188+
+ {
189+
user(id: "1") {
190+
name
191+
}
192+
}
193+
```
194+
119195
## 0.0.19 (2025-11-19)
120196

121197
### Features

bin/router/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hive-router"
3-
version = "0.0.19"
3+
version = "0.0.20"
44
edition = "2021"
55
description = "GraphQL router/gateway for Federation"
66
license = "MIT"
@@ -16,9 +16,9 @@ name = "hive_router"
1616
path = "src/main.rs"
1717

1818
[dependencies]
19-
hive-router-query-planner = { path = "../../lib/query-planner", version = "2.0.2" }
20-
hive-router-plan-executor = { path = "../../lib/executor", version = "6.0.1" }
21-
hive-router-config = { path = "../../lib/router-config", version = "0.0.11" }
19+
hive-router-query-planner = { path = "../../lib/query-planner", version = "2.1.0" }
20+
hive-router-plan-executor = { path = "../../lib/executor", version = "6.1.0" }
21+
hive-router-config = { path = "../../lib/router-config", version = "0.0.12" }
2222

2323
tokio = { workspace = true }
2424
futures = { workspace = true }

lib/executor/CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9494
### Other
9595

9696
- *(deps)* update release-plz/action action to v0.5.113 ([#389](https://github.com/graphql-hive/router/pull/389))
97+
## 6.1.0 (2025-11-24)
98+
99+
### Features
100+
101+
#### Directive-Based Authorization
102+
103+
Introducing directive-based authorization. This allows you to enforce fine-grained access control directly from your subgraph schemas using the `@authenticated` and `@requiresScopes` directives.
104+
105+
This new authorization layer runs before the query planner, ensuring that unauthorized requests are handled efficiently without reaching your subgraphs.
106+
107+
#### Configuration
108+
109+
You can configure how the router handles unauthorized requests with two modes:
110+
111+
- **`filter`** (default): Silently removes any fields the user is not authorized to see from the query. The response will contain `null` for the removed fields and an error in the `errors` array.
112+
- **`reject`**: Rejects the entire GraphQL operation if it requests any field the user is not authorized to access.
113+
114+
To configure this, add the following to your `router.yaml` configuration file:
115+
116+
```yaml
117+
authentication:
118+
directives:
119+
unauthorized:
120+
# "filter" (default): Removes unauthorized fields from the query and returns errors.
121+
# "reject": Rejects the entire request if any unauthorized field is requested.
122+
mode: reject
123+
```
124+
125+
If this section is omitted, the router will use `filter` mode by default.
126+
127+
#### JWT Scope Requirements
128+
129+
When using the `@requiresScopes` directive, the router expects the user's granted scopes to be present in the JWT payload. The scopes should be in an array of strings or a string (scopes separated by space), within a claim named `scope`.
130+
131+
Here is an example of a JWT payload with the correct format:
132+
133+
```json
134+
{
135+
"sub": "user-123",
136+
"scope": [
137+
"read:products",
138+
"write:reviews"
139+
],
140+
"iat": 1516239022
141+
}
142+
```
143+
144+
#### Breaking
145+
146+
Removed `pool_idle_timeout_seconds` from `traffic_shaping`, instead use `pool_idle_timeout` with duration format.
147+
148+
```diff
149+
traffic_shaping:
150+
- pool_idle_timeout_seconds: 30
151+
+ pool_idle_timeout: 30s
152+
```
153+
154+
##540 by @ardatan
155+
97156
## 6.0.1 (2025-11-04)
98157

99158
### Fixes

lib/executor/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hive-router-plan-executor"
3-
version = "6.0.1"
3+
version = "6.1.0"
44
edition = "2021"
55
description = "GraphQL query planner executor for Federation specification"
66
license = "MIT"
@@ -12,8 +12,8 @@ authors = ["The Guild"]
1212
[lib]
1313

1414
[dependencies]
15-
hive-router-query-planner = { path = "../query-planner", version = "2.0.2" }
16-
hive-router-config = { path = "../router-config", version = "0.0.11" }
15+
hive-router-query-planner = { path = "../query-planner", version = "2.1.0" }
16+
hive-router-config = { path = "../router-config", version = "0.0.12" }
1717

1818
graphql-parser = { workspace = true }
1919
graphql-tools = { workspace = true }

lib/node-addon/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
# @graphql-hive/router-query-planner changelog
2+
## 0.0.4 (2025-11-24)
3+
4+
### Fixes
5+
6+
#### Avoid extra `query` prefix for anonymous queries
7+
8+
When there is no variable definitions and no operation name, GraphQL queries can be sent without the `query` prefix. For example, instead of sending:
9+
10+
```diff
11+
- query {
12+
+ {
13+
user(id: "1") {
14+
name
15+
}
16+
}
17+
```
18+
219
## 0.0.3 (2025-11-06)
320

421
### Fixes

lib/node-addon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
edition = "2021"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
name = "node-addon"
55
publish = false
66

0 commit comments

Comments
 (0)