maxmind-geoip2 1.2.0 → 1.3.0

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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Gemfile.lock +114 -0
  4. data/README.dev.md +1 -1
  5. data/README.md +17 -2
  6. data/Rakefile +1 -0
  7. data/lib/maxmind/geoip2/model/anonymous_plus.rb +46 -0
  8. data/lib/maxmind/geoip2/model/city.rb +1 -1
  9. data/lib/maxmind/geoip2/reader.rb +26 -1
  10. data/lib/maxmind/geoip2/record/location.rb +3 -3
  11. data/lib/maxmind/geoip2/record/traits.rb +1 -1
  12. data/lib/maxmind/geoip2/version.rb +1 -1
  13. data/maxmind-geoip2.gemspec +5 -5
  14. data/test/data/LICENSE-APACHE +202 -0
  15. data/test/data/LICENSE-MIT +17 -0
  16. data/test/data/MaxMind-DB-spec.md +1 -2
  17. data/test/data/README.md +8 -1
  18. data/test/data/go.mod +1 -1
  19. data/test/data/pkg/writer/geoip2.go +7 -5
  20. data/test/data/pkg/writer/maxmind.go +2 -1
  21. data/test/data/pkg/writer/writer.go +4 -1
  22. data/test/data/source-data/GeoIP-Anonymous-Plus-Test.json +175 -0
  23. data/test/data/source-data/GeoIP2-Anonymous-IP-Test.json +6 -0
  24. data/test/data/source-data/GeoIP2-City-Test.json +73 -7
  25. data/test/data/source-data/GeoIP2-Country-Test.json +3 -28
  26. data/test/data/source-data/GeoIP2-Enterprise-Test.json +27 -8
  27. data/test/data/source-data/GeoIP2-IP-Risk-Test.json +31 -0
  28. data/test/data/source-data/GeoIP2-Precision-Enterprise-Test.json +585 -11
  29. data/test/data/source-data/GeoLite2-City-Test.json +0 -3
  30. data/test/data/source-data/GeoLite2-Country-Test.json +0 -3
  31. data/test/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb +0 -0
  32. data/test/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  33. data/test/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  34. data/test/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  35. data/test/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  36. data/test/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
  37. data/test/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  38. data/test/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  39. data/test/data/test-data/GeoIP2-IP-Risk-Test.mmdb +0 -0
  40. data/test/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  41. data/test/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
  42. data/test/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
  43. data/test/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
  44. data/test/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
  45. data/test/data/test-data/GeoLite2-City-Test.mmdb +0 -0
  46. data/test/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
  47. data/test/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
  48. data/test/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  49. data/test/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  50. data/test/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  51. data/test/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  52. data/test/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  53. data/test/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  54. data/test/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  55. data/test/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  56. data/test/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  57. data/test/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  58. data/test/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  59. data/test/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  60. data/test/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  61. data/test/test_reader.rb +23 -0
  62. metadata +12 -9
  63. data/test/data/LICENSE +0 -4
  64. data/test/data/perltidyrc +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c1d04d352a8344e1e8d9c232ab7713bc0b74ddaa1e4a82aec61dbbf37bfd925
4
- data.tar.gz: 20bcee370b35a4e098b48b36146eb7da9674f6c271ba94744a435addbd9c5e05
3
+ metadata.gz: 9d6ddb183c97df1041a902a1f2f98dec87e640b5907ae19b080bdd03c87bc03f
4
+ data.tar.gz: 8f0e58e55e605576bc4214e878c28aaab3bb6c0dbd065bb1281ac5f0db65e69e
5
5
  SHA512:
6
- metadata.gz: 0331f1fe319379d035bd4f8675f775bbe31f0d3747d2f9a65754523cb6718160237d5a232d54cad7cd00cdcfe5243ff0f8a39276d749948116fc974221eb3d8a
7
- data.tar.gz: 1d3e2f6c9a5847671b4b86004c7407bacf25cb271674d7dd49c5217b15d20a307ba416ec19a5f04d2050925ee689a97f01ca899f2edcb611bb44c5ee1a13ba35
6
+ metadata.gz: 2c6d5e20fd3bef3aacde30acb0c22695c8a903626747db02b58067adcaeafd9d2673f9be8189fad8d6a53869028ff15bf9536ce66a435a2da6e86fb4126cf06b
7
+ data.tar.gz: 8c79484d19313833856f91deabceed833f2dae00fb1cd4993d57b973b1747541cf83122e07043c1b4925a2f291172195ab024988be39501a922a751c7808cde1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.0 (2025-05-06)
4
+
5
+ * Support for the GeoIP Anonymous Plus database has been added. To do a
6
+ lookup in this database, use the `anonymous_plus` method on
7
+ `MaxMind::GeoIP2::Reader`.
8
+ * Ruby 3.0+ is now required. If you're using Ruby 2.5, 2.6, or 2.7, please
9
+ use version 1.2.0 of this gem.
10
+ * Deprecated `metro_code` on `MaxMind::GeoIP2::Record::Location`. The code
11
+ values are no longer being maintained.
12
+
3
13
  ## 1.2.0 (2023-12-04)
4
14
 
5
15
  * `MaxMind::GeoIP2::Client` now validates the IP address before making a
data/Gemfile.lock ADDED
@@ -0,0 +1,114 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ maxmind-geoip2 (1.3.0)
5
+ connection_pool (~> 2.2)
6
+ http (>= 4.3, < 6.0)
7
+ maxmind-db (~> 1.2)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.8.7)
13
+ public_suffix (>= 2.0.2, < 7.0)
14
+ ast (2.4.3)
15
+ base64 (0.2.0)
16
+ bigdecimal (3.1.9)
17
+ connection_pool (2.5.3)
18
+ crack (1.0.0)
19
+ bigdecimal
20
+ rexml
21
+ domain_name (0.6.20240107)
22
+ ffi (1.17.2)
23
+ ffi (1.17.2-aarch64-linux-gnu)
24
+ ffi (1.17.2-aarch64-linux-musl)
25
+ ffi (1.17.2-arm-linux-gnu)
26
+ ffi (1.17.2-arm-linux-musl)
27
+ ffi (1.17.2-arm64-darwin)
28
+ ffi (1.17.2-x86-linux-gnu)
29
+ ffi (1.17.2-x86-linux-musl)
30
+ ffi (1.17.2-x86_64-darwin)
31
+ ffi (1.17.2-x86_64-linux-gnu)
32
+ ffi (1.17.2-x86_64-linux-musl)
33
+ ffi-compiler (1.3.2)
34
+ ffi (>= 1.15.5)
35
+ rake
36
+ hashdiff (1.1.2)
37
+ http (5.2.0)
38
+ addressable (~> 2.8)
39
+ base64 (~> 0.1)
40
+ http-cookie (~> 1.0)
41
+ http-form_data (~> 2.2)
42
+ llhttp-ffi (~> 0.5.0)
43
+ http-cookie (1.0.8)
44
+ domain_name (~> 0.5)
45
+ http-form_data (2.3.0)
46
+ json (2.11.3)
47
+ language_server-protocol (3.17.0.4)
48
+ lint_roller (1.1.0)
49
+ llhttp-ffi (0.5.1)
50
+ ffi-compiler (~> 1.0)
51
+ rake (~> 13.0)
52
+ maxmind-db (1.3.2)
53
+ minitest (5.25.5)
54
+ parallel (1.27.0)
55
+ parser (3.3.8.0)
56
+ ast (~> 2.4.1)
57
+ racc
58
+ prism (1.4.0)
59
+ public_suffix (6.0.2)
60
+ racc (1.8.1)
61
+ rainbow (3.1.1)
62
+ rake (13.2.1)
63
+ regexp_parser (2.10.0)
64
+ rexml (3.4.1)
65
+ rubocop (1.75.5)
66
+ json (~> 2.3)
67
+ language_server-protocol (~> 3.17.0.2)
68
+ lint_roller (~> 1.1.0)
69
+ parallel (~> 1.10)
70
+ parser (>= 3.3.0.2)
71
+ rainbow (>= 2.2.2, < 4.0)
72
+ regexp_parser (>= 2.9.3, < 3.0)
73
+ rubocop-ast (>= 1.44.0, < 2.0)
74
+ ruby-progressbar (~> 1.7)
75
+ unicode-display_width (>= 2.4.0, < 4.0)
76
+ rubocop-ast (1.44.1)
77
+ parser (>= 3.3.7.2)
78
+ prism (~> 1.4)
79
+ rubocop-performance (1.25.0)
80
+ lint_roller (~> 1.1)
81
+ rubocop (>= 1.75.0, < 2.0)
82
+ rubocop-ast (>= 1.38.0, < 2.0)
83
+ ruby-progressbar (1.13.0)
84
+ unicode-display_width (3.1.4)
85
+ unicode-emoji (~> 4.0, >= 4.0.4)
86
+ unicode-emoji (4.0.4)
87
+ webmock (3.25.1)
88
+ addressable (>= 2.8.0)
89
+ crack (>= 0.3.2)
90
+ hashdiff (>= 0.4.0, < 2.0.0)
91
+
92
+ PLATFORMS
93
+ aarch64-linux-gnu
94
+ aarch64-linux-musl
95
+ arm-linux-gnu
96
+ arm-linux-musl
97
+ arm64-darwin
98
+ ruby
99
+ x86-linux-gnu
100
+ x86-linux-musl
101
+ x86_64-darwin
102
+ x86_64-linux-gnu
103
+ x86_64-linux-musl
104
+
105
+ DEPENDENCIES
106
+ maxmind-geoip2!
107
+ minitest
108
+ rake
109
+ rubocop
110
+ rubocop-performance
111
+ webmock
112
+
113
+ BUNDLED WITH
114
+ 2.6.7
data/README.dev.md CHANGED
@@ -1,4 +1,4 @@
1
1
  # How to release
2
2
 
3
3
  See
4
- [here](https://github.com/maxmind/MaxMind-DB-Reader-ruby/blob/main/README.dev.md).
4
+ [here](https://github.com/maxmind/minfraud-api-ruby/blob/main/README.dev.md).
data/README.md CHANGED
@@ -133,6 +133,21 @@ record = reader.anonymous_ip('128.101.101.101')
133
133
  puts "Anonymous" if record.is_anonymous
134
134
  ```
135
135
 
136
+ ### Anonymous Plus Example
137
+
138
+ ```ruby
139
+ require 'maxmind/geoip2'
140
+
141
+ # This creates the Reader object which should be reused across lookups.
142
+ reader = MaxMind::GeoIP2::Reader.new(
143
+ database: '/usr/share/GeoIP/GeoIP-Anonymous-Plus.mmdb',
144
+ )
145
+
146
+ record = reader.anonymous_plus('128.101.101.101')
147
+
148
+ puts record.anonymizer_confidence # 30
149
+ ```
150
+
136
151
  ### ASN Example
137
152
 
138
153
  ```ruby
@@ -332,7 +347,7 @@ client API, please see [our support page](https://www.maxmind.com/en/support).
332
347
 
333
348
  ## Requirements
334
349
 
335
- This code requires Ruby version 2.5 or higher.
350
+ This code requires Ruby version 3.0 or higher.
336
351
 
337
352
  ## Contributing
338
353
 
@@ -345,7 +360,7 @@ This library uses [Semantic Versioning](https://semver.org/).
345
360
 
346
361
  ## Copyright and License
347
362
 
348
- This software is Copyright (c) 2020-2023 by MaxMind, Inc.
363
+ This software is Copyright (c) 2020-2025 by MaxMind, Inc.
349
364
 
350
365
  This is free software, licensed under the [Apache License, Version
351
366
  2.0](LICENSE-APACHE) or the [MIT License](LICENSE-MIT), at your option.
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'bundler/gem_tasks'
3
4
  require 'rake/testtask'
4
5
  require 'rubocop/rake_task'
5
6
 
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+ require 'maxmind/geoip2/model/anonymous_ip'
5
+
6
+ module MaxMind
7
+ module GeoIP2
8
+ module Model
9
+ # Model class for the Anonymous Plus database.
10
+ class AnonymousPlus < AnonymousIP
11
+ # A score ranging from 1 to 99 that is our percent confidence that the
12
+ # network is currently part of an actively used VPN service.
13
+ #
14
+ # @return [Integer, nil]
15
+ def anonymizer_confidence
16
+ get('anonymizer_confidence')
17
+ end
18
+
19
+ # The last day that the network was sighted in our analysis of
20
+ # anonymized networks. This value is parsed lazily.
21
+ #
22
+ # @return [Date, nil] A Date object representing the last seen date,
23
+ # or nil if the date is not available.
24
+ def network_last_seen
25
+ return @network_last_seen if defined?(@network_last_seen)
26
+
27
+ date_string = get('network_last_seen')
28
+
29
+ if !date_string
30
+ return nil
31
+ end
32
+
33
+ @network_last_seen = Date.parse(date_string)
34
+ end
35
+
36
+ # The name of the VPN provider (e.g., NordVPN, SurfShark, etc.)
37
+ # associated with the network.
38
+ #
39
+ # @return [String, nil]
40
+ def provider_name
41
+ get('provider_name')
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -46,7 +46,7 @@ module MaxMind
46
46
 
47
47
  # @!visibility private
48
48
  def initialize(record, locales)
49
- super(record, locales)
49
+ super
50
50
  @city = MaxMind::GeoIP2::Record::City.new(record['city'], locales)
51
51
  @location = MaxMind::GeoIP2::Record::Location.new(record['location'])
52
52
  @postal = MaxMind::GeoIP2::Record::Postal.new(record['postal'])
@@ -3,6 +3,7 @@
3
3
  require 'maxmind/db'
4
4
  require 'maxmind/geoip2/errors'
5
5
  require 'maxmind/geoip2/model/anonymous_ip'
6
+ require 'maxmind/geoip2/model/anonymous_plus'
6
7
  require 'maxmind/geoip2/model/asn'
7
8
  require 'maxmind/geoip2/model/city'
8
9
  require 'maxmind/geoip2/model/connection_type'
@@ -86,7 +87,7 @@ module MaxMind
86
87
  # rubocop:enable Metrics/CyclomaticComplexity
87
88
  # rubocop:enable Metrics/PerceivedComplexity
88
89
 
89
- # Look up the IP address in the database.
90
+ # Look up the IP address in the Anonymous IP database.
90
91
  #
91
92
  # @param ip_address [String] a string in the standard notation. It may be
92
93
  # IPv4 or IPv6.
@@ -110,6 +111,30 @@ module MaxMind
110
111
  )
111
112
  end
112
113
 
114
+ # Look up the IP address in the Anonymous Plus database.
115
+ #
116
+ # @param ip_address [String] a string in the standard notation. It may be
117
+ # IPv4 or IPv6.
118
+ #
119
+ # @return [MaxMind::GeoIP2::Model::AnonymousPlus]
120
+ #
121
+ # @raise [ArgumentError] if used against a non-Anonymous Plus database
122
+ # or if you attempt to look up an IPv6 address in an IPv4 only database.
123
+ #
124
+ # @raise [AddressNotFoundError] if the IP address is not found in the
125
+ # database.
126
+ #
127
+ # @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
128
+ # corrupt.
129
+ def anonymous_plus(ip_address)
130
+ flat_model_for(
131
+ Model::AnonymousPlus,
132
+ 'anonymous_plus',
133
+ 'GeoIP-Anonymous-Plus',
134
+ ip_address,
135
+ )
136
+ end
137
+
113
138
  # Look up the IP address in an ASN database.
114
139
  #
115
140
  # @param ip_address [String] a string in the standard notation. It may be
@@ -46,11 +46,11 @@ module MaxMind
46
46
  get('longitude')
47
47
  end
48
48
 
49
- # The metro code of the location if the location is in the US. MaxMind
50
- # returns the same metro codes as the Google AdWords API. See
51
- # https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions.
49
+ # The metro code is a no-longer-maintained code for targeting
50
+ # advertisements in Google.
52
51
  #
53
52
  # @return [Integer, nil]
53
+ # @deprecated Code values are no longer maintained.
54
54
  def metro_code
55
55
  get('metro_code')
56
56
  end
@@ -12,7 +12,7 @@ module MaxMind
12
12
  class Traits < Abstract
13
13
  # @!visibility private
14
14
  def initialize(record)
15
- super(record)
15
+ super
16
16
  if record && !record.key?('network') && record.key?('ip_address') &&
17
17
  record.key?('prefix_length')
18
18
  ip = IPAddr.new(record['ip_address']).mask(record['prefix_length'])
@@ -3,6 +3,6 @@
3
3
  module MaxMind
4
4
  module GeoIP2
5
5
  # The Gem version.
6
- VERSION = '1.2.0'
6
+ VERSION = '1.3.0'
7
7
  end
8
8
  end
@@ -7,7 +7,7 @@ require 'maxmind/geoip2/version'
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.authors = ['William Storey']
10
- s.files = Dir['**/*']
10
+ s.files = Dir['**/*'].difference(Dir['.github/**/*', 'dev-bin/**/*'])
11
11
  s.name = 'maxmind-geoip2'
12
12
  s.summary = 'A gem for interacting with the GeoIP2 webservices and databases.'
13
13
  s.version = MaxMind::GeoIP2::VERSION
@@ -24,11 +24,11 @@ Gem::Specification.new do |s|
24
24
  'rubygems_mfa_required' => 'true',
25
25
  'source_code_uri' => 'https://github.com/maxmind/GeoIP2-ruby',
26
26
  }
27
- s.required_ruby_version = '>= 2.5.0'
27
+ s.required_ruby_version = '>= 3.0'
28
28
 
29
- s.add_runtime_dependency 'connection_pool', ['~> 2.2']
30
- s.add_runtime_dependency 'http', '>= 4.3', '< 6.0'
31
- s.add_runtime_dependency 'maxmind-db', ['~> 1.2']
29
+ s.add_dependency 'connection_pool', ['~> 2.2']
30
+ s.add_dependency 'http', '>= 4.3', '< 6.0'
31
+ s.add_dependency 'maxmind-db', ['~> 1.2']
32
32
 
33
33
  s.add_development_dependency 'minitest'
34
34
  s.add_development_dependency 'rake'
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ https://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ https://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,17 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2
+ this software and associated documentation files (the "Software"), to deal in
3
+ the Software without restriction, including without limitation the rights to
4
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
5
+ of the Software, and to permit persons to whom the Software is furnished to do
6
+ so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all
9
+ copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17
+ SOFTWARE.
@@ -544,14 +544,13 @@ data section size for the database is limited to 4GB.
544
544
 
545
545
  ### Writer
546
546
 
547
- * [Perl](https://github.com/maxmind/MaxMind-DB-Writer-perl)
547
+ * [Go](https://github.com/maxmind/mmdbwriter)
548
548
 
549
549
  ### Reader
550
550
 
551
551
  * [C](https://github.com/maxmind/libmaxminddb)
552
552
  * [C#](https://github.com/maxmind/MaxMind-DB-Reader-dotnet)
553
553
  * [Java](https://github.com/maxmind/MaxMind-DB-Reader-java)
554
- * [Perl](https://github.com/maxmind/MaxMind-DB-Reader-perl)
555
554
  * [PHP](https://github.com/maxmind/MaxMind-DB-Reader-php)
556
555
  * [Python](https://github.com/maxmind/MaxMind-DB-Reader-python)
557
556
  * [Ruby](https://github.com/maxmind/MaxMind-DB-Reader-ruby)
data/test/data/README.md CHANGED
@@ -1,4 +1,11 @@
1
1
  MaxMind DB is a binary file format that stores data indexed by IP address
2
2
  subnets (IPv4 or IPv6).
3
3
 
4
- This repository contains the spec for that format.
4
+ This repository contains the spec for that format as well as test databases.
5
+
6
+ # Copyright and License
7
+
8
+ This software is Copyright (c) 2013 - 2025 by MaxMind, Inc.
9
+
10
+ This is free software, licensed under the [Apache License, Version
11
+ 2.0](LICENSE-APACHE) or the [MIT License](LICENSE-MIT), at your option.
data/test/data/go.mod CHANGED
@@ -1,6 +1,6 @@
1
1
  module github.com/maxmind/MaxMind-DB
2
2
 
3
- go 1.21
3
+ go 1.23
4
4
 
5
5
  require (
6
6
  github.com/maxmind/mmdbwriter v1.0.0