(
row: IntegrationRow,
)
| 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); |
no test coverage detected