aws_ip_utilities 0.1.20180711 → 0.2.20180711

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
  SHA1:
3
- metadata.gz: 03cd0c349aa5befcb1b8f3514dd1eb7bf2c37382
4
- data.tar.gz: 6fc52d68635a98729814a340273ccdc01e6a767e
3
+ metadata.gz: 5d93c07fc920e62a4495b5050ed298f148cb392b
4
+ data.tar.gz: 6f9fb2355ed442a615d3ae68ed811cd13ac36ed3
5
5
  SHA512:
6
- metadata.gz: 319ab6c0a2302631d5231106c5e52d7e731e2b2da103690970c5ed91f1224aee88aeceb031c79cd05f564a1e49a595d27833182a03b66b5c2af542d5bc317542
7
- data.tar.gz: 8f0dc0a330a78af208f75000dc2699796aa665b10d0b609a335a8ac22ef188d4e978dfd6326118dbd3d15597bfff529cbb8503b1a28d2a4cdde217b48dc7650c
6
+ metadata.gz: 40a264b4f9edcbb1e4ce60f18027bbd9f1a82553ba93775bc8ca24a4663843a63e358ecc5b64d9a11457692de47016904e95341f3b295d9f5a5bd2f0f9615e9b
7
+ data.tar.gz: a44fe2f29f406f510a18d6c47b9d4db00a5b933fa3db99869fec9b0a1c54e83253d5f02c3544f045e93a1341d6638ec6dc33c8c2e006e7b92e2d4fdfbdf5c458
data/README.md CHANGED
@@ -42,10 +42,10 @@ and determine what service it provides:
42
42
  AwsIpUtilities.service_for(your_ip_addr) #=> "CLOUDFRONT"
43
43
  ```
44
44
 
45
- To make `Rack::Request` trust CloudFront as a proxy (when it gets injected into `X-Forwarded-For`) call the following method:
45
+ To make `Rack::Request` trust all AWS machines as a proxies for determining the client IP (when it gets injected into `X-Forwarded-For`) call the following method:
46
46
 
47
47
  ```
48
- AwsIpUtilities.make_cloudfront_rack_trusted_proxy!
48
+ AwsIpUtilities.make_aws_rack_trusted_proxy!
49
49
  ```
50
50
 
51
51
 
@@ -57,5 +57,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
57
57
 
58
58
  ## Contributing
59
59
 
60
- Bug reports and pull requests are welcome on GitHub at https://github.com/julik/aws_ip_utilities.
60
+ Bug reports and pull requests are welcome on GitHub at https://github.com/WeTransfer/aws_ip_utilities.
61
61
 
@@ -22,5 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.14"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rack"
25
26
  spec.add_development_dependency "rspec", "~> 3.0"
26
27
  end
@@ -36,8 +36,8 @@ module AwsIpUtilities
36
36
  end
37
37
  end
38
38
 
39
- def self.make_cloudfront_rack_trusted_proxy!
39
+ def self.make_aws_rack_trusted_proxy!
40
40
  require_relative 'aws_ip_utilities/rack_request_trusted_proxy_override'
41
- Rack::Request.prepend(RackRequestTrustedProxyOverride)
41
+ Rack::Request.prepend(AwsIpUtilities::RackRequestTrustedProxyOverride)
42
42
  end
43
43
  end
@@ -1,9 +1,7 @@
1
- module AwsIPUtilities
2
- module RackRequestTrustedProxyOverride
3
- def trusted_proxy?(ip)
4
- return true if super(ip)
5
- return true if AwsIpUtilities.service_for(ip) == 'CLOUDFRONT'
6
- false
7
- end
1
+ module AwsIpUtilities::RackRequestTrustedProxyOverride
2
+ def trusted_proxy?(ip)
3
+ return true if super(ip)
4
+ return true if AwsIpUtilities.aws_ip?(ip)
5
+ false
8
6
  end
9
7
  end
@@ -1,4 +1,4 @@
1
1
  module AwsIpUtilities
2
- VERSION = "0.1.20180711"
2
+ VERSION = "0.2.20180711"
3
3
  SYNC_TOKEN = "1531345951"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_ip_utilities
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20180711
4
+ version: 0.2.20180711
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement