(self)
| 410 | |
| 411 | @client_context.require_no_fips |
| 412 | def test_scram_sha1(self): |
| 413 | host, port = client_context.host, client_context.port |
| 414 | |
| 415 | client = self.rs_or_single_client_noauth( |
| 416 | "mongodb://user:pass@%s:%d/pymongo_test?authMechanism=SCRAM-SHA-1" % (host, port) |
| 417 | ) |
| 418 | client.pymongo_test.command("dbstats") |
| 419 | |
| 420 | if client_context.is_rs: |
| 421 | uri = ( |
| 422 | "mongodb://user:pass" |
| 423 | "@%s:%d/pymongo_test?authMechanism=SCRAM-SHA-1" |
| 424 | "&replicaSet=%s" % (host, port, client_context.replica_set_name) |
| 425 | ) |
| 426 | client = self.single_client_noauth(uri) |
| 427 | client.pymongo_test.command("dbstats") |
| 428 | db = client.get_database("pymongo_test", read_preference=ReadPreference.SECONDARY) |
| 429 | db.command("dbstats") |
| 430 | |
| 431 | |
| 432 | # https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#scram-sha-256-and-mechanism-negotiation |
nothing calls this directly
no test coverage detected