File tree Expand file tree Collapse file tree 5 files changed +10
-687
lines changed
Expand file tree Collapse file tree 5 files changed +10
-687
lines changed Original file line number Diff line number Diff line change @@ -843,6 +843,7 @@ def __init__(
843843 options .write_concern ,
844844 options .read_concern ,
845845 )
846+ self ._encrypter : Optional [_Encrypter ] = None
846847 if not is_srv :
847848 self ._topology_settings = TopologySettings (
848849 seeds = seeds ,
@@ -862,6 +863,10 @@ def __init__(
862863 srv_max_hosts = srv_max_hosts ,
863864 server_monitoring_mode = options .server_monitoring_mode ,
864865 )
866+ if self ._options .auto_encryption_opts :
867+ from pymongo .asynchronous .encryption import _Encrypter
868+
869+ self ._encrypter = _Encrypter (self , self ._options .auto_encryption_opts )
865870
866871 self ._opened = False
867872 self ._closed = False
@@ -883,7 +888,6 @@ def __init__(
883888 if _IS_SYNC and connect :
884889 self ._get_topology () # type: ignore[unused-coroutine]
885890
886- self ._encrypter : Optional [_Encrypter ] = None
887891 self ._timeout = self ._options .timeout
888892
889893 def _resolve_srv (self ) -> None :
Original file line number Diff line number Diff line change @@ -841,6 +841,7 @@ def __init__(
841841 options .write_concern ,
842842 options .read_concern ,
843843 )
844+ self ._encrypter : Optional [_Encrypter ] = None
844845 if not is_srv :
845846 self ._topology_settings = TopologySettings (
846847 seeds = seeds ,
@@ -860,6 +861,10 @@ def __init__(
860861 srv_max_hosts = srv_max_hosts ,
861862 server_monitoring_mode = options .server_monitoring_mode ,
862863 )
864+ if self ._options .auto_encryption_opts :
865+ from pymongo .synchronous .encryption import _Encrypter
866+
867+ self ._encrypter = _Encrypter (self , self ._options .auto_encryption_opts )
863868
864869 self ._opened = False
865870 self ._closed = False
@@ -881,7 +886,6 @@ def __init__(
881886 if _IS_SYNC and connect :
882887 self ._get_topology () # type: ignore[unused-coroutine]
883888
884- self ._encrypter : Optional [_Encrypter ] = None
885889 self ._timeout = self ._options .timeout
886890
887891 def _resolve_srv (self ) -> None :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments