|
def | __init__ (self, client, key_vault_coll, mongocryptd_client, opts) |
|
def | kms_request (self, kms_context) |
|
def | collection_info (self, database, filter) |
|
def | spawn (self) |
|
def | mark_command (self, database, cmd) |
|
def | fetch_keys (self, filter) |
|
def | insert_data_key (self, data_key) |
|
def | bson_encode (self, doc) |
|
def | close (self) |
|
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
client, |
|
|
|
key_vault_coll, |
|
|
|
mongocryptd_client, |
|
|
|
opts |
|
) |
| |
Internal class to perform I/O on behalf of pymongocrypt.
◆ bson_encode()
def bson_encode |
( |
|
self, |
|
|
|
doc |
|
) |
| |
Encode a document to BSON.
A document can be any mapping type (like :class:`dict`).
:Parameters:
- `doc`: mapping type representing a document
:Returns:
The encoded BSON bytes.
◆ close()
Release resources.
Note it is not safe to call this method from __del__ or any GC hooks.
◆ collection_info()
def collection_info |
( |
|
self, |
|
|
|
database, |
|
|
|
filter |
|
) |
| |
Get the collection info for a namespace.
The returned collection info is passed to libmongocrypt which reads
the JSON schema.
:Parameters:
- `database`: The database on which to run listCollections.
- `filter`: The filter to pass to listCollections.
:Returns:
The first document from the listCollections command response as BSON.
◆ fetch_keys()
def fetch_keys |
( |
|
self, |
|
|
|
filter |
|
) |
| |
Yields one or more keys from the key vault.
:Parameters:
- `filter`: The filter to pass to find.
:Returns:
A generator which yields the requested keys from the key vault.
◆ insert_data_key()
def insert_data_key |
( |
|
self, |
|
|
|
data_key |
|
) |
| |
Insert a data key into the key vault.
:Parameters:
- `data_key`: The data key document to insert.
:Returns:
The _id of the inserted data key document.
◆ kms_request()
def kms_request |
( |
|
self, |
|
|
|
kms_context |
|
) |
| |
Complete a KMS request.
:Parameters:
- `kms_context`: A :class:`MongoCryptKmsContext`.
:Returns:
None
◆ mark_command()
def mark_command |
( |
|
self, |
|
|
|
database, |
|
|
|
cmd |
|
) |
| |
Mark a command for encryption.
:Parameters:
- `database`: The database on which to run this command.
- `cmd`: The BSON command to run.
:Returns:
The marked command response from mongocryptd.
◆ spawn()
Spawn mongocryptd.
Note this method is thread safe; at most one mongocryptd will start
successfully.
◆ client_ref
◆ key_vault_coll
◆ mongocryptd_client
◆ opts
The documentation for this class was generated from the following file:
- /home/passerat/Stage/flaskProject/venv/lib/python3.8/site-packages/pymongo/encryption.py