Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Mock server for testing MongoDB clients and creating MongoDB Wire Protocol servers.
Fix a bug where MockupDB did not recognize the OP_MSG exhaustAllowed flag.
MockupDB supports Python 3.4 through 3.8; it no longer supports Python 2.6 or Python 3.3.
New method MockupDB.append_responder
to add an autoresponder of last resort.
Fix a bug in interactive_server
with all_ok=True
. It had returned an
empty isMaster response, causing drivers to throw errors like "Server at
localhost:27017 reports wire version 0, but this version of PyMongo requires at
least 2 (MongoDB 2.6)."
Stop logging "OSError: [WinError 10038] An operation was attempted on something that is not a socket" on Windows after a client disconnects.
Parse OP_MSGs with any number of sections in any order. This allows write commands from the mongo shell, which sends sections in the opposite order from drivers. Handle OP_MSGs with checksums, such as those sent by the mongo shell beginning in 4.2.
Improve datetime support in match expressions. Python datetimes have microsecond precision but BSON only has milliseconds, so expressions like this always failed::
server.receives(Command('foo', when=datetime(2018, 12, 1, 6, 6, 6, 12345)))
Now, the matching logic has been rewritten to recurse through arrays and subdocuments, comparing them value by value. It compares datetime values with only millisecond precision.
Remove vendored BSON library. Instead, require PyMongo and use its BSON library. This avoids surprising problems where a BSON type created with PyMongo does not appear equal to one created with MockupDB, and it avoids the occasional need to update the vendored code to support new BSON features.
Support for Unix domain paths with uds_path
parameter.
The interactive_server()
function now prepares the server to autorespond to
the getFreeMonitoringStatus
command from the mongo shell.
Fix an inadvertent dependency on PyMongo, which broke the docs build.
Support, and expect, OP_MSG requests from clients. Thanks to Shane Harvey for the contribution.
Update vendored bson library from PyMongo. Support the Decimal128 BSON type. Fix
Matcher so it equates BSON objects from PyMongo like ObjectId(...)
with
equivalent objects created from MockupDB's vendored bson library.
Support Windows. Log a traceback if a bad client request causes an assert. Fix SSL. Make errors less likely on shutdown. Enable testing on Travis and Appveyor. Fix doctests and interactive server for modern MongoDB protocol.
Set minWireVersion to 0, not to 2. I had been wrong about MongoDB 3.6's wire version range: it's actually 0 to 6. MockupDB now reports the same wire version range as MongoDB 3.6 by default.
Update for MongoDB 3.6: report minWireVersion 2 and maxWireVersion 6 by default.
Avoid rare RuntimeError in close(), if a client thread shuts down a socket as MockupDB iterates its list of sockets.
Properly detect closed sockets so MockupDB.stop()
doesn't take 10 seconds
per connection. Thanks to Sean Purcell.
Don't use "client" as a keyword arg for Request
, it conflicts with the
actual "client" field in drivers' new handshake protocol.
Add cursor_id property to OpGetMore, and ssl parameter to interactive_server.
MockupDB(auto_ismaster=True)
had just responded {"ok": 1}
, but this
isn't enough to convince PyMongo 3 it's talking to a valid standalone,
so auto-respond {"ok": 1, "ismaster": True}
.
Restore Request.assert_matches method, used in pymongo-mockup-tests.
Allow co-installation with PyMongo.
First release.
Development begun.
FAQs
MongoDB Wire Protocol server library
We found that mockupdb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.