Commit 0c5f1d9a authored by Dylan Griffith's avatar Dylan Griffith

Revert "Merge branch 'aws-version-bump' into 'master'"

This reverts merge request !22865
parent 594f2c81
...@@ -132,9 +132,8 @@ gem 'seed-fu', '~> 2.3.7' ...@@ -132,9 +132,8 @@ gem 'seed-fu', '~> 2.3.7'
gem 'elasticsearch-model', '~> 6.1' gem 'elasticsearch-model', '~> 6.1'
gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation' gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation'
gem 'elasticsearch-api', '~> 6.8' gem 'elasticsearch-api', '~> 6.8'
gem 'aws-sdk-core', '~> 3' gem 'aws-sdk'
gem 'aws-sdk-cloudformation', '~> 1' gem 'faraday_middleware-aws-signers-v4'
gem 'faraday_middleware-aws-sigv4'
# Markdown and HTML processing # Markdown and HTML processing
gem 'html-pipeline', '~> 2.12' gem 'html-pipeline', '~> 2.12'
......
...@@ -81,15 +81,13 @@ GEM ...@@ -81,15 +81,13 @@ GEM
attr_required (1.0.1) attr_required (1.0.1)
awesome_print (1.8.0) awesome_print (1.8.0)
aws-eventstream (1.0.3) aws-eventstream (1.0.3)
aws-partitions (1.263.0) aws-sdk (2.11.374)
aws-sdk-cloudformation (1.29.0) aws-sdk-resources (= 2.11.374)
aws-sdk-core (~> 3, >= 3.71.0) aws-sdk-core (2.11.374)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.0)
aws-sdk-core (3.88.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-resources (2.11.374)
aws-sdk-core (= 2.11.374)
aws-sigv4 (1.1.0) aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2) aws-eventstream (~> 1.0, >= 1.0.2)
axiom-types (0.1.1) axiom-types (0.1.1)
...@@ -278,9 +276,9 @@ GEM ...@@ -278,9 +276,9 @@ GEM
faraday (~> 0.8) faraday (~> 0.8)
faraday_middleware (0.12.2) faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0) faraday (>= 0.7.4, < 1.0)
faraday_middleware-aws-sigv4 (0.3.0) faraday_middleware-aws-signers-v4 (0.1.7)
aws-sigv4 (~> 1.0) aws-sdk-resources (~> 2)
faraday (>= 0.15) faraday (~> 0.9)
faraday_middleware-multi_json (0.0.6) faraday_middleware-multi_json (0.0.6)
faraday_middleware faraday_middleware
multi_json multi_json
...@@ -1144,8 +1142,7 @@ DEPENDENCIES ...@@ -1144,8 +1142,7 @@ DEPENDENCIES
atlassian-jwt (~> 0.2.0) atlassian-jwt (~> 0.2.0)
attr_encrypted (~> 3.1.0) attr_encrypted (~> 3.1.0)
awesome_print awesome_print
aws-sdk-cloudformation (~> 1) aws-sdk
aws-sdk-core (~> 3)
babosa (~> 1.0.2) babosa (~> 1.0.2)
base32 (~> 0.3.0) base32 (~> 0.3.0)
batch-loader (~> 1.4.0) batch-loader (~> 1.4.0)
...@@ -1191,7 +1188,7 @@ DEPENDENCIES ...@@ -1191,7 +1188,7 @@ DEPENDENCIES
escape_utils (~> 1.1) escape_utils (~> 1.1)
factory_bot_rails (~> 5.1.0) factory_bot_rails (~> 5.1.0)
faraday (~> 0.12) faraday (~> 0.12)
faraday_middleware-aws-sigv4 faraday_middleware-aws-signers-v4
fast_blank fast_blank
ffaker (~> 2.10) ffaker (~> 2.10)
flipper (~> 0.17.1) flipper (~> 0.17.1)
......
# frozen_string_literal: true # frozen_string_literal: true
require 'faraday_middleware/aws_sigv4'
module Gitlab module Gitlab
module Elastic module Elastic
module Client module Client
...@@ -19,7 +17,7 @@ module Gitlab ...@@ -19,7 +17,7 @@ module Gitlab
region = config[:aws_region] region = config[:aws_region]
::Elasticsearch::Client.new(base_config) do |fmid| ::Elasticsearch::Client.new(base_config) do |fmid|
fmid.request(:aws_sigv4, credentials: creds, service: 'es', region: region) fmid.request(:aws_signers_v4, credentials: creds, service_name: 'es', region: region)
end end
else else
::Elasticsearch::Client.new(base_config) ::Elasticsearch::Client.new(base_config)
......
...@@ -28,8 +28,6 @@ describe Gitlab::Elastic::Client do ...@@ -28,8 +28,6 @@ describe Gitlab::Elastic::Client do
.to_return(status: 200, body: "RoleName", headers: {}) .to_return(status: 200, body: "RoleName", headers: {})
stub_request(:get, "http://169.254.169.254/latest/meta-data/iam/security-credentials/RoleName") stub_request(:get, "http://169.254.169.254/latest/meta-data/iam/security-credentials/RoleName")
.to_return(status: 200, body: creds_response, headers: {}) .to_return(status: 200, body: creds_response, headers: {})
stub_request(:put, "http://169.254.169.254/latest/api/token")
.to_return(status: 200, body: "", headers: {})
end end
describe '.build' do describe '.build' do
...@@ -64,13 +62,8 @@ describe Gitlab::Elastic::Client do ...@@ -64,13 +62,8 @@ describe Gitlab::Elastic::Client do
stub_request(:get, 'http://example-elastic:9200/foo/_all/1') stub_request(:get, 'http://example-elastic:9200/foo/_all/1')
.with( .with(
headers: { headers: {
'Accept' => '*/*', 'Authorization' => 'AWS4-HMAC-SHA256 Credential=0/20170303/us-east-1/es/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=4ba2aae19a476152dacf5a2191da67b0cf81b9d7152dab5c42b1bba701da19f1',
'Accept-Encoding' => 'gzip,deflate',
'Authorization' => 'AWS4-HMAC-SHA256 Credential=0/20170303/us-east-1/es/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date, Signature=e52132ac542972698e99d9a8337b7493e4ca6210f61fc8da5cbb8008d8b2fb87',
'Content-Type' => 'application/json', 'Content-Type' => 'application/json',
'Date' => 'Fri, 03 Mar 2017 13:39:52 GMT',
'Host' => 'example-elastic:9200',
'User-Agent' => 'Faraday v0.15.4',
'X-Amz-Content-Sha256' => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'X-Amz-Content-Sha256' => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
'X-Amz-Date' => '20170303T133952Z' 'X-Amz-Date' => '20170303T133952Z'
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment