OpenQuizz
Une application de gestion des contenus pédagogiques
_EncryptionIO Class Reference
Inheritance diagram for _EncryptionIO:
Collaboration diagram for _EncryptionIO:

Public Member Functions

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)
 

Data Fields

 client_ref
 
 key_vault_coll
 
 mongocryptd_client
 
 opts
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  client,
  key_vault_coll,
  mongocryptd_client,
  opts 
)
Internal class to perform I/O on behalf of pymongocrypt.

Member Function Documentation

◆ 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()

def close (   self)
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()

def spawn (   self)
Spawn mongocryptd.

Note this method is thread safe; at most one mongocryptd will start
successfully.

Field Documentation

◆ client_ref

client_ref

◆ key_vault_coll

key_vault_coll

◆ mongocryptd_client

mongocryptd_client

◆ opts

opts

The documentation for this class was generated from the following file: