File tree 1 file changed +12
-1
lines changed
elasticsearch/_sync/client
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
17
18
+ import base64
18
19
import re
19
20
import warnings
20
21
from typing import (
@@ -166,13 +167,23 @@ def _sniffed_node_callback(
166
167
def sniff_callback (
167
168
transport : Transport , sniff_options : SniffOptions
168
169
) -> List [NodeConfig ]:
170
+ # Dynamically resolve authentication headers based on the client's configuration.
171
+ auth_headers = resolve_auth_headers (
172
+ headers = None ,
173
+ http_auth = transport .http_auth ,
174
+ api_key = transport .api_key ,
175
+ basic_auth = transport .basic_auth ,
176
+ bearer_auth = transport .bearer_auth ,
177
+ )
178
+
169
179
for _ in transport .node_pool .all ():
170
180
try :
171
181
meta , node_infos = transport .perform_request (
172
182
"GET" ,
173
183
"/_nodes/_all/http" ,
174
184
headers = {
175
- "accept" : "application/vnd.elasticsearch+json; compatible-with=8"
185
+ ** auth_headers , # Include the resolved authentication headers
186
+ "accept" : "application/vnd.elasticsearch+json; compatible-with=8" ,
176
187
},
177
188
request_timeout = (
178
189
sniff_options .sniff_timeout
You can’t perform that action at this time.
0 commit comments