MovableInkAWS 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46d76e882265a792568c24853fbc6953bcfa54c4677d67b8aaf97d009896cb24
4
- data.tar.gz: f02414993d6c9509bd72f5ec246e6bf99fc60c20a036487be9336cb41e780e8f
3
+ metadata.gz: 24c0d6fea8ea161fb987f26f1574ce3ee48a1c37cbe7f78cc09d8bef82242729
4
+ data.tar.gz: 59f455acf804ee9591647a4ccda51066161424ed8992492038721ece13bd58b6
5
5
  SHA512:
6
- metadata.gz: b987bbb77c3fd5d2c1fc23c84c62e3af00df58074dbbdc9db21fd05fc8181c23f10bf096665f197ee98f79deaf4aaaaabc3fea1418ffcb85f0f256145fe13260
7
- data.tar.gz: ddc7c1eff50e05f3d1cd83cb65df72f688c6aadbed822dc3a87cd9e2096451ab23f62293092443f9d22f4e76a84eb7073da2ffb41117987341bfb2663915cc25
6
+ metadata.gz: c6144b91d11de9221998cc636469411dcaa40fed4b5a8cbbd2638549d7b34a1c35578faaeee87474f586695c32f80c2be29447fc8cb7d45c8092ab2e9ae0ddda
7
+ data.tar.gz: 5bb11e9cd6d9ef69bbebdfd41d57c9e6cbb54b80cebbaa974595ee77c536db586b17f7e343bcc46d6e9380d1410e91a4a15a3ea899bc69c5998f6537d431c0bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (2.3.0)
4
+ MovableInkAWS (2.3.1)
5
5
  aws-sdk-athena (~> 1)
6
6
  aws-sdk-autoscaling (~> 1)
7
7
  aws-sdk-cloudwatch (~> 1)
@@ -43,7 +43,7 @@ module MovableInk
43
43
  def imds_token(tries: 3)
44
44
  tries.times do |num|
45
45
  num += 1
46
- request = Net::HTTP::Get.new('/latest/api/token')
46
+ request = Net::HTTP::Put.new('/latest/api/token')
47
47
  request['X-aws-ec2-metadata-token-ttl-seconds'] = 120
48
48
  response = http(timeout_seconds: num * 3).request(request)
49
49
  return response.body
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '2.3.0'
3
+ VERSION = '2.3.1'
4
4
  end
5
5
  end
data/spec/aws_spec.rb CHANGED
@@ -23,7 +23,7 @@ describe MovableInk::AWS do
23
23
  it 'raises when AWS_REGION is not set and the metadata service is not available' do
24
24
  miaws = MovableInk::AWS.new
25
25
  # stub an error making a request to the metadata api
26
- stub_request(:get, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
26
+ stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
27
27
  expect { miaws.my_region }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
28
28
  end
29
29
  end
data/spec/ec2_spec.rb CHANGED
@@ -10,7 +10,7 @@ describe MovableInk::AWS::EC2 do
10
10
  it "should raise an error if trying to load mi_env outside of EC2" do
11
11
  aws = MovableInk::AWS.new
12
12
  # stub an error making a request to the metadata api
13
- stub_request(:get, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
13
+ stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
14
14
  expect{ aws.mi_env }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
15
15
  end
16
16
 
@@ -22,7 +22,7 @@ describe MovableInk::AWS::EC2 do
22
22
  it "should not find a 'me'" do
23
23
  aws = MovableInk::AWS.new
24
24
  # stub an error making a request to the metadata api
25
- stub_request(:get, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
25
+ stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
26
26
  expect(aws.me).to eq(nil)
27
27
  end
28
28
  end
@@ -10,7 +10,7 @@ describe MovableInk::AWS::Metadata do
10
10
  it 'should raise an error if the metadata service times out' do
11
11
  aws = MovableInk::AWS.new
12
12
  # stub an error making a request to the metadata api
13
- stub_request(:get, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
13
+ stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
14
14
  expect{ aws.instance_id }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
15
15
  expect{ aws.availability_zone }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
16
16
  end
@@ -18,7 +18,7 @@ describe MovableInk::AWS::Metadata do
18
18
  it 'should raise an error if trying to load private_ipv4 outside of EC2' do
19
19
  aws = MovableInk::AWS.new
20
20
  # stub an error making a request to the metadata api
21
- stub_request(:get, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
21
+ stub_request(:put, 'http://169.254.169.254/latest/api/token').to_raise(Net::OpenTimeout)
22
22
  expect{ aws.private_ipv4 }.to raise_error(MovableInk::AWS::Errors::MetadataTimeout)
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chesler