| 89 | |
| 90 | // NOTE: `resolution.response` may contain credentials. Never log response values. |
| 91 | private finalizeRequest(requestId: string, resolution: SshPromptResolution): void { |
| 92 | const entry = this.pending.get(requestId); |
| 93 | if (!entry) { |
| 94 | return; |
| 95 | } |
| 96 | |
| 97 | clearTimeout(entry.timer); |
| 98 | this.pending.delete(requestId); |
| 99 | if (entry.dedupeKey) { |
| 100 | this.inflightByDedupeKey.delete(entry.dedupeKey); |
| 101 | } |
| 102 | this.emit("removed", requestId); |
| 103 | |
| 104 | for (const resolve of entry.waiters) { |
| 105 | resolve(resolution); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | private joinPendingByDedupeKey(dedupeKey: string): Promise<SshPromptResolution> | undefined { |
| 110 | const existingId = this.inflightByDedupeKey.get(dedupeKey); |