(store: Map<string, string>)
| 259 | // row while its secret stayed destroyed, leaving a client that looks configured |
| 260 | // and can never authenticate again. |
| 261 | const txPlugin = (store: Map<string, string>) => |
| 262 | definePlugin(() => ({ |
| 263 | id: "demo" as const, |
| 264 | storage: () => ({}), |
| 265 | credentialProviders: [ |
| 266 | { |
| 267 | key: ProviderKey.make("memory"), |
| 268 | writable: true as const, |
| 269 | get: (id: ProviderItemId) => Effect.sync(() => store.get(String(id)) ?? null), |
| 270 | set: (id: ProviderItemId, value: string) => |
| 271 | Effect.sync(() => { |
| 272 | store.set(String(id), value); |
| 273 | }), |
| 274 | delete: (id: ProviderItemId) => |
| 275 | Effect.sync(() => { |
| 276 | store.delete(String(id)); |
| 277 | }), |
| 278 | }, |
| 279 | ], |
| 280 | extension: (ctx) => ({ |
| 281 | inTransaction: <A, E>(effect: Effect.Effect<A, E>) => ctx.transaction(effect), |
| 282 | }), |
| 283 | }))(); |
| 284 | |
| 285 | // The client secret is keyed by (owner, slug) ALONE — the key outlives the row |
| 286 | // it belonged to, which is what makes the deferred delete a claim that has to be |
no test coverage detected