Strip OAuth authorization codes and CSRF state from exported span URL attributes, and sanitize user-supplied MCP endpoints before stamping them.
Showing the changes to packages/plugins/graphql/src (2 of 12 files). Show all
Unified · Split
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | import { Effect, Layer, Option } from "effect"; |
| 2 | 2 | import { HttpClient, HttpClientRequest } from "effect/unstable/http"; |
| 3 | 3 | |
| 4 | +import { endpointForTelemetry } from "@executor-js/sdk/core"; | |
| 5 | + | |
| 4 | 6 | import { GraphqlInvocationError } from "./errors"; |
| 5 | 7 | import { type OperationBinding, InvocationResult } from "./types"; |
| 6 | 8 | |
| @@ -13,14 +15,6 @@ const endpointWithQueryParams = (endpoint: string, queryParams: Record<string, s · 6 unmodified lines | ||
| 13 | 15 | return url.toString(); |
| 14 | 16 | }; |
| 15 | 17 | |
| 16 | −export const endpointForTelemetry = (endpoint: string): string => { | |
| 17 | − if (!URL.canParse(endpoint)) return endpoint; | |
| 18 | − const url = new URL(endpoint); | |
| 19 | − url.search = ""; | |
| 20 | − url.hash = ""; | |
| 21 | − return url.toString(); | |
| 22 | −}; | |
| 23 | − | |
| 24 | 18 | /** The operation string to send for a call. A caller-supplied `select` overrides |
| 25 | 19 | * the default scalar-leaf selection: it is spliced into the field's selection |
| 26 | 20 | * set (`field { <select> }`) so nested/list data can be requested per call. Falls |
| @@ -16,6 +16,7 @@ import { · 15 unmodified lines | ||
| 16 | 16 | ProviderKey, |
| 17 | 17 | ToolAddress, |
| 18 | 18 | createExecutor, |
| 19 | + endpointForTelemetry, | |
| 19 | 20 | } from "@executor-js/sdk"; |
| 20 | 21 | import { |
| 21 | 22 | makeTestConfig, |
| @@ -24,7 +25,6 @@ import { · 2 unmodified lines | ||
| 24 | 25 | } from "@executor-js/sdk/testing"; |
| 25 | 26 | |
| 26 | 27 | import { graphqlPlugin } from "./plugin"; |
| 27 | −import { endpointForTelemetry } from "./invoke"; | |
| 28 | 28 | import { introspect } from "./introspect"; |
| 29 | 29 | import type { IntrospectionResult } from "./introspect"; |
| 30 | 30 | import { |