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__(
843
843
options .write_concern ,
844
844
options .read_concern ,
845
845
)
846
+ self ._encrypter : Optional [_Encrypter ] = None
846
847
if not is_srv :
847
848
self ._topology_settings = TopologySettings (
848
849
seeds = seeds ,
@@ -862,6 +863,10 @@ def __init__(
862
863
srv_max_hosts = srv_max_hosts ,
863
864
server_monitoring_mode = options .server_monitoring_mode ,
864
865
)
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 )
865
870
866
871
self ._opened = False
867
872
self ._closed = False
@@ -883,7 +888,6 @@ def __init__(
883
888
if _IS_SYNC and connect :
884
889
self ._get_topology () # type: ignore[unused-coroutine]
885
890
886
- self ._encrypter : Optional [_Encrypter ] = None
887
891
self ._timeout = self ._options .timeout
888
892
889
893
def _resolve_srv (self ) -> None :
Original file line number Diff line number Diff line change @@ -841,6 +841,7 @@ def __init__(
841
841
options .write_concern ,
842
842
options .read_concern ,
843
843
)
844
+ self ._encrypter : Optional [_Encrypter ] = None
844
845
if not is_srv :
845
846
self ._topology_settings = TopologySettings (
846
847
seeds = seeds ,
@@ -860,6 +861,10 @@ def __init__(
860
861
srv_max_hosts = srv_max_hosts ,
861
862
server_monitoring_mode = options .server_monitoring_mode ,
862
863
)
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 )
863
868
864
869
self ._opened = False
865
870
self ._closed = False
@@ -881,7 +886,6 @@ def __init__(
881
886
if _IS_SYNC and connect :
882
887
self ._get_topology () # type: ignore[unused-coroutine]
883
888
884
- self ._encrypter : Optional [_Encrypter ] = None
885
889
self ._timeout = self ._options .timeout
886
890
887
891
def _resolve_srv (self ) -> None :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments