MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / fips_enabled

Method fips_enabled

test/__init__.py:358–368  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

356
357 @property
358 def fips_enabled(self):
359 if self._fips_enabled is not None:
360 return self._fips_enabled
361 try:
362 subprocess.run(["fips-mode-setup", "--is-enabled"], check=True)
363 self._fips_enabled = True
364 except (subprocess.SubprocessError, FileNotFoundError):
365 self._fips_enabled = False
366 if os.environ.get("REQUIRE_FIPS") and not self._fips_enabled:
367 raise RuntimeError("Expected FIPS to be enabled")
368 return self._fips_enabled
369
370 def check_auth_type(self, auth_type):
371 auth_mechs = self.server_parameters.get("authenticationMechanisms", [])

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected