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 @@
1import { Effect, Layer, Option } from "effect";1import { Effect, Layer, Option } from "effect";
2import { HttpClient, HttpClientRequest } from "effect/unstable/http";2import { HttpClient, HttpClientRequest } from "effect/unstable/http";
3 3
4import { endpointForTelemetry } from "@executor-js/sdk/core";
5
4import { GraphqlInvocationError } from "./errors";6import { GraphqlInvocationError } from "./errors";
5import { type OperationBinding, InvocationResult } from "./types";7import { type OperationBinding, InvocationResult } from "./types";
6 8
@@ -13,14 +15,6 @@ const endpointWithQueryParams = (endpoint: string, queryParams: Record<string, s · 6 unmodified lines
13 return url.toString();15 return url.toString();
14};16};
15 17
16export 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/** The operation string to send for a call. A caller-supplied `select` overrides18/** The operation string to send for a call. A caller-supplied `select` overrides
25 * the default scalar-leaf selection: it is spliced into the field's selection19 * the default scalar-leaf selection: it is spliced into the field's selection
26 * set (`field { <select> }`) so nested/list data can be requested per call. Falls20 * 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
16 ProviderKey,16 ProviderKey,
17 ToolAddress,17 ToolAddress,
18 createExecutor,18 createExecutor,
19 endpointForTelemetry,
19} from "@executor-js/sdk";20} from "@executor-js/sdk";
20import {21import {
21 makeTestConfig,22 makeTestConfig,
@@ -24,7 +25,6 @@ import { · 2 unmodified lines
24} from "@executor-js/sdk/testing";25} from "@executor-js/sdk/testing";
25 26
26import { graphqlPlugin } from "./plugin";27import { graphqlPlugin } from "./plugin";
27import { endpointForTelemetry } from "./invoke";
28import { introspect } from "./introspect";28import { introspect } from "./introspect";
29import type { IntrospectionResult } from "./introspect";29import type { IntrospectionResult } from "./introspect";
30import {30import {

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