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

Method prepare

src/cmap/auth/x509.ts:9–18  ·  view source on GitHub ↗
(
    handshakeDoc: HandshakeDocument,
    authContext: AuthContext
  )

Source from the content-addressed store, hash-verified

7
8export class X509 extends AuthProvider {
9 override async prepare(
10 handshakeDoc: HandshakeDocument,
11 authContext: AuthContext
12 ): Promise<HandshakeDocument> {
13 const { credentials } = authContext;
14 if (!credentials) {
15 throw new MongoMissingCredentialsError('AuthContext must provide credentials.');
16 }
17 return { ...handshakeDoc, speculativeAuthenticate: x509AuthenticateCommand(credentials) };
18 }
19
20 override async auth(authContext: AuthContext) {
21 const connection = authContext.connection;

Callers 2

prepareHandshakeDocumentFunction · 0.45

Calls 1

x509AuthenticateCommandFunction · 0.85

Tested by

no test coverage detected