History

Scrub credentials from span attributes

Strip OAuth authorization codes and CSRF state from exported span URL attributes, and sanitize user-supplied MCP endpoints before stamping them.

Rhys Sullivan committed 3 months ago

Commit 114d8661 parent fc1e58912 files · +666 −13Browse files

Showing the changes to packages/plugins/graphql/src (2 of 12 files). Show all

Unified · Split

2 files
  1. packages/plugins/graphql/src/sdk/invoke.ts +2 −8
  2. packages/plugins/graphql/src/sdk/plugin.test.ts +1 −1
packages/plugins/graphql/src/sdk/invoke.ts+2−8
@@ -1,6 +1,8 @@
11 import { Effect, Layer, Option } from "effect";
22 import { HttpClient, HttpClientRequest } from "effect/unstable/http";
33
4+import { endpointForTelemetry } from "@executor-js/sdk/core";
5+
46 import { GraphqlInvocationError } from "./errors";
57 import { type OperationBinding, InvocationResult } from "./types";
68
@@ -13,14 +15,6 @@ const endpointWithQueryParams = (endpoint: string, queryParams: Record<string, s · 6 unmodified lines
1315 return url.toString();
1416 };
1517
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−
2418 /** The operation string to send for a call. A caller-supplied `select` overrides
2519 * the default scalar-leaf selection: it is spliced into the field's selection
2620 * set (`field { <select> }`) so nested/list data can be requested per call. Falls
packages/plugins/graphql/src/sdk/plugin.test.ts+1−1
@@ -16,6 +16,7 @@ import { · 15 unmodified lines
1616 ProviderKey,
1717 ToolAddress,
1818 createExecutor,
19+ endpointForTelemetry,
1920 } from "@executor-js/sdk";
2021 import {
2122 makeTestConfig,
@@ -24,7 +25,6 @@ import { · 2 unmodified lines
2425 } from "@executor-js/sdk/testing";
2526
2627 import { graphqlPlugin } from "./plugin";
27−import { endpointForTelemetry } from "./invoke";
2828 import { introspect } from "./introspect";
2929 import type { IntrospectionResult } from "./introspect";
3030 import {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t