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

Function recordedOAuthScope

packages/core/sdk/src/oauth-service.ts:207–218  ·  view source on GitHub ↗
(
  token: OAuth2TokenResponse,
  requestedScopes: readonly string[],
)

Source from the content-addressed store, hash-verified

205};
206
207const recordedOAuthScope = (
208 token: OAuth2TokenResponse,
209 requestedScopes: readonly string[],
210): string | null => {
211 if (token.scope == null) return requestedScopes.join(" ") || null;
212
213 const granted = token.scope.split(/\s+/).filter(Boolean);
214 const coveredByRefreshToken =
215 token.refresh_token && requestedScopes.includes("offline_access") ? ["offline_access"] : [];
216 const recorded = dedupeScopes([...granted, ...coveredByRefreshToken]);
217 return recorded.join(" ") || null;
218};
219
220const OAUTH_SCOPE_ALIASES: Readonly<Record<string, string>> = {
221 "https://www.googleapis.com/auth/userinfo.email": "email",

Callers 1

mintFromTokenFunction · 0.85

Calls 1

dedupeScopesFunction · 0.85

Tested by

no test coverage detected