(
handshakeDoc: HandshakeDocument,
authContext: AuthContext
)
| 7 | |
| 8 | export 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; |
no test coverage detected