(self)
| 446 | super().tearDown() |
| 447 | |
| 448 | def test_scram_skip_empty_exchange(self): |
| 449 | listener = AllowListEventListener("saslStart", "saslContinue") |
| 450 | client_context.create_user( |
| 451 | "testscram", "sha256", "pwd", roles=["dbOwner"], mechanisms=["SCRAM-SHA-256"] |
| 452 | ) |
| 453 | |
| 454 | client = self.rs_or_single_client_noauth( |
| 455 | username="sha256", password="pwd", authSource="testscram", event_listeners=[listener] |
| 456 | ) |
| 457 | client.testscram.command("dbstats") |
| 458 | |
| 459 | if client_context.version < (4, 4, -1): |
| 460 | # Assert we sent the skipEmptyExchange option. |
| 461 | first_event = listener.started_events[0] |
| 462 | self.assertEqual(first_event.command_name, "saslStart") |
| 463 | self.assertEqual(first_event.command["options"], {"skipEmptyExchange": True}) |
| 464 | |
| 465 | # Assert the third exchange was skipped on servers that support it. |
| 466 | # Note that the first exchange occurs on the connection handshake. |
| 467 | started = listener.started_command_names() |
| 468 | if client_context.version.at_least(4, 4, -1): |
| 469 | self.assertEqual(started, ["saslContinue"]) |
| 470 | else: |
| 471 | self.assertEqual(started, ["saslStart", "saslContinue", "saslContinue"]) |
| 472 | |
| 473 | @client_context.require_no_fips |
| 474 | def test_scram(self): |
nothing calls this directly
no test coverage detected