Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .changeset/authz-directives.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/shared_utilities_to_handle_vrl_expressions.md

This file was deleted.

8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions bin/router/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Other

- *(deps)* update release-plz/action action to v0.5.113 ([#389](https://github.com/graphql-hive/router/pull/389))
## 0.0.20 (2025-11-21)

### 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

## 0.0.19 (2025-11-19)

### Features
Expand Down
8 changes: 4 additions & 4 deletions bin/router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hive-router"
version = "0.0.19"
version = "0.0.20"
edition = "2021"
description = "GraphQL router/gateway for Federation"
license = "MIT"
Expand All @@ -16,9 +16,9 @@ name = "hive_router"
path = "src/main.rs"

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

tokio = { workspace = true }
futures = { workspace = true }
Expand Down
59 changes: 59 additions & 0 deletions lib/executor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Other

- *(deps)* update release-plz/action action to v0.5.113 ([#389](https://github.com/graphql-hive/router/pull/389))
## 6.1.0 (2025-11-21)

### 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

## 6.0.1 (2025-11-04)

### Fixes
Expand Down
6 changes: 3 additions & 3 deletions lib/executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hive-router-plan-executor"
version = "6.0.1"
version = "6.1.0"
edition = "2021"
description = "GraphQL query planner executor for Federation specification"
license = "MIT"
Expand All @@ -12,8 +12,8 @@ authors = ["The Guild"]
[lib]

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

graphql-parser = { workspace = true }
graphql-tools = { workspace = true }
Expand Down
46 changes: 46 additions & 0 deletions lib/query-planner/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Other

- *(deps)* update release-plz/action action to v0.5.113 ([#389](https://github.com/graphql-hive/router/pull/389))
## 2.1.0 (2025-11-21)

### 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
}
```
2 changes: 1 addition & 1 deletion lib/query-planner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hive-router-query-planner"
version = "2.0.2"
version = "2.1.0"
edition = "2021"
description = "GraphQL query planner for Federation specification"
license = "MIT"
Expand Down
16 changes: 16 additions & 0 deletions lib/router-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- *(hive-router)* fix docker image issues ([#394](https://github.com/graphql-hive/router/pull/394))
## 0.0.12 (2025-11-21)

### 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

## 0.0.11 (2025-11-04)

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion lib/router-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hive-router-config"
version = "0.0.11"
version = "0.0.12"
edition = "2021"
publish = true
license = "MIT"
Expand Down
Loading