File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def create
6060 }
6161
6262 if mongo_4? || mongo_5?
63- if @resource [ :auth_mechanism ] == :scram_sha_256
63+ if @resource [ :auth_mechanism ] == :scram_sha_256 # rubocop:disable Naming/VariableNumber
6464 command [ :mechanisms ] = [ 'SCRAM-SHA-256' ]
6565 command [ :pwd ] = @resource [ :password ]
6666 command [ :digestPassword ] = true
@@ -121,7 +121,7 @@ def password=(value)
121121 }
122122
123123 if mongo_4? || mongo_5?
124- command [ :mechanisms ] = @resource [ :auth_mechanism ] == :scram_sha_256 ? [ 'SCRAM-SHA-256' ] : [ 'SCRAM-SHA-1' ]
124+ command [ :mechanisms ] = @resource [ :auth_mechanism ] == :scram_sha_256 ? [ 'SCRAM-SHA-256' ] : [ 'SCRAM-SHA-1' ] # rubocop:disable Naming/VariableNumber
125125 end
126126
127127 mongo_eval ( "db.runCommand(#{ command . to_json } )" , @resource [ :database ] )
Original file line number Diff line number Diff line change @@ -88,16 +88,16 @@ def to_s?(_value = @is)
8888 end
8989
9090 def insync? ( _is )
91- return !@resource [ :update_password ] if @resource [ :auth_mechanism ] == :scram_sha_256
91+ return !@resource [ :update_password ] if @resource [ :auth_mechanism ] == :scram_sha_256 # rubocop:disable Naming/VariableNumber
9292
9393 should_to_s == to_s?
9494 end
9595 end
9696
9797 newparam ( :auth_mechanism ) do
9898 desc 'Authentication mechanism. Password verification is not supported with SCRAM-SHA-256.'
99- defaultto :scram_sha_1
100- newvalues ( :scram_sha_256 , :scram_sha_1 )
99+ defaultto :scram_sha_1 # rubocop:disable Naming/VariableNumber
100+ newvalues ( :scram_sha_256 , :scram_sha_1 ) # rubocop:disable Naming/VariableNumber
101101 end
102102
103103 newparam ( :update_password , boolean : true ) do
@@ -126,7 +126,7 @@ def insync?(_is)
126126 err ( "Either 'password_hash' or 'password' should be provided" )
127127 elsif !self [ :password_hash ] . nil? && !self [ :password ] . nil?
128128 err ( "Only one of 'password_hash' or 'password' should be provided" )
129- elsif !self [ :password_hash ] . nil? && self [ :auth_mechanism ] == :scram_sha_256
129+ elsif !self [ :password_hash ] . nil? && self [ :auth_mechanism ] == :scram_sha_256 # rubocop:disable Naming/VariableNumber
130130 err ( "'password_hash' is not supported with SCRAM-SHA-256 authentication mechanism" )
131131 end
132132 raise ( "The parameter 'scram_credentials' is read-only and cannot be changed" ) if should ( :scram_credentials )
You can’t perform that action at this time.
0 commit comments