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