UNPKG

ya-express-ntlm

Version:
30 lines 1.18 kB
// noinspection JSBitwiseOperatorUsage,JSUnusedLocalSymbols import { lBlue, reset } from 'af-color'; import { sanitizeText } from '../lib/utils'; import { LarrowR } from '../lib/constants'; import { createMessageType2 } from '../../node-ntlm-core/createMessageType2'; import { debugNtlmLdapProxy } from '../debug'; export class NTLMProxyStub { constructor(id) { this.coloredAddress = 'stub'; this.id = id; } close() { } async negotiate(messageType1) { const operationType = `${lBlue}[negotiate]${reset}`; return new Promise((resolve) => { const messageType2Byf = createMessageType2(messageType1); debugNtlmLdapProxy(`${LarrowR} ${operationType} PROXY STUB ${lBlue}${sanitizeText(messageType2Byf)}`); resolve(messageType2Byf); }); } async authenticate(_ntlmAuthenticate) { const operationType = `${lBlue}[authenticate]${reset}`; return new Promise((resolve) => { debugNtlmLdapProxy(`${LarrowR} ${operationType} PROXY STUB \t${lBlue}Authenticated = true`); resolve(true); }); } } //# sourceMappingURL=NTLMProxyStub.js.map