You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/router/authentication-and-authorization.mdx
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,54 @@ The router configuration facilitates the setup of multiple JWKS (JSON Web Key Se
56
56
57
57
For more information on the attributes, visit the auth configuration parameter section page [here](/router/configuration#authentication).
58
58
59
+
### Disabling Authentication for Introspection Operations
60
+
61
+
Cosmo Router supports bypassing authentication for introspection queries.
62
+
63
+
This is useful, for example, when you want to configure client tooling from within a secured environment without requiring authentication tokens.
64
+
Instead of having to disable authentication altogether, this feature allows you to keep the configuration as close to production as possible while still using introspection queries easily.
65
+
Additionally, you can define a dedicated secret to authenticate introspection queries.
66
+
67
+
<Warning>
68
+
This feature is meant to be used in secure, internal environments. It is not recommended for use in a production environment.
69
+
By default, introspection queries are not excluded from authentication.
70
+
</Warning>
71
+
72
+
To enable this feature, add the following section to your router configuration:
73
+
74
+
<CodeGroup>
75
+
```yaml config.yaml
76
+
authentication:
77
+
ignore_introspection: true # default is false
78
+
# other auth settings here
79
+
```
80
+
</CodeGroup>
81
+
82
+
Now, when you send an introspection query, you won't need to provide an authentication token.
Copy file name to clipboardExpand all lines: docs/router/configuration.mdx
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,7 @@ The following sections describe each configuration in detail with all available
134
134
| CONTROLPLANE_URL | controlplane_url | <Icon icon="square-check" iconType="solid" /> | The controlplane url. Not required when a static execution config is provided. | https://cosmo-cp.wundergraph.com |
135
135
| PLAYGROUND_ENABLED | playground_enabled | <Icon icon="square" /> | Enables the GraphQL playground on (`$LISTEN_ADDR/`) | true |
136
136
| PLAYGROUND_PATH | playground_path | <Icon icon="square" /> | The path where the playground is served | "/" |
| INTROSPECTION_ENABLED | introspection_enabled | <Icon icon="square" /> | Enables the GraphQL introspection (deprecated, use `introspection.enabled` instead) | true |
138
138
| QUERY_PLANS_ENABLED | query_plans_enabled | <Icon icon="square" /> | The Router can return Query plans as part of the response, which might be useful to understand the execution. | true |
139
139
| LOG_LEVEL | log_level | <Icon icon="square" /> | The log level to use. Allowed levels are `"debug"`, `"info"`, `"warn"`, `"error"`, `"panic"`, `"fatal"`. | info |
140
140
| JSON_LOG | json_log | <Icon icon="square" /> | Render the log output in JSON format (true) or human readable (false) | true |
| INTROSPECTION_SECRET | secret | <Icon icon="square" /> | Optional, dedicated secret used for instrospection authentication. Only used when `authentication.ignore_introspection` is set to `true`. | |
320
+
321
+
### Example YAML config:
322
+
323
+
```yaml config.yaml
324
+
version: "1"
325
+
326
+
introspection:
327
+
enabled: true
328
+
secret: "dedicated_secret_for_introspection"
329
+
```
330
+
307
331
## MCP (Model Context Protocol)
308
332
309
333
The Model Context Protocol (MCP) server allows AI models to discover and interact with your GraphQL API in a secure way.
@@ -1506,6 +1530,21 @@ authentication:
1506
1530
name: X-Authorization
1507
1531
```
1508
1532
1533
+
### Bypass Introspection Authentication
1534
+
1535
+
This is useful when you want to bypass authentication for introspection queries,
1536
+
for example let certain tools introspect the schema without requiring authentication token.
1537
+
1538
+
<Warning>
1539
+
This feature is meant to be used in secure, internal environments. It is not recommended for use in a production environment.
1540
+
By default, introspection queries are not excluded from authentication.
1541
+
Also consider setting `introspection.secret` for a static secret dedicated to introspection queries.
0 commit comments