MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / intersectScopes

Function intersectScopes

packages/core/sdk/src/oauth-service.ts:361–368  ·  view source on GitHub ↗
(
  requested: readonly string[],
  supported: readonly string[] | undefined,
)

Source from the content-addressed store, hash-verified

359const dedupeScopes = (scopes: readonly string[]): readonly string[] => [...new Set(scopes)];
360
361const intersectScopes = (
362 requested: readonly string[],
363 supported: readonly string[] | undefined,
364): readonly string[] => {
365 if (!supported || supported.length === 0) return requested;
366 const supportedSet = new Set(supported);
367 return requested.filter((scope) => supportedSet.has(scope));
368};
369
370const recordedOAuthScope = (
371 token: OAuth2TokenResponse,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected