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

Function describeAuthMethodsForRow

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

Source from the content-addressed store, hash-verified

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