Skip to content

Commit 81b7f8b

Browse files
chore(release): router crates and artifacts (#548)
Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
1 parent f1936a5 commit 81b7f8b

7 files changed

+99
-57
lines changed

.changeset/internal_refactor_that_prevents_the_need_to_create_some_structs_clientrequestdetails_twice_this_change_also_eliminates_the_need_to_have_clones.md

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

.changeset/jwt_improve_the_implementation_of_jwt_plugin_and_expose_it_to_expressions.md

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

Cargo.lock

Lines changed: 2 additions & 2 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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,51 @@ 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.16 (2025-11-04)
120+
121+
### Fixes
122+
123+
- Internal refactor that prevents the need to create some structs (`ClientRequestDetails`) twice. This change also eliminates the need to have clones
124+
125+
#### Improve the implementation of jwt plugin and expose it to expressions.
126+
127+
The following properties are available in the request object exposed to VRL expressions:
128+
- `request.jwt` will always be an object
129+
- `request.jwt.authenticated` with value of true or false
130+
- `request.jwt.prefix` can either be a string or null (if prefix is not used)
131+
- `request.jwt.token` can be string (when authenticated=true) or null (when authenticated=false)
132+
- `request.jwt.claims` will always be an array (either empty or with values), containing the full JWT token claims payload.
133+
- `request.jwt.scopes` will always be an array (either empty or with values), containing the scopes extracted from the claims
134+
135+
Here are examples on how to use the JWT properties in a VRL expression:
136+
137+
```yaml
138+
## Passes the user-id held in `.sub` claims of the token to the subgraph, or EMPTY
139+
headers:
140+
all:
141+
request:
142+
- insert:
143+
name: X-User-ID
144+
expression: |
145+
if .request.jwt.authenticated == true {
146+
.request.jwt.claims.sub
147+
} else {
148+
"EMPTY"
149+
}
150+
```
151+
152+
```yaml
153+
## Passes a custom header based on the status of the authentication and the status of the JWT scopes
154+
headers:
155+
subgraphs:
156+
accounts:
157+
request:
158+
- insert:
159+
name: X-Can-Read
160+
expression: |
161+
if .request.jwt.authenticated == true && includes!(.request.jwt.scopes, "read:accounts") {
162+
"Yes"
163+
} else {
164+
"No"
165+
}
166+
```

bin/router/Cargo.toml

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

1818
[dependencies]
1919
hive-router-query-planner = { path = "../../lib/query-planner", version = "2.0.2" }
20-
hive-router-plan-executor = { path = "../../lib/executor", version = "6.0.0" }
20+
hive-router-plan-executor = { path = "../../lib/executor", version = "6.0.1" }
2121
hive-router-config = { path = "../../lib/router-config", version = "0.0.10" }
2222

2323
tokio = { workspace = true }

lib/executor/CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,49 @@ 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.0.1 (2025-11-04)
98+
99+
### Fixes
100+
101+
#### Improve the implementation of jwt plugin and expose it to expressions.
102+
103+
The following properties are available in the request object exposed to VRL expressions:
104+
- `request.jwt` will always be an object
105+
- `request.jwt.authenticated` with value of true or false
106+
- `request.jwt.prefix` can either be a string or null (if prefix is not used)
107+
- `request.jwt.token` can be string (when authenticated=true) or null (when authenticated=false)
108+
- `request.jwt.claims` will always be an array (either empty or with values), containing the full JWT token claims payload.
109+
- `request.jwt.scopes` will always be an array (either empty or with values), containing the scopes extracted from the claims
110+
111+
Here are examples on how to use the JWT properties in a VRL expression:
112+
113+
```yaml
114+
## Passes the user-id held in `.sub` claims of the token to the subgraph, or EMPTY
115+
headers:
116+
all:
117+
request:
118+
- insert:
119+
name: X-User-ID
120+
expression: |
121+
if .request.jwt.authenticated == true {
122+
.request.jwt.claims.sub
123+
} else {
124+
"EMPTY"
125+
}
126+
```
127+
128+
```yaml
129+
## Passes a custom header based on the status of the authentication and the status of the JWT scopes
130+
headers:
131+
subgraphs:
132+
accounts:
133+
request:
134+
- insert:
135+
name: X-Can-Read
136+
expression: |
137+
if .request.jwt.authenticated == true && includes!(.request.jwt.scopes, "read:accounts") {
138+
"Yes"
139+
} else {
140+
"No"
141+
}
142+
```

lib/executor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hive-router-plan-executor"
3-
version = "6.0.0"
3+
version = "6.0.1"
44
edition = "2021"
55
description = "GraphQL query planner executor for Federation specification"
66
license = "MIT"

0 commit comments

Comments
 (0)