aws_ip_utilities 0.2.20180711 → 0.3.1533583353

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
- SHA1:
3
- metadata.gz: 5d93c07fc920e62a4495b5050ed298f148cb392b
4
- data.tar.gz: 6f9fb2355ed442a615d3ae68ed811cd13ac36ed3
2
+ SHA256:
3
+ metadata.gz: 98b8ec5122fe163540412bf2d886c59315fe72e754297312f30e72c6b7ad9367
4
+ data.tar.gz: be1d2d7adf7d345ae508b860978632e691ad4b84746e0c949f77a30443af74f4
5
5
  SHA512:
6
- metadata.gz: 40a264b4f9edcbb1e4ce60f18027bbd9f1a82553ba93775bc8ca24a4663843a63e358ecc5b64d9a11457692de47016904e95341f3b295d9f5a5bd2f0f9615e9b
7
- data.tar.gz: a44fe2f29f406f510a18d6c47b9d4db00a5b933fa3db99869fec9b0a1c54e83253d5f02c3544f045e93a1341d6638ec6dc33c8c2e006e7b92e2d4fdfbdf5c458
6
+ metadata.gz: 20266bb5510107c2161b391cdf0be1719455aec7ddb4acc9ce2a4300b86f9a1fa6aa06ae6e360ecee53aa8986500eab4bea4d969c95ef412953a99c0f1c85a00
7
+ data.tar.gz: 270a556d1a73b9434b8b6e601df91ccca5a33fbb843654db72b36d6c3913563e7e584a2919c9b169420f9205281978b02ae9bb1e870d4d9576ac774583c70f4a
@@ -0,0 +1,2 @@
1
+ inherit_gem:
2
+ wetransfer_style: ruby/default.yml
data/README.md CHANGED
@@ -5,6 +5,7 @@ if the AWS IP ranges change.
5
5
 
6
6
  The prefixes get retrieved from https://ip-ranges.amazonaws.com/ip-ranges.json
7
7
 
8
+ [![Build Status](https://travis-ci.com/WeTransfer/aws_ip_utilities.svg?branch=master)](https://travis-ci.com/WeTransfer/aws_ip_utilities)
8
9
 
9
10
  ## Installation
10
11
 
data/Rakefile CHANGED
@@ -1,40 +1,43 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
3
+ require 'rubocop/rake_task'
5
4
 
6
5
  desc 'Update the version.rb file with the sync token and the minor version based on modification date'
7
- task :update_version_tokens, [:sync_token, :modification_date] do |_task, args|
8
- version_specifier = args.modification_date.strftime("%Y%m%d")
9
- version_file_contents = File.read(__dir__ + '/lib/aws_ip_utilities/version.rb')
6
+ task :update_version_tokens, [:sync_token] do |_task, args|
7
+ version_specifier = args.sync_token
8
+ version_file_contents = File.read(__dir__ + '/lib/aws_ip_utilities/version.rb')
10
9
  version_file_contents.gsub!(/(\d+\.\d+\.)(\d+)/, '\1%s' % version_specifier)
11
- version_file_contents.gsub!(/SYNC_TOKEN.+$/, 'SYNC_TOKEN = "%s"' % args.sync_token)
12
- File.open(__dir__ + '/lib/aws_ip_utilities/version.rb', 'wb') do |f|
10
+ version_file_contents.gsub!(/SYNC_TOKEN.+$/, 'SYNC_TOKEN = "%s"' % version_specifier)
11
+ File.open(__dir__ + '/lib/aws_ip_utilities/version.rb', 'wb') do |f|
13
12
  f << version_file_contents
14
13
  end
15
14
  end
16
15
 
17
16
  desc 'Download the IP ranges from AWS and update the version of the gem'
18
17
  task :download_and_bump_version do
19
- $stderr.puts "Checking if ip-ranges.json needs an update"
18
+ warn "Checking if ip-ranges.json needs an update"
20
19
  require 'open-uri'
21
20
  require 'json'
22
21
  uri = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
23
22
  open(uri) do |f|
24
23
  raise "Unexpected status #{f.status.inspect}" unless f.status.first == "200"
25
24
  parsed = JSON.parse(f.read)
26
- cached = JSON.parse(File.read(__dir__ + '/lib/aws_ip_utilities/ip-ranges.json')) rescue nil
25
+ cached = JSON.parse(File.read(__dir__ + '/lib/aws_ip_utilities/ip-ranges.json'))
27
26
 
28
- #break if parsed.fetch('syncToken') == cached.fetch('syncToken')
27
+ if parsed.fetch('syncToken') == cached.fetch('syncToken')
28
+ warn "ip-ranges.json is up to date, no need to bump version"
29
+ break
30
+ end
29
31
 
30
32
  sync_token = parsed.fetch('syncToken')
31
- last_modified = Time.parse(parsed.fetch('createDate'))
32
- File.open(__dir__ + '/lib/aws_ip_utilities/ip-ranges.json', 'wb') do |fo|
33
+ File.open(__dir__ + '/lib/aws_ip_utilities/ip-ranges.json', 'wb') do |fo|
33
34
  fo << JSON.pretty_generate(parsed)
34
35
  end
35
- Rake::Task["update_version_tokens"].invoke(sync_token, last_modified)
36
+ Rake::Task["update_version_tokens"].invoke(sync_token)
36
37
  end
37
38
  end
39
+ task release_with_ip_data: [:download_and_bump_version, :release]
38
40
 
39
- task :default => :spec
40
- task :release_with_ip_data => [:download_and_bump_version, :release]
41
+ RSpec::Core::RakeTask.new(:spec)
42
+ RuboCop::RakeTask.new(:rubocop)
43
+ task default: [:spec, :rubocop]
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'aws_ip_utilities/version'
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.14"
24
+ spec.add_development_dependency "wetransfer_style", "0.6.0"
24
25
  spec.add_development_dependency "rake", "~> 10.0"
25
26
  spec.add_development_dependency "rack"
26
27
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -21,7 +21,9 @@ module AwsIpUtilities
21
21
 
22
22
  def self.aws_prefix(ip_addr_string)
23
23
  ip = IPAddr.new(ip_addr_string)
24
- PREFIXES.find {|subnet| subnet.include?(ip) }
24
+ PREFIXES.find { |subnet| subnet.include?(ip) }
25
+ rescue IPAddr::InvalidAddressError
26
+ nil
25
27
  end
26
28
 
27
29
  def self.region_for(ip_addr_string)
@@ -1,6 +1,6 @@
1
1
  {
2
- "syncToken": "1531345951",
3
- "createDate": "2018-07-11-21-52-31",
2
+ "syncToken": "1533583353",
3
+ "createDate": "2018-08-06-19-22-33",
4
4
  "prefixes": [
5
5
  {
6
6
  "ip_prefix": "18.208.0.0/13",
@@ -482,6 +482,11 @@
482
482
  "region": "us-west-2",
483
483
  "service": "AMAZON"
484
484
  },
485
+ {
486
+ "ip_prefix": "99.82.174.0/24",
487
+ "region": "us-east-1",
488
+ "service": "AMAZON"
489
+ },
485
490
  {
486
491
  "ip_prefix": "52.95.255.128/28",
487
492
  "region": "eu-central-1",
@@ -803,13 +808,13 @@
803
808
  "service": "AMAZON"
804
809
  },
805
810
  {
806
- "ip_prefix": "204.246.160.0/22",
807
- "region": "us-west-1",
811
+ "ip_prefix": "99.82.160.0/24",
812
+ "region": "ap-south-1",
808
813
  "service": "AMAZON"
809
814
  },
810
815
  {
811
- "ip_prefix": "52.93.142.0/23",
812
- "region": "eu-north-1",
816
+ "ip_prefix": "204.246.160.0/22",
817
+ "region": "us-west-1",
813
818
  "service": "AMAZON"
814
819
  },
815
820
  {
@@ -842,6 +847,11 @@
842
847
  "region": "eu-west-1",
843
848
  "service": "AMAZON"
844
849
  },
850
+ {
851
+ "ip_prefix": "52.95.29.0/26",
852
+ "region": "us-east-2",
853
+ "service": "AMAZON"
854
+ },
845
855
  {
846
856
  "ip_prefix": "35.160.0.0/13",
847
857
  "region": "us-west-2",
@@ -972,6 +982,11 @@
972
982
  "region": "us-west-1",
973
983
  "service": "AMAZON"
974
984
  },
985
+ {
986
+ "ip_prefix": "99.82.161.0/24",
987
+ "region": "eu-west-3",
988
+ "service": "AMAZON"
989
+ },
975
990
  {
976
991
  "ip_prefix": "46.137.192.0/19",
977
992
  "region": "ap-southeast-1",
@@ -1087,6 +1102,11 @@
1087
1102
  "region": "eu-west-1",
1088
1103
  "service": "AMAZON"
1089
1104
  },
1105
+ {
1106
+ "ip_prefix": "99.82.171.0/24",
1107
+ "region": "ap-southeast-1",
1108
+ "service": "AMAZON"
1109
+ },
1090
1110
  {
1091
1111
  "ip_prefix": "52.94.4.0/24",
1092
1112
  "region": "us-east-2",
@@ -1207,6 +1227,11 @@
1207
1227
  "region": "eu-west-2",
1208
1228
  "service": "AMAZON"
1209
1229
  },
1230
+ {
1231
+ "ip_prefix": "54.239.112.0/24",
1232
+ "region": "us-east-1",
1233
+ "service": "AMAZON"
1234
+ },
1210
1235
  {
1211
1236
  "ip_prefix": "52.95.34.0/24",
1212
1237
  "region": "ap-northeast-1",
@@ -1237,11 +1262,6 @@
1237
1262
  "region": "eu-central-1",
1238
1263
  "service": "AMAZON"
1239
1264
  },
1240
- {
1241
- "ip_prefix": "52.93.144.0/23",
1242
- "region": "eu-north-1",
1243
- "service": "AMAZON"
1244
- },
1245
1265
  {
1246
1266
  "ip_prefix": "52.94.16.0/24",
1247
1267
  "region": "eu-west-3",
@@ -1287,6 +1307,11 @@
1287
1307
  "region": "GLOBAL",
1288
1308
  "service": "AMAZON"
1289
1309
  },
1310
+ {
1311
+ "ip_prefix": "99.82.162.0/24",
1312
+ "region": "eu-west-1",
1313
+ "service": "AMAZON"
1314
+ },
1290
1315
  {
1291
1316
  "ip_prefix": "54.239.0.144/28",
1292
1317
  "region": "cn-north-1",
@@ -1497,6 +1522,11 @@
1497
1522
  "region": "us-west-1",
1498
1523
  "service": "AMAZON"
1499
1524
  },
1525
+ {
1526
+ "ip_prefix": "99.82.173.0/24",
1527
+ "region": "us-east-1",
1528
+ "service": "AMAZON"
1529
+ },
1500
1530
  {
1501
1531
  "ip_prefix": "18.194.0.0/15",
1502
1532
  "region": "eu-central-1",
@@ -1532,6 +1562,11 @@
1532
1562
  "region": "us-east-1",
1533
1563
  "service": "AMAZON"
1534
1564
  },
1565
+ {
1566
+ "ip_prefix": "99.82.163.0/24",
1567
+ "region": "eu-central-1",
1568
+ "service": "AMAZON"
1569
+ },
1535
1570
  {
1536
1571
  "ip_prefix": "54.92.128.0/17",
1537
1572
  "region": "us-east-1",
@@ -1597,6 +1632,11 @@
1597
1632
  "region": "me-south-1",
1598
1633
  "service": "AMAZON"
1599
1634
  },
1635
+ {
1636
+ "ip_prefix": "99.82.166.0/24",
1637
+ "region": "ap-northeast-2",
1638
+ "service": "AMAZON"
1639
+ },
1600
1640
  {
1601
1641
  "ip_prefix": "13.58.0.0/15",
1602
1642
  "region": "us-east-2",
@@ -1872,6 +1912,11 @@
1872
1912
  "region": "eu-west-1",
1873
1913
  "service": "AMAZON"
1874
1914
  },
1915
+ {
1916
+ "ip_prefix": "3.8.0.0/14",
1917
+ "region": "eu-west-2",
1918
+ "service": "AMAZON"
1919
+ },
1875
1920
  {
1876
1921
  "ip_prefix": "18.246.0.0/16",
1877
1922
  "region": "us-west-2",
@@ -2062,6 +2107,11 @@
2062
2107
  "region": "ap-southeast-1",
2063
2108
  "service": "AMAZON"
2064
2109
  },
2110
+ {
2111
+ "ip_prefix": "52.95.52.0/22",
2112
+ "region": "us-east-1",
2113
+ "service": "AMAZON"
2114
+ },
2065
2115
  {
2066
2116
  "ip_prefix": "18.153.0.0/16",
2067
2117
  "region": "eu-central-1",
@@ -2472,6 +2522,11 @@
2472
2522
  "region": "us-west-2",
2473
2523
  "service": "AMAZON"
2474
2524
  },
2525
+ {
2526
+ "ip_prefix": "99.82.164.0/24",
2527
+ "region": "sa-east-1",
2528
+ "service": "AMAZON"
2529
+ },
2475
2530
  {
2476
2531
  "ip_prefix": "52.92.68.0/22",
2477
2532
  "region": "eu-central-1",
@@ -2572,6 +2627,11 @@
2572
2627
  "region": "ap-northeast-1",
2573
2628
  "service": "AMAZON"
2574
2629
  },
2630
+ {
2631
+ "ip_prefix": "99.82.168.0/24",
2632
+ "region": "ap-northeast-1",
2633
+ "service": "AMAZON"
2634
+ },
2575
2635
  {
2576
2636
  "ip_prefix": "52.93.48.22/31",
2577
2637
  "region": "eu-central-1",
@@ -2852,6 +2912,11 @@
2852
2912
  "region": "me-south-1",
2853
2913
  "service": "AMAZON"
2854
2914
  },
2915
+ {
2916
+ "ip_prefix": "99.82.167.0/24",
2917
+ "region": "eu-west-2",
2918
+ "service": "AMAZON"
2919
+ },
2855
2920
  {
2856
2921
  "ip_prefix": "205.251.254.0/24",
2857
2922
  "region": "GLOBAL",
@@ -2927,11 +2992,6 @@
2927
2992
  "region": "cn-northwest-1",
2928
2993
  "service": "AMAZON"
2929
2994
  },
2930
- {
2931
- "ip_prefix": "52.93.224.0/22",
2932
- "region": "me-south-1",
2933
- "service": "AMAZON"
2934
- },
2935
2995
  {
2936
2996
  "ip_prefix": "52.144.194.192/26",
2937
2997
  "region": "us-west-1",
@@ -2992,6 +3052,11 @@
2992
3052
  "region": "ap-south-1",
2993
3053
  "service": "AMAZON"
2994
3054
  },
3055
+ {
3056
+ "ip_prefix": "99.82.156.0/22",
3057
+ "region": "GLOBAL",
3058
+ "service": "AMAZON"
3059
+ },
2995
3060
  {
2996
3061
  "ip_prefix": "52.94.199.0/24",
2997
3062
  "region": "us-east-2",
@@ -3112,6 +3177,11 @@
3112
3177
  "region": "sa-east-1",
3113
3178
  "service": "AMAZON"
3114
3179
  },
3180
+ {
3181
+ "ip_prefix": "99.82.172.0/24",
3182
+ "region": "ca-central-1",
3183
+ "service": "AMAZON"
3184
+ },
3115
3185
  {
3116
3186
  "ip_prefix": "52.119.184.0/22",
3117
3187
  "region": "ap-southeast-1",
@@ -3192,6 +3262,11 @@
3192
3262
  "region": "me-south-1",
3193
3263
  "service": "AMAZON"
3194
3264
  },
3265
+ {
3266
+ "ip_prefix": "99.82.169.0/24",
3267
+ "region": "us-east-1",
3268
+ "service": "AMAZON"
3269
+ },
3195
3270
  {
3196
3271
  "ip_prefix": "52.94.198.128/28",
3197
3272
  "region": "ca-central-1",
@@ -3247,6 +3322,16 @@
3247
3322
  "region": "eu-central-1",
3248
3323
  "service": "AMAZON"
3249
3324
  },
3325
+ {
3326
+ "ip_prefix": "99.82.165.0/24",
3327
+ "region": "us-east-1",
3328
+ "service": "AMAZON"
3329
+ },
3330
+ {
3331
+ "ip_prefix": "3.0.0.0/15",
3332
+ "region": "ap-southeast-1",
3333
+ "service": "AMAZON"
3334
+ },
3250
3335
  {
3251
3336
  "ip_prefix": "43.250.193.0/24",
3252
3337
  "region": "ap-southeast-1",
@@ -3297,6 +3382,11 @@
3297
3382
  "region": "ap-southeast-1",
3298
3383
  "service": "AMAZON"
3299
3384
  },
3385
+ {
3386
+ "ip_prefix": "54.239.113.0/24",
3387
+ "region": "eu-west-1",
3388
+ "service": "AMAZON"
3389
+ },
3300
3390
  {
3301
3391
  "ip_prefix": "176.32.112.0/21",
3302
3392
  "region": "us-west-1",
@@ -3307,6 +3397,11 @@
3307
3397
  "region": "us-west-2",
3308
3398
  "service": "AMAZON"
3309
3399
  },
3400
+ {
3401
+ "ip_prefix": "99.82.170.0/24",
3402
+ "region": "us-west-1",
3403
+ "service": "AMAZON"
3404
+ },
3310
3405
  {
3311
3406
  "ip_prefix": "52.94.7.0/24",
3312
3407
  "region": "sa-east-1",
@@ -4792,6 +4887,11 @@
4792
4887
  "region": "us-west-2",
4793
4888
  "service": "EC2"
4794
4889
  },
4890
+ {
4891
+ "ip_prefix": "3.8.0.0/14",
4892
+ "region": "eu-west-2",
4893
+ "service": "EC2"
4894
+ },
4795
4895
  {
4796
4896
  "ip_prefix": "18.246.0.0/16",
4797
4897
  "region": "us-west-2",
@@ -5402,6 +5502,11 @@
5402
5502
  "region": "eu-central-1",
5403
5503
  "service": "EC2"
5404
5504
  },
5505
+ {
5506
+ "ip_prefix": "3.0.0.0/15",
5507
+ "region": "ap-southeast-1",
5508
+ "service": "EC2"
5509
+ },
5405
5510
  {
5406
5511
  "ip_prefix": "52.77.0.0/16",
5407
5512
  "region": "ap-southeast-1",
@@ -5757,6 +5862,11 @@
5757
5862
  "region": "GLOBAL",
5758
5863
  "service": "CLOUDFRONT"
5759
5864
  },
5865
+ {
5866
+ "ip_prefix": "99.82.156.0/22",
5867
+ "region": "GLOBAL",
5868
+ "service": "CLOUDFRONT"
5869
+ },
5760
5870
  {
5761
5871
  "ip_prefix": "205.251.252.0/23",
5762
5872
  "region": "GLOBAL",
@@ -5847,6 +5957,11 @@
5847
5957
  "region": "ap-south-1",
5848
5958
  "service": "CODEBUILD"
5849
5959
  },
5960
+ {
5961
+ "ip_prefix": "52.82.1.0/29",
5962
+ "region": "cn-northwest-1",
5963
+ "service": "CODEBUILD"
5964
+ },
5850
5965
  {
5851
5966
  "ip_prefix": "177.71.207.16/29",
5852
5967
  "region": "sa-east-1",
@@ -5882,6 +5997,11 @@
5882
5997
  "region": "sa-east-1",
5883
5998
  "service": "CODEBUILD"
5884
5999
  },
6000
+ {
6001
+ "ip_prefix": "52.80.198.136/29",
6002
+ "region": "cn-north-1",
6003
+ "service": "CODEBUILD"
6004
+ },
5885
6005
  {
5886
6006
  "ip_prefix": "13.56.32.200/29",
5887
6007
  "region": "us-west-1",
@@ -5892,6 +6012,16 @@
5892
6012
  "region": "us-east-1",
5893
6013
  "service": "CODEBUILD"
5894
6014
  },
6015
+ {
6016
+ "ip_prefix": "13.251.113.64/26",
6017
+ "region": "ap-southeast-1",
6018
+ "service": "AMAZON"
6019
+ },
6020
+ {
6021
+ "ip_prefix": "13.251.116.0/23",
6022
+ "region": "ap-southeast-1",
6023
+ "service": "AMAZON"
6024
+ },
5895
6025
  {
5896
6026
  "ip_prefix": "13.210.2.192/26",
5897
6027
  "region": "ap-southeast-2",
@@ -6089,6 +6219,11 @@
6089
6219
  "region": "me-south-1",
6090
6220
  "service": "AMAZON"
6091
6221
  },
6222
+ {
6223
+ "ipv6_prefix": "2a05:d050:e000::/40",
6224
+ "region": "me-south-1",
6225
+ "service": "AMAZON"
6226
+ },
6092
6227
  {
6093
6228
  "ipv6_prefix": "2a05:d07c:e000::/40",
6094
6229
  "region": "me-south-1",
@@ -7309,6 +7444,11 @@
7309
7444
  "region": "ap-southeast-1",
7310
7445
  "service": "S3"
7311
7446
  },
7447
+ {
7448
+ "ipv6_prefix": "2a05:d050:e000::/40",
7449
+ "region": "me-south-1",
7450
+ "service": "S3"
7451
+ },
7312
7452
  {
7313
7453
  "ipv6_prefix": "2a05:d050:c000::/40",
7314
7454
  "region": "eu-west-2",
@@ -1,4 +1,4 @@
1
1
  module AwsIpUtilities
2
- VERSION = "0.2.20180711"
3
- SYNC_TOKEN = "1531345951"
2
+ VERSION = "0.3.1533583353"
3
+ SYNC_TOKEN = "1533583353"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_ip_utilities
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.20180711
4
+ version: 0.3.1533583353
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: wetransfer_style
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.6.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.6.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,7 @@ extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
77
91
  - ".rspec"
92
+ - ".rubocop.yml"
78
93
  - ".travis.yml"
79
94
  - Gemfile
80
95
  - README.md
@@ -105,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
120
  version: '0'
106
121
  requirements: []
107
122
  rubyforge_project:
108
- rubygems_version: 2.5.2
123
+ rubygems_version: 2.7.3
109
124
  signing_key:
110
125
  specification_version: 4
111
126
  summary: Checks for AWS IP ranges.