MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _is_sensitive

Method _is_sensitive

pymongo/logger.py:142–155  ·  view source on GitHub ↗
(self, doc_name: str)

Source from the content-addressed store, hash-verified

140 )
141
142 def _is_sensitive(self, doc_name: str) -> bool:
143 is_speculative_authenticate = (
144 self._kwargs.pop("speculative_authenticate", False)
145 or "speculativeAuthenticate" in self._kwargs[doc_name]
146 )
147 is_sensitive_command = (
148 "commandName" in self._kwargs and self._kwargs["commandName"] in _SENSITIVE_COMMANDS
149 )
150
151 is_sensitive_hello = (
152 self._kwargs.get("commandName", None) in _HELLO_COMMANDS and is_speculative_authenticate
153 )
154
155 return is_sensitive_command or is_sensitive_hello
156
157 def _redact(self) -> None:
158 if self._redacted:

Callers 1

_redactMethod · 0.95

Calls 2

popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected