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

Function providerAuthorizeExtras

packages/core/sdk/src/oauth-helpers.ts:266–282  ·  view source on GitHub ↗
(
  authorizationUrl: string,
)

Source from the content-addressed store, hash-verified

264 * can only declare RFC scopes, so this host-level quirk must apply to both
265 * first-party and workspace-owned HubSpot OAuth clients. */
266export const providerAuthorizeExtras = (
267 authorizationUrl: string,
268): Readonly<Record<string, string>> => {
269 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: URL() throws on invalid input → no provider extras
270 try {
271 const host = new URL(authorizationUrl).host.toLowerCase();
272 if (host === "accounts.google.com") {
273 return { access_type: "offline", prompt: "consent" };
274 }
275 if (host === "app.hubspot.com") {
276 return { optional_scope: HUBSPOT_OPTIONAL_SCOPES.join(" ") };
277 }
278 } catch {
279 // Unparseable authorization URL — let buildAuthorizationUrl surface the error.
280 }
281 return {};
282};
283
284/** Provider-specific scopes embedded in an integration's authorization
285 * endpoint. HubSpot models app-optional permissions with the non-standard

Callers 2

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected