Skip to content

Commit 932b06b

Browse files
RUBY-3184 Rename crypt_shared_lib_required (#2670)
1 parent 4022460 commit 932b06b

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

docs/reference/client-side-encryption.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ If the library can be loaded, then the driver will not try to spawn mongocryptd
111111
The daemon will be still spawned if the shared library cannot be found.
112112

113113
It is also possible to require using the shared library by passing
114-
``crypt_shared_lib_required: true`` option when creating a client. In this case,
114+
``crypt_shared_required: true`` option when creating a client. In this case,
115115
an error will be raised if the shared library cannot be loaded.
116116

117117
.. note::

lib/mongo/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def hash
466466
# - :crypt_shared_lib_path => [ String | nil ] Path that should
467467
# be the used to load the crypt shared library. Providing this option
468468
# overrides default crypt shared library load paths for libmongocrypt.
469-
# - :crypt_shared_lib_required => [ Boolean | nil ] Whether
469+
# - :crypt_shared_required => [ Boolean | nil ] Whether
470470
# crypt shared library is required. If 'true', an error will be raised
471471
# if a crypt_shared library cannot be loaded by libmongocrypt.
472472
#

lib/mongo/crypt/auto_encrypter.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class AutoEncrypter
8484
# @option options [ String | nil ] :crypt_shared_lib_path Path that should
8585
# be the used to load the crypt shared library. Providing this option
8686
# overrides default crypt shared library load paths for libmongocrypt.
87-
# @option options [ Boolean | nil ] :crypt_shared_lib_required Whether
87+
# @option options [ Boolean | nil ] :crypt_shared_required Whether
8888
# crypt shared library is required. If 'true', an error will be raised
8989
# if a crypt_shared library cannot be loaded by libmongocrypt.
9090
#
@@ -103,7 +103,7 @@ def initialize(options)
103103
encrypted_fields_map: @options[:encrypted_fields_map],
104104
bypass_query_analysis: @options[:bypass_query_analysis],
105105
crypt_shared_lib_path: @options[:extra_options][:crypt_shared_lib_path],
106-
crypt_shared_lib_required: @options[:extra_options][:crypt_shared_lib_required],
106+
crypt_shared_required: @options[:extra_options][:crypt_shared_required],
107107
)
108108

109109
@mongocryptd_options = @options[:extra_options].slice(
@@ -115,9 +115,9 @@ def initialize(options)
115115
@mongocryptd_options[:mongocryptd_bypass_spawn] = @options[:bypass_auto_encryption] ||
116116
@options[:extra_options][:mongocryptd_bypass_spawn] ||
117117
@crypt_handle.crypt_shared_lib_available? ||
118-
@options[:extra_options][:crypt_shared_lib_required]
118+
@options[:extra_options][:crypt_shared_required]
119119

120-
unless @options[:extra_options][:crypt_shared_lib_required] || @crypt_handle.crypt_shared_lib_available?
120+
unless @options[:extra_options][:crypt_shared_required] || @crypt_handle.crypt_shared_lib_available?
121121
# Set server selection timeout to 1 to prevent the client waiting for a
122122
# long timeout before spawning mongocryptd
123123
@mongocryptd_client = Client.new(

lib/mongo/crypt/handle.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Handle
5656
# @option options [ String | nil ] :crypt_shared_lib_path Path that should
5757
# be the used to load the crypt shared library. Providing this option
5858
# overrides default crypt shared library load paths for libmongocrypt.
59-
# @option options [ Boolean | nil ] :crypt_shared_lib_required Whether
59+
# @option options [ Boolean | nil ] :crypt_shared_required Whether
6060
# crypt_shared library is required. If 'true', an error will be raised
6161
# if a crypt_shared library cannot be loaded by libmongocrypt.
6262
# @option options [ Boolean | nil ] :explicit_encryption_only Whether this
@@ -104,8 +104,8 @@ def initialize(kms_providers, kms_tls_options, options={})
104104

105105
initialize_mongocrypt
106106

107-
@crypt_shared_lib_required = !!options[:crypt_shared_lib_required]
108-
if @crypt_shared_lib_required && crypt_shared_lib_version == 0
107+
@crypt_shared_required = !!options[:crypt_shared_required]
108+
if @crypt_shared_required && crypt_shared_lib_version == 0
109109
raise Mongo::Error::CryptError.new(
110110
"Crypt shared library is required, but cannot be loaded according to libmongocrypt"
111111
)

spec/integration/client_side_encryption/mongocryptd_prose_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def done!
8181
let(:extra_options) do
8282
{
8383
crypt_shared_lib_path: SpecConfig.instance.crypt_shared_lib_path,
84-
crypt_shared_lib_required: true,
84+
crypt_shared_required: true,
8585
mongocryptd_uri: mongocryptd_uri,
8686
mongocryptd_spawn_args: [ "--pidfilepath=bypass-spawning-mongocryptd.pid", "--port=27777"]
8787
}

spec/mongo/crypt/handle_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
schema_map_path: schema_map_path,
2121
bypass_query_analysis: bypass_query_analysis,
2222
crypt_shared_lib_path: crypt_shared_lib_path,
23-
crypt_shared_lib_required: crypt_shared_lib_required,
23+
crypt_shared_required: crypt_shared_required,
2424
explicit_encryption_only: explicit_encryption_only,
2525
)
2626
end
@@ -41,7 +41,7 @@
4141
nil
4242
end
4343

44-
let(:crypt_shared_lib_required) do
44+
let(:crypt_shared_required) do
4545
nil
4646
end
4747

@@ -118,11 +118,11 @@
118118
end
119119
end
120120

121-
context 'with crypt_shared_lib_required' do
121+
context 'with crypt_shared_required' do
122122
min_server_version '6.0.0'
123123

124124
context 'set to true' do
125-
let(:crypt_shared_lib_required) do
125+
let(:crypt_shared_required) do
126126
true
127127
end
128128

0 commit comments

Comments
 (0)