| 141 | |
| 142 | /** The ledger entries in which WorkOS was asked to validate THIS key value. */ |
| 143 | const validationsOf = ( |
| 144 | entries: ReadonlyArray<LedgerEntry>, |
| 145 | keyValue: string, |
| 146 | ): ReadonlyArray<LedgerEntry> => |
| 147 | entries.filter( |
| 148 | (entry) => |
| 149 | entry.path === VALIDATIONS_PATH && |
| 150 | typeof entry.request.body === "object" && |
| 151 | entry.request.body !== null && |
| 152 | (entry.request.body as { readonly value?: unknown }).value === keyValue, |
| 153 | ); |
| 154 | |
| 155 | /** The shared fixtures both scenarios start from: two freshly minted keys |
| 156 | * (revoked on exit) and the WorkOS emulator the target validates against. */ |