MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / TwoFacInteractor

Class TwoFacInteractor

Extension/src/SSH/commandInteractors.ts:261–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 (msg: string, cancelToken?: vscode.CancellationToken) => Promise<string | undefined>;
260
261export class TwoFacInteractor implements IInteractor {
262 static ID = '2fa';
263
264 constructor(private readonly verificationCodeProvider: IVerificationCodeProvider) { }
265
266 get id(): string {
267 return TwoFacInteractor.ID;
268 }
269
270 async onData(data: string, cancelToken?: vscode.CancellationToken): Promise<IInteraction> {
271 const result: IInteraction = { postAction: 'keep' };
272 if (data.includes('Verification code:')) {
273 result.postAction = 'consume';
274 const verificationCode: string | undefined = await this.verificationCodeProvider('Enter verification code', cancelToken);
275 if (typeof verificationCode === 'string') {
276 result.response = verificationCode;
277 result.isPassword = true;
278 } else {
279 result.canceled = true;
280 }
281 }
282
283 return result;
284 }
285}
286
287// https://github.com/microsoft/vscode-remote-release/issues/2170
288export class DuoTwoFacInteractor implements IInteractor {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected