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

Function withSourceAuthOauth

packages/core/sdk/src/migration-spec.ts:978–987  ·  view source on GitHub ↗
(
  auth: V1SourceAuth | undefined,
  slotToTemplateSlug: Record<string, string>,
  slotToVariable: Record<string, string>,
)

Source from the content-addressed store, hash-verified

976/** Fold a v1 `auth:{kind:oauth2, connectionSlot}` into the slot maps so the
977 * connection that binds that slot resolves to the conventional oauth method. */
978const withSourceAuthOauth = (
979 auth: V1SourceAuth | undefined,
980 slotToTemplateSlug: Record<string, string>,
981 slotToVariable: Record<string, string>,
982): void => {
983 if (auth?.kind === "oauth2" && auth.connectionSlot) {
984 slotToTemplateSlug[auth.connectionSlot] = OAUTH_TEMPLATE_SLUG;
985 slotToVariable[auth.connectionSlot] = PRIMARY_INPUT_VARIABLE;
986 }
987};
988
989export const migrateMcpSourceConfig = (v1: V1McpSourceConfig): MigratedSourceConfig => {
990 const apikey = migrateOpenApiAuthTemplate({ headers: v1.headers, queryParams: v1.queryParams });

Callers 2

migrateMcpSourceConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected