File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
lib/elasticsearch/transport
spec/elasticsearch/transport Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ def initialize(arguments={}, &block)
98
98
@arguments [ :randomize_hosts ] ||= false
99
99
@arguments [ :transport_options ] ||= { }
100
100
@arguments [ :http ] ||= { }
101
- @options [ :http ] ||= { }
101
+ @options [ :http ] ||= { }
102
102
103
103
@seeds = __extract_hosts ( @arguments [ :hosts ] ||
104
104
@arguments [ :host ] ||
Original file line number Diff line number Diff line change 18
18
require 'spec_helper'
19
19
20
20
describe Elasticsearch ::Transport ::Transport ::Base do
21
-
22
21
context 'when a host is printed in a logged message' do
23
-
24
22
shared_examples_for 'a redacted string' do
25
-
26
23
let ( :client ) do
27
24
Elasticsearch ::Transport ::Client . new ( arguments )
28
25
end
33
30
34
31
it 'does not include the password in the logged string' do
35
32
expect ( logger ) . not_to receive ( :error ) . with ( /secret_password/ )
33
+
36
34
expect {
37
35
client . cluster . stats
38
36
} . to raise_exception ( Faraday ::ConnectionFailed )
47
45
end
48
46
49
47
context 'when the user and password are provided as separate arguments' do
50
-
51
48
let ( :arguments ) do
52
49
{ hosts : 'fake' ,
53
50
logger : logger ,
59
56
end
60
57
61
58
context 'when the user and password are provided in the string URI' do
62
-
63
59
let ( :arguments ) do
64
- { hosts : 'http ://test:secret_password@fake.com ' ,
60
+ { hosts : 'https ://test:secret_password@fake_local_elasticsearch ' ,
65
61
logger : logger }
66
62
end
67
63
68
64
it_behaves_like 'a redacted string'
69
65
end
70
66
71
67
context 'when the user and password are provided in the URI object' do
72
-
73
68
let ( :arguments ) do
74
- { hosts : URI . parse ( 'http ://test:secret_password@fake.com ' ) ,
69
+ { hosts : URI . parse ( 'https ://test:secret_password@fake_local_elasticsearch ' ) ,
75
70
logger : logger }
76
71
end
77
72
You can’t perform that action at this time.
0 commit comments