MCPcopy
hub / github.com/mongodb/node-mongodb-native / negotiate

Function negotiate

src/cmap/auth/gssapi.ts:129–145  ·  view source on GitHub ↗
(
  client: KerberosClient,
  retries: number,
  payload: string
)

Source from the content-addressed store, hash-verified

127}
128
129async function negotiate(
130 client: KerberosClient,
131 retries: number,
132 payload: string
133): Promise<string> {
134 try {
135 const response = await client.step(payload);
136 return response || '';
137 } catch (error) {
138 if (retries === 0) {
139 // Retries exhausted, raise error
140 throw error;
141 }
142 // Adjust number of retries and call step again
143 return await negotiate(client, retries - 1, payload);
144 }
145}
146
147async function finalize(client: KerberosClient, user: string, payload: string): Promise<string> {
148 // GSS Client Unwrap

Callers 1

authMethod · 0.85

Calls 1

stepMethod · 0.80

Tested by

no test coverage detected