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

Function missingScopes

packages/react/src/plugins/oauth-reconnect.ts:185–193  ·  view source on GitHub ↗
(
  needed: readonly string[] | undefined,
  granted: readonly string[] | undefined,
)

Source from the content-addressed store, hash-verified

183 * (needed − granted), order-preserving. Empty when `granted` is a superset/equal
184 * or `needed` is empty. */
185export function missingScopes(
186 needed: readonly string[] | undefined,
187 granted: readonly string[] | undefined,
188): readonly string[] {
189 const want = normalizeScopes(needed ?? []);
190 if (want.length === 0) return [];
191 const have = new Set(normalizeScopes(granted ?? []));
192 return want.filter((scope: string) => !have.has(scope));
193}
194
195/** The scopes a connection was actually GRANTED, parsed from its space-delimited
196 * `oauthScope` record. Empty for static creds / when the AS omitted scope. */

Callers 2

connectionNeedsReconsentFunction · 0.85

Calls 1

normalizeScopesFunction · 0.85

Tested by

no test coverage detected