aws_ip_utilities 0.1.20180711 → 0.2.20180711
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/aws_ip_utilities.gemspec +1 -0
- data/lib/aws_ip_utilities.rb +2 -2
- data/lib/aws_ip_utilities/rack_request_trusted_proxy_override.rb +5 -7
- data/lib/aws_ip_utilities/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d93c07fc920e62a4495b5050ed298f148cb392b
|
4
|
+
data.tar.gz: 6f9fb2355ed442a615d3ae68ed811cd13ac36ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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/
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/WeTransfer/aws_ip_utilities.
|
61
61
|
|
data/aws_ip_utilities.gemspec
CHANGED
data/lib/aws_ip_utilities.rb
CHANGED
@@ -36,8 +36,8 @@ module AwsIpUtilities
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def self.
|
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
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
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.
|
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
|