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

Function describeAuthMethodsForRow

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

Source from the content-addressed store, hash-verified

3125 // failing the catalog read.
3126 const warnedInvalidAuthMethods = new Set<string>();
3127 const describeAuthMethodsForRow = (
3128 row: IntegrationRow,
3129 ): Effect.Effect<readonly AuthMethodDescriptor[]> =>
3130 Effect.gen(function* () {
3131 const runtime = runtimes.get(row.plugin_id);
3132 const describe = runtime?.plugin.describeAuthMethods;
3133 if (!describe) return [];
3134 const record = rowToIntegrationRecord(row);
3135 const methods = yield* Effect.sync(() => describe(record)).pipe(
3136 // A malformed plugin projector must never fail the catalog read.
3137 Effect.catchCause(() => Effect.succeed([])),
3138 );
3139 const valid: AuthMethodDescriptor[] = [];
3140 for (const method of methods) {
3141 if (method.kind === "none" && method.placements !== undefined) {
3142 const warningKey = [row.plugin_id, row.slug, method.id]
3143 .map((value) => `${value.length}:${value}`)
3144 .join("");
3145 if (!warnedInvalidAuthMethods.has(warningKey)) {
3146 warnedInvalidAuthMethods.add(warningKey);
3147 yield* Effect.logWarning("executor omitted invalid plugin auth method", {
3148 plugin: row.plugin_id,
3149 integration: row.slug,
3150 method: method.id,
3151 reason: "no-auth methods cannot declare credential placements",
3152 });
3153 }
3154 continue;
3155 }
3156 valid.push(method);
3157 }
3158 return valid;
3159 });
3160
3161 const describeDisplayForRow = (row: IntegrationRow): IntegrationDisplayDescriptor => {
3162 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