You can directly use the "proxy" as a normal mongodb backend
If setting login and password on connection string should set "authMechanism=PLAIN". This is the only supported auth mechanism for the proxy
The connection string to connect to the proxy must always be without login and passwords, the SaslStart message is not supported
- protocol: redis (this is mandatory)
- port: the port on which the proxy will listen
- login: the -real- login to use to connect to the real server
- password: the -real- password to use to connect to the real server
- connectionString: the connection string for the real server (e.g. mongodb://localhost:27018 )
- timeoutSeconds: the timeout to drop the connections
The data will be stored in the global dataDir.
- active: If it is active
- ignoreTrivialCalls: store in full only calls that cannot be generated automatically (the ones with real data)
The data will be loaded from the global dataDir. This is used to replay a whole flow without the need to mock a single request
- active: If it is active
- respectCallDuration: respect the duration of the round trip
- blockExternal: Block calls to real service when not matching (default true)
- Real authentication (always allowed)
- https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/
- https://github.com/mongodb/specifications/tree/master
- https://github.com/bwaldvogel/mongo-java-server
- https://www.mongodb.com/docs/manual/reference/command/
The document starts with the Int32 length
struct Section {
uint8 payloadType;
union payload {
document document; // payloadType == 0
struct sequence { // payloadType == 1
int32 size;
cstring identifier;
document* documents;
};
};
};
struct OP_MSG {
struct MsgHeader {
int32 messageLength;
int32 requestID;
int32 responseTo;
int32 opCode = 2013;
};
uint32 flagBits;
Section+ sections;
[uint32 checksum;]
};