(
input: ConnectionValueInput,
)
| 2875 | // pasted `value`/`values` are used directly; `from` origins resolve through |
| 2876 | // their provider. Single-secret sugar lands on the `token` variable. |
| 2877 | const resolveInFlightValues = ( |
| 2878 | input: ConnectionValueInput, |
| 2879 | ): Effect.Effect<Record<string, string | null>, StorageFailure> => |
| 2880 | Effect.gen(function* () { |
| 2881 | const out: Record<string, string | null> = {}; |
| 2882 | for (const { variable, origin } of normalizeConnectionInputs(input)) { |
| 2883 | if ("value" in origin) { |
| 2884 | out[variable] = origin.value; |
| 2885 | continue; |
| 2886 | } |
| 2887 | const provider = credentialProviders.get(String(origin.from.provider)); |
| 2888 | if (!provider) { |
| 2889 | return yield* new StorageError({ |
| 2890 | message: `Credential provider "${origin.from.provider}" is not registered.`, |
| 2891 | cause: undefined, |
| 2892 | }); |
| 2893 | } |
| 2894 | out[variable] = yield* provider.get(origin.from.id); |
| 2895 | } |
| 2896 | return out; |
| 2897 | }); |
| 2898 | |
| 2899 | const connectionCheckHealth = ( |
| 2900 | ref: ConnectionRef, |
no test coverage detected