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

Function describeAuthMethodsForRow

packages/core/sdk/src/executor.ts:3079–3111  ·  view source on GitHub ↗
(
      row: IntegrationRow,
    )

Source from the content-addressed store, hash-verified

3077 // failing the catalog read.
3078 const warnedInvalidAuthMethods = new Set<string>();
3079 const describeAuthMethodsForRow = (
3080 row: IntegrationRow,
3081 ): Effect.Effect<readonly AuthMethodDescriptor[]> =>
3082 Effect.gen(function* () {
3083 const runtime = runtimes.get(row.plugin_id);
3084 const describe = runtime?.plugin.describeAuthMethods;
3085 if (!describe) return [];
3086 const record = rowToIntegrationRecord(row);
3087 const methods = yield* Effect.sync(() => describe(record)).pipe(
3088 // A malformed plugin projector must never fail the catalog read.
3089 Effect.catchCause(() => Effect.succeed([])),
3090 );
3091 const valid: AuthMethodDescriptor[] = [];
3092 for (const method of methods) {
3093 if (method.kind === "none" && method.placements !== undefined) {
3094 const warningKey = [row.plugin_id, row.slug, method.id]
3095 .map((value) => `${value.length}:${value}`)
3096 .join("");
3097 if (!warnedInvalidAuthMethods.has(warningKey)) {
3098 warnedInvalidAuthMethods.add(warningKey);
3099 yield* Effect.logWarning("executor omitted invalid plugin auth method", {
3100 plugin: row.plugin_id,
3101 integration: row.slug,
3102 method: method.id,
3103 reason: "no-auth methods cannot declare credential placements",
3104 });
3105 }
3106 continue;
3107 }
3108 valid.push(method);
3109 }
3110 return valid;
3111 });
3112
3113 const describeDisplayForRow = (row: IntegrationRow): IntegrationDisplayDescriptor => {
3114 const runtime = runtimes.get(row.plugin_id);

Callers 9

integrationsListFunction · 0.85
integrationsGetFunction · 0.85
integrationsGetRecordFunction · 0.85
integrationsRemoveFunction · 0.85
connectionsCreateFunction · 0.85
connectionCheckHealthFunction · 0.85
connectionValidateFunction · 0.85
createExecutorFunction · 0.85

Calls 4

rowToIntegrationRecordFunction · 0.85
pushMethod · 0.80
getMethod · 0.65
syncMethod · 0.65

Tested by

no test coverage detected