Skip to content

Commit 4f5c953

Browse files
committed
[X-Pack] Ignore Basic auth for x_pack_rest_user
1 parent 174a169 commit 4f5c953

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

api-spec-testing/test_file/action.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,19 @@ def execute(client, test = nil)
5555
_method = chain[-1]
5656
case _method
5757
when 'headers'
58+
headers = prepare_arguments(args, test)
59+
# TODO: Remove Authorization headers while x_pack_rest_user is fixed
60+
if headers[:Authorization] == 'Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA=='
61+
headers.delete(:Authorization)
62+
end
5863
if ENV['QUIET'] == 'true'
5964
# todo: create a method on Elasticsearch::Client that can clone the client with new options
6065
Elasticsearch::Client.new(host: URL,
61-
transport_options: TRANSPORT_OPTIONS.merge( headers: prepare_arguments(args, test)))
66+
transport_options: TRANSPORT_OPTIONS.merge( headers: headers))
6267
else
63-
Elasticsearch::Client.new(host: URL, tracer: Logger.new($stdout),
64-
transport_options: TRANSPORT_OPTIONS.merge( headers: prepare_arguments(args, test)))
68+
Elasticsearch::Client.new(host: URL,
69+
tracer: Logger.new($stdout),
70+
transport_options: TRANSPORT_OPTIONS.merge( headers: headers))
6571
end
6672
when 'catch'
6773
client

elasticsearch-xpack/spec/rest_yaml_tests_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
end
5555
end
5656

57-
58-
5957
YAML_FILES_DIRECTORY = "#{File.expand_path(File.dirname('..'), '..')}" +
6058
"/tmp/elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/test"
6159

0 commit comments

Comments
 (0)