maxminddb 3.1.1__tar.gz → 3.3.0__tar.gz

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 (303) hide show
  1. {maxminddb-3.1.1 → maxminddb-3.3.0}/HISTORY.rst +123 -0
  2. {maxminddb-3.1.1/maxminddb.egg-info → maxminddb-3.3.0}/PKG-INFO +22 -13
  3. {maxminddb-3.1.1 → maxminddb-3.3.0}/README.rst +19 -10
  4. {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/index.rst +18 -0
  5. maxminddb-3.3.0/extension/libmaxminddb/.clang-format +6 -0
  6. maxminddb-3.3.0/extension/libmaxminddb/.github/dependabot.yml +22 -0
  7. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/clang-addresssanitizer.yml +28 -0
  8. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/clang-analyzer.yml +22 -0
  9. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/codeql-analysis.yml +46 -0
  10. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/dependabot-failure-watcher.yml +123 -0
  11. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/links.yml +32 -0
  12. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/pages.yml +54 -0
  13. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/precious.yml +24 -0
  14. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/test.yml +63 -0
  15. maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/zizmor.yml +23 -0
  16. maxminddb-3.3.0/extension/libmaxminddb/.gitignore +49 -0
  17. maxminddb-3.3.0/extension/libmaxminddb/.gitmodules +6 -0
  18. maxminddb-3.3.0/extension/libmaxminddb/.perltidyrc +11 -0
  19. maxminddb-3.3.0/extension/libmaxminddb/.precious.toml +24 -0
  20. maxminddb-3.3.0/extension/libmaxminddb/CMakeLists.txt +168 -0
  21. maxminddb-3.3.0/extension/libmaxminddb/Changes.md +544 -0
  22. maxminddb-3.3.0/extension/libmaxminddb/LICENSE +202 -0
  23. maxminddb-3.3.0/extension/libmaxminddb/Makefile.am +48 -0
  24. maxminddb-3.3.0/extension/libmaxminddb/NOTICE +13 -0
  25. maxminddb-3.3.0/extension/libmaxminddb/README.dev.md +74 -0
  26. maxminddb-3.3.0/extension/libmaxminddb/README.fuzzing.md +42 -0
  27. maxminddb-3.3.0/extension/libmaxminddb/README.md +164 -0
  28. maxminddb-3.3.0/extension/libmaxminddb/bin/CMakeLists.txt +24 -0
  29. maxminddb-3.3.0/extension/libmaxminddb/bin/Makefile.am +14 -0
  30. maxminddb-3.3.0/extension/libmaxminddb/bin/mmdblookup.c +790 -0
  31. maxminddb-3.3.0/extension/libmaxminddb/bootstrap +21 -0
  32. maxminddb-3.3.0/extension/libmaxminddb/c_flag_overrides.cmake +7 -0
  33. maxminddb-3.3.0/extension/libmaxminddb/cmake_uninstall.cmake.in +21 -0
  34. maxminddb-3.3.0/extension/libmaxminddb/common.mk +7 -0
  35. maxminddb-3.3.0/extension/libmaxminddb/configure.ac +138 -0
  36. maxminddb-3.3.0/extension/libmaxminddb/cxx_flag_overrides.cmake +6 -0
  37. maxminddb-3.3.0/extension/libmaxminddb/dev-bin/make-man-pages.pl +120 -0
  38. maxminddb-3.3.0/extension/libmaxminddb/dev-bin/ppa-release.sh +63 -0
  39. maxminddb-3.3.0/extension/libmaxminddb/dev-bin/release.sh +123 -0
  40. maxminddb-3.3.0/extension/libmaxminddb/dev-bin/valgrind-all.pl +53 -0
  41. maxminddb-3.3.0/extension/libmaxminddb/doc/libmaxminddb.md +955 -0
  42. maxminddb-3.3.0/extension/libmaxminddb/doc/mmdblookup.md +104 -0
  43. maxminddb-3.3.0/extension/libmaxminddb/docs/assets/css/main.css +189 -0
  44. maxminddb-3.3.0/extension/libmaxminddb/docs/hugo.toml +18 -0
  45. maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/404.html +24 -0
  46. maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/_default/_markup/render-heading.html +4 -0
  47. maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/_default/default.html +27 -0
  48. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/include/maxminddb.h +2 -0
  49. maxminddb-3.3.0/extension/libmaxminddb/include/maxminddb_config.h.cmake.in +14 -0
  50. maxminddb-3.3.0/extension/libmaxminddb/include/maxminddb_config.h.in +14 -0
  51. maxminddb-3.3.0/extension/libmaxminddb/lychee.toml +60 -0
  52. maxminddb-3.3.0/extension/libmaxminddb/mise.lock +399 -0
  53. maxminddb-3.3.0/extension/libmaxminddb/mise.toml +28 -0
  54. maxminddb-3.3.0/extension/libmaxminddb/src/Makefile.am +29 -0
  55. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/data-pool.c +28 -12
  56. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/data-pool.h +11 -7
  57. maxminddb-3.3.0/extension/libmaxminddb/src/libmaxminddb.pc.in +11 -0
  58. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/maxminddb.c +183 -37
  59. maxminddb-3.3.0/extension/libmaxminddb/t/CMakeLists.txt +72 -0
  60. maxminddb-3.3.0/extension/libmaxminddb/t/Makefile.am +39 -0
  61. maxminddb-3.3.0/extension/libmaxminddb/t/bad_data_size_t.c +78 -0
  62. maxminddb-3.3.0/extension/libmaxminddb/t/bad_databases_t.c +92 -0
  63. maxminddb-3.3.0/extension/libmaxminddb/t/bad_epoch_t.c +53 -0
  64. maxminddb-3.3.0/extension/libmaxminddb/t/bad_indent_t.c +64 -0
  65. maxminddb-3.3.0/extension/libmaxminddb/t/bad_pointers_t.c +60 -0
  66. maxminddb-3.3.0/extension/libmaxminddb/t/bad_search_tree_t.c +103 -0
  67. maxminddb-3.3.0/extension/libmaxminddb/t/basic_lookup_t.c +215 -0
  68. maxminddb-3.3.0/extension/libmaxminddb/t/compile_c++_t.pl +120 -0
  69. maxminddb-3.3.0/extension/libmaxminddb/t/data-pool-t.c +392 -0
  70. maxminddb-3.3.0/extension/libmaxminddb/t/data_entry_list_t.c +429 -0
  71. maxminddb-3.3.0/extension/libmaxminddb/t/data_types_t.c +533 -0
  72. maxminddb-3.3.0/extension/libmaxminddb/t/decoder_limits_t.pl +268 -0
  73. maxminddb-3.3.0/extension/libmaxminddb/t/double_close_t.c +47 -0
  74. maxminddb-3.3.0/extension/libmaxminddb/t/dump_t.c +99 -0
  75. maxminddb-3.3.0/extension/libmaxminddb/t/empty_container_metadata_t.c +43 -0
  76. maxminddb-3.3.0/extension/libmaxminddb/t/external_symbols_t.pl +114 -0
  77. maxminddb-3.3.0/extension/libmaxminddb/t/fuzz_mmdb.c +60 -0
  78. maxminddb-3.3.0/extension/libmaxminddb/t/gai_error_t.c +33 -0
  79. maxminddb-3.3.0/extension/libmaxminddb/t/get_value_pointer_bug_t.c +71 -0
  80. maxminddb-3.3.0/extension/libmaxminddb/t/get_value_t.c +404 -0
  81. maxminddb-3.3.0/extension/libmaxminddb/t/invalid_sockaddr_t.c +51 -0
  82. maxminddb-3.3.0/extension/libmaxminddb/t/ipv4_start_cache_t.c +36 -0
  83. maxminddb-3.3.0/extension/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c +48 -0
  84. maxminddb-3.3.0/extension/libmaxminddb/t/max_depth_t.c +117 -0
  85. maxminddb-3.3.0/extension/libmaxminddb/t/maxminddb_test_helper.c +282 -0
  86. maxminddb-3.3.0/extension/libmaxminddb/t/maxminddb_test_helper.h +75 -0
  87. maxminddb-3.3.0/extension/libmaxminddb/t/metadata_marker_t.c +23 -0
  88. maxminddb-3.3.0/extension/libmaxminddb/t/metadata_pointers_t.c +31 -0
  89. maxminddb-3.3.0/extension/libmaxminddb/t/metadata_t.c +271 -0
  90. maxminddb-3.3.0/extension/libmaxminddb/t/mmdblookup_t.pl +158 -0
  91. maxminddb-3.3.0/extension/libmaxminddb/t/no_map_get_value_t.c +34 -0
  92. maxminddb-3.3.0/extension/libmaxminddb/t/overflow_bounds_t.c +67 -0
  93. maxminddb-3.3.0/extension/libmaxminddb/t/pointer_dos_t.c +238 -0
  94. maxminddb-3.3.0/extension/libmaxminddb/t/read_node_t.c +298 -0
  95. maxminddb-3.3.0/extension/libmaxminddb/t/threads_t.c +207 -0
  96. maxminddb-3.3.0/extension/libmaxminddb/t/version_t.c +9 -0
  97. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/maxminddb.c +379 -118
  98. maxminddb-3.3.0/lychee.toml +67 -0
  99. maxminddb-3.3.0/maxminddb/__init__.py +113 -0
  100. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/const.py +5 -2
  101. maxminddb-3.3.0/maxminddb/decoder.py +430 -0
  102. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/extension.pyi +27 -9
  103. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/file.py +26 -6
  104. maxminddb-3.3.0/maxminddb/reader.py +646 -0
  105. maxminddb-3.3.0/maxminddb/types.py +38 -0
  106. {maxminddb-3.1.1 → maxminddb-3.3.0/maxminddb.egg-info}/PKG-INFO +22 -13
  107. maxminddb-3.3.0/maxminddb.egg-info/SOURCES.txt +266 -0
  108. maxminddb-3.3.0/mise.lock +69 -0
  109. maxminddb-3.3.0/mise.toml +10 -0
  110. {maxminddb-3.1.1 → maxminddb-3.3.0}/pyproject.toml +16 -4
  111. maxminddb-3.3.0/tests/__init__.py +0 -0
  112. maxminddb-3.3.0/tests/data/.gitattributes +1 -0
  113. maxminddb-3.3.0/tests/data/.gitconfig +2 -0
  114. maxminddb-3.3.0/tests/data/.github/dependabot.yml +23 -0
  115. maxminddb-3.3.0/tests/data/.github/workflows/check-untagged-deps.yml +20 -0
  116. maxminddb-3.3.0/tests/data/.github/workflows/codeql-analysis.yml +45 -0
  117. maxminddb-3.3.0/tests/data/.github/workflows/dependabot-failure-watcher.yml +123 -0
  118. maxminddb-3.3.0/tests/data/.github/workflows/go.yml +42 -0
  119. maxminddb-3.3.0/tests/data/.github/workflows/links.yml +32 -0
  120. maxminddb-3.3.0/tests/data/.github/workflows/pages.yml +54 -0
  121. maxminddb-3.3.0/tests/data/.github/workflows/precious.yml +24 -0
  122. maxminddb-3.3.0/tests/data/.github/workflows/zizmor.yml +23 -0
  123. maxminddb-3.3.0/tests/data/.gitignore +6 -0
  124. maxminddb-3.3.0/tests/data/.golangci.yml +760 -0
  125. maxminddb-3.3.0/tests/data/.precious.toml +39 -0
  126. maxminddb-3.3.0/tests/data/LICENSE-APACHE +202 -0
  127. maxminddb-3.3.0/tests/data/LICENSE-MIT +17 -0
  128. maxminddb-3.3.0/tests/data/MaxMind-DB-spec.md +711 -0
  129. maxminddb-3.3.0/tests/data/README.md +39 -0
  130. maxminddb-3.3.0/tests/data/bad-data/README.md +29 -0
  131. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-corrupt-search-tree.mmdb +0 -0
  132. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-deep-array-nesting.mmdb +0 -0
  133. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-deep-nesting.mmdb +0 -0
  134. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-empty-array-last-in-metadata.mmdb +0 -0
  135. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-empty-map-last-in-metadata.mmdb +0 -0
  136. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-metadata-marker-only.mmdb +1 -0
  137. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-oversized-array.mmdb +0 -0
  138. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-oversized-map.mmdb +0 -0
  139. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-description-key.mmdb +0 -0
  140. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-metadata-key.mmdb +0 -0
  141. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-node-count.mmdb +0 -0
  142. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-pointer-key.mmdb +0 -0
  143. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-max-left.mmdb +0 -0
  144. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-min-left.mmdb +0 -0
  145. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-min-right.mmdb +0 -0
  146. maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-uint64-max-epoch.mmdb +0 -0
  147. maxminddb-3.3.0/tests/data/cmd/write-test-data/main.go +144 -0
  148. maxminddb-3.3.0/tests/data/docs/assets/css/main.css +189 -0
  149. maxminddb-3.3.0/tests/data/docs/hugo.toml +10 -0
  150. maxminddb-3.3.0/tests/data/docs/layouts/404.html +24 -0
  151. maxminddb-3.3.0/tests/data/docs/layouts/_default/_markup/render-heading.html +4 -0
  152. maxminddb-3.3.0/tests/data/docs/layouts/_default/default.html +20 -0
  153. maxminddb-3.3.0/tests/data/go.mod +11 -0
  154. maxminddb-3.3.0/tests/data/go.sum +12 -0
  155. maxminddb-3.3.0/tests/data/lychee.toml +54 -0
  156. maxminddb-3.3.0/tests/data/mise.lock +214 -0
  157. maxminddb-3.3.0/tests/data/mise.toml +34 -0
  158. maxminddb-3.3.0/tests/data/pkg/writer/baddata.go +171 -0
  159. maxminddb-3.3.0/tests/data/pkg/writer/decoder.go +161 -0
  160. maxminddb-3.3.0/tests/data/pkg/writer/fixtures_test.go +165 -0
  161. maxminddb-3.3.0/tests/data/pkg/writer/geoip2.go +216 -0
  162. maxminddb-3.3.0/tests/data/pkg/writer/geoip2_test.go +237 -0
  163. maxminddb-3.3.0/tests/data/pkg/writer/ip.go +39 -0
  164. maxminddb-3.3.0/tests/data/pkg/writer/maxmind.go +246 -0
  165. maxminddb-3.3.0/tests/data/pkg/writer/nestedstructures.go +72 -0
  166. maxminddb-3.3.0/tests/data/pkg/writer/pointerdos.go +502 -0
  167. maxminddb-3.3.0/tests/data/pkg/writer/pointerdos_test.go +597 -0
  168. maxminddb-3.3.0/tests/data/pkg/writer/rawmmdb.go +589 -0
  169. maxminddb-3.3.0/tests/data/pkg/writer/rawmmdb_test.go +199 -0
  170. maxminddb-3.3.0/tests/data/pkg/writer/writer.go +65 -0
  171. maxminddb-3.3.0/tests/data/source-data/GeoIP-Anonymous-Plus-Test.json +205 -0
  172. maxminddb-3.3.0/tests/data/source-data/GeoIP-Regions-Test.json +474 -0
  173. maxminddb-3.3.0/tests/data/source-data/GeoIP-Residential-Proxy-Test.json +204 -0
  174. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Anonymous-IP-Test.json +79 -0
  175. maxminddb-3.3.0/tests/data/source-data/GeoIP2-City-Test.json +13434 -0
  176. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Connection-Type-Test.json +127 -0
  177. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Country-Test.json +17735 -0
  178. maxminddb-3.3.0/tests/data/source-data/GeoIP2-DensityIncome-Test.json +14 -0
  179. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Domain-Test.json +457 -0
  180. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Enterprise-Test.json +4576 -0
  181. maxminddb-3.3.0/tests/data/source-data/GeoIP2-IP-Risk-Test.json +111 -0
  182. maxminddb-3.3.0/tests/data/source-data/GeoIP2-ISP-Test.json +12605 -0
  183. maxminddb-3.3.0/tests/data/source-data/GeoIP2-Static-IP-Score-Test.json +2147 -0
  184. maxminddb-3.3.0/tests/data/source-data/GeoIP2-User-Count-Test.json +2855 -0
  185. maxminddb-3.3.0/tests/data/source-data/GeoLite2-ASN-Test.json +4120 -0
  186. maxminddb-3.3.0/tests/data/source-data/GeoLite2-City-Test.json +12993 -0
  187. maxminddb-3.3.0/tests/data/source-data/GeoLite2-Country-Test.json +11369 -0
  188. maxminddb-3.3.0/tests/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb +0 -0
  189. maxminddb-3.3.0/tests/data/test-data/GeoIP-Regions-Test.mmdb +0 -0
  190. maxminddb-3.3.0/tests/data/test-data/GeoIP-Residential-Proxy-Test.mmdb +0 -0
  191. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  192. maxminddb-3.3.0/tests/data/test-data/GeoIP2-City-Shield-Test.mmdb +0 -0
  193. maxminddb-3.3.0/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  194. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  195. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Country-Shield-Test.mmdb +0 -0
  196. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  197. maxminddb-3.3.0/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
  198. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  199. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Enterprise-Shield-Test.mmdb +0 -0
  200. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  201. maxminddb-3.3.0/tests/data/test-data/GeoIP2-IP-Risk-Test.mmdb +0 -0
  202. maxminddb-3.3.0/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  203. maxminddb-3.3.0/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
  204. maxminddb-3.3.0/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
  205. maxminddb-3.3.0/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
  206. maxminddb-3.3.0/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
  207. maxminddb-3.3.0/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
  208. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
  209. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  210. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decode-path-shared-budget.mmdb +0 -0
  211. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-payload-limit-over.mmdb +0 -0
  212. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-payload-limit.mmdb +0 -0
  213. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit-over.mmdb +0 -0
  214. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit-pointer-heavy.mmdb +0 -0
  215. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit.mmdb +0 -0
  216. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  217. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  218. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  219. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  220. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  221. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  222. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  223. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-metadata-payload-limit.mmdb +0 -0
  224. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  225. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  226. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  227. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  228. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  229. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos-string.mmdb +0 -0
  230. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos-worst-case.mmdb +0 -0
  231. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos.mmdb +0 -0
  232. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-pointer-decoder-dos-ipv6.mmdb +0 -0
  233. maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-pointer-decoder-dos.mmdb +0 -0
  234. maxminddb-3.3.0/tests/data/test-data/README.md +122 -0
  235. maxminddb-3.3.0/tests/decoder_test.py +662 -0
  236. maxminddb-3.3.0/tests/reader_test.py +2405 -0
  237. maxminddb-3.3.0/tests/typing_test.py +52 -0
  238. maxminddb-3.3.0/uv.lock +618 -0
  239. maxminddb-3.1.1/maxminddb/__init__.py +0 -91
  240. maxminddb-3.1.1/maxminddb/decoder.py +0 -214
  241. maxminddb-3.1.1/maxminddb/reader.py +0 -360
  242. maxminddb-3.1.1/maxminddb/types.py +0 -15
  243. maxminddb-3.1.1/maxminddb.egg-info/SOURCES.txt +0 -78
  244. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  245. maxminddb-3.1.1/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  246. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  247. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  248. maxminddb-3.1.1/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
  249. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  250. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  251. maxminddb-3.1.1/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  252. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
  253. maxminddb-3.1.1/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
  254. maxminddb-3.1.1/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
  255. maxminddb-3.1.1/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
  256. maxminddb-3.1.1/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
  257. maxminddb-3.1.1/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
  258. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  259. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  260. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  261. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  262. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  263. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  264. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  265. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  266. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  267. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  268. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  269. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  270. maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  271. maxminddb-3.1.1/tests/decoder_test.py +0 -234
  272. maxminddb-3.1.1/tests/reader_test.py +0 -745
  273. maxminddb-3.1.1/uv.lock +0 -466
  274. {maxminddb-3.1.1 → maxminddb-3.3.0}/LICENSE +0 -0
  275. {maxminddb-3.1.1 → maxminddb-3.3.0}/MANIFEST.in +0 -0
  276. {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/Makefile +0 -0
  277. {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/conf.py +0 -0
  278. {maxminddb-3.1.1 → maxminddb-3.3.0}/examples/benchmark.py +0 -0
  279. /maxminddb-3.1.1/maxminddb/py.typed → /maxminddb-3.3.0/extension/libmaxminddb/AUTHORS +0 -0
  280. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/maxminddb-compat-util.h +0 -0
  281. {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/maxminddb_config.h +0 -0
  282. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/errors.py +0 -0
  283. /maxminddb-3.1.1/tests/__init__.py → /maxminddb-3.3.0/maxminddb/py.typed +0 -0
  284. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb.egg-info/dependency_links.txt +0 -0
  285. {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb.egg-info/top_level.txt +0 -0
  286. {maxminddb-3.1.1 → maxminddb-3.3.0}/setup.cfg +0 -0
  287. {maxminddb-3.1.1 → maxminddb-3.3.0}/setup.py +0 -0
  288. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/libmaxminddb/libmaxminddb-offset-integer-overflow.mmdb +0 -0
  289. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/cyclic-data-structure.mmdb +0 -0
  290. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-bytes-length.mmdb +0 -0
  291. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-data-record-offset.mmdb +0 -0
  292. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-map-key-length.mmdb +0 -0
  293. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-string-length.mmdb +0 -0
  294. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb +0 -0
  295. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb +0 -0
  296. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb +0 -0
  297. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
  298. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
  299. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
  300. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
  301. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb +0 -0
  302. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/maps-with-pointers.raw +0 -0
  303. {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/threading_test.py +0 -0
@@ -3,6 +3,129 @@
3
3
  History
4
4
  -------
5
5
 
6
+ 3.3.0 (2026-11-17)
7
+ ++++++++++++++++++
8
+
9
+ * Fixed iteration over an IPv6 database with a network shorter than /96
10
+ whose first bits are zero, such as ``::/1``. The readers raised
11
+ ``ValueError`` or skipped networks. The pure Python reader also raised
12
+ ``ValueError`` for a network that starts at ``::1:0:0``, such as
13
+ ``::1:0:0/96``.
14
+ * The pure Python reader now raises ``InvalidDatabaseError`` for a search tree
15
+ record that points before the data section. Previously, it returned an
16
+ empty map.
17
+ * Iterating over a database with a corrupt search tree, such as one with a
18
+ cycle, now raises ``InvalidDatabaseError``. Previously, the C extension
19
+ could corrupt memory, and the pure Python reader raised ``RecursionError``
20
+ or returned part of the networks.
21
+ * A second ``__init__`` on a pure Python ``Reader`` now closes the old
22
+ database, and an iterator from before it raises ``ValueError``, as in the
23
+ C extension. Before, the iterator walked the new database with node
24
+ numbers from the old one. A failed ``__init__`` keeps the old database.
25
+ After ``close()``, an iterator raises ``ValueError`` in every mode.
26
+ * The pure Python reader now raises ``InvalidDatabaseError`` when a value,
27
+ search tree record or pointer goes past the end of the data section, or when
28
+ the search tree overlaps the metadata. Previously, it could return a shorter
29
+ or wrong value, or decode bytes from the metadata section.
30
+ * The pure Python reader now raises ``InvalidDatabaseError`` when a record map
31
+ key is not a string, as the C extension does. Previously, it returned the
32
+ non-string key or raised ``TypeError``.
33
+ * The pure Python reader now raises ``InvalidDatabaseError`` for extended type
34
+ byte 0. Previously, it decoded the value as a map. The C extension still
35
+ decodes it as a map, because libmaxminddb does not check this byte.
36
+ * An empty database file now raises ``InvalidDatabaseError`` in ``MODE_FILE``,
37
+ as in ``MODE_MEMORY``. Previously, it raised ``OSError`` on platforms with
38
+ ``os.pread``.
39
+ * C extension:
40
+
41
+ * Fixed segmentation faults from invalid use of ``Metadata``, ``Reader`` and
42
+ the internal iterator type.
43
+ * Fixed a segmentation fault on a database with a map key that is not a
44
+ string. Such a database now raises ``InvalidDatabaseError``.
45
+ * Fixed large ``uint32`` values, which came back negative on platforms
46
+ with a 32-bit C ``long``, such as Windows.
47
+ * Fixed memory leaks and a use-after-free. A second ``__init__`` on a
48
+ ``Reader`` now closes the old database, and an iterator from before it
49
+ raises ``ValueError``. A failed ``__init__`` keeps the old database.
50
+ Reinitializing a ``Metadata`` changes nothing.
51
+ * Fixed a ``RuntimeWarning`` or ``RuntimeError`` on free-threaded Python on
52
+ macOS when a ``Reader`` failed to open or was used without ``__init__``.
53
+ * Fixed a deadlock on free-threaded Python when a ``Reader`` was closed
54
+ during iteration, from another thread or from a signal handler.
55
+ * Fixed a crash on free-threaded Python when two threads advanced the same
56
+ iterator.
57
+ * An exhausted iterator now raises ``StopIteration`` after its ``Reader``
58
+ closes, not ``ValueError``.
59
+ * The iterator now stops after an error, as the pure Python iterator does.
60
+ This includes an error in the data of one record, but not a failure to
61
+ get the read lock. Previously, the next call returned the remaining
62
+ networks.
63
+ * Added the ``node_byte_size`` and ``search_tree_size`` properties to
64
+ ``Metadata``, as the pure Python ``Metadata`` has.
65
+
66
+ * Metadata:
67
+
68
+ * The pure Python reader ignores unknown keys, which a new minor version of
69
+ the format can add, if their values decode. Previously, an unknown key
70
+ raised ``TypeError``. It raises ``InvalidDatabaseError`` for a missing key,
71
+ a key that is not a string, a value that is not of the expected Python
72
+ type or is out of range, an invalid ``ip_version`` or format version, a
73
+ ``build_epoch`` of 0, or a string that is not UTF-8 anywhere in the
74
+ metadata. Previously, the reader opened most of these files, and some
75
+ raised ``TypeError`` or ``UnicodeDecodeError``.
76
+ * The C extension ignores unknown keys unless a value cannot be decoded,
77
+ such as a map with a key that is not a string. Previously,
78
+ ``Reader.metadata()`` crashed with a segmentation fault on any unknown
79
+ key.
80
+ * For a metadata string that is not UTF-8, the ``InvalidDatabaseError``
81
+ from the C ``Reader.metadata()`` has the ``UnicodeDecodeError`` as its
82
+ cause.
83
+
84
+ * Added ``maxminddb.Mode``, which the README already described.
85
+ * Type checkers now reject a subscript of ``maxminddb.types.Record`` or
86
+ ``Primitive``, such as ``Record[str]``. The subscript still works at
87
+ runtime. Pull request by Adam Hitchcock. GitHub #464.
88
+
89
+ * Type hints:
90
+
91
+ * ``Primitive`` includes ``bytearray``, which the C extension returns for
92
+ the ``bytes`` type.
93
+ * ``Reader.__iter__`` declares its item type.
94
+ * Added the ``StrOrBytesPath`` and ``DatabaseSource`` aliases to
95
+ ``maxminddb.types``.
96
+ * The ``maxminddb.extension.Reader`` stub accepts only a path, as the
97
+ extension does.
98
+ * ``MODE_FD`` accepts any object whose ``read()`` method returns ``bytes``,
99
+ such as a ``gzip.GzipFile``. ``maxminddb.types.SupportsRead`` describes
100
+ this type.
101
+
102
+ * ``MODE_AUTO`` now accepts a binary file object. Previously, it raised
103
+ ``TypeError``. It reads the file object into memory with the pure Python
104
+ reader, as ``MODE_FD`` does. The C extension needs a path, so lookups are
105
+ slower than with a path when the extension is installed.
106
+ * The pure Python reader raises ``TypeError`` when the database argument does
107
+ not suit the mode.
108
+ * Updated the vendored libmaxminddb to 1.14.1. This fixes a build failure
109
+ with ``-Werror`` on platforms where ``ssize_t`` is 32 bits, such as i686.
110
+
111
+ 3.2.0 (2026-09-10)
112
+ ++++++++++++++++++
113
+
114
+ * Added limits to pure Python record and metadata decoding to prevent denial
115
+ of service from crafted databases: 65,536 values, 512 nesting levels, and
116
+ 2 MiB of string and bytes payload. Exceeding a limit raises
117
+ ``InvalidDatabaseError``. CPython may reach its recursion limit earlier,
118
+ which raises the same error.
119
+ * Rejected unsigned integers longer than 16 bytes and signed integers longer
120
+ than 4 bytes before reading their payload.
121
+ * Updated the vendored libmaxminddb to 1.14.0, which adds the same resource
122
+ limits to the C extension.
123
+ * Truncated reads that previously raised ``IndexError`` or ``struct.error``
124
+ now raise ``InvalidDatabaseError``.
125
+ * The pure Python reader now rejects invalid search tree sizes when opening
126
+ a database.
127
+ * Improved pure Python lookup performance.
128
+
6
129
  3.1.1 (2026-03-05)
7
130
  ++++++++++++++++++
8
131
 
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maxminddb
3
- Version: 3.1.1
3
+ Version: 3.3.0
4
4
  Summary: Reader for the MaxMind DB format
5
5
  Author-email: Gregory Oschwald <goschwald@maxmind.com>
6
6
  License-Expression: Apache-2.0
7
- Project-URL: Homepage, https://www.maxmind.com/
8
- Project-URL: Documentation, https://maxminddb.readthedocs.org/
7
+ Project-URL: Homepage, https://www.maxmind.com/en/home
8
+ Project-URL: Documentation, https://maxminddb.readthedocs.io/en/latest/
9
9
  Project-URL: Source Code, https://github.com/maxmind/MaxMind-DB-Reader-python
10
10
  Project-URL: Issue Tracker, https://github.com/maxmind/MaxMind-DB-Reader-python/issues
11
11
  Classifier: Development Status :: 5 - Production/Stable
@@ -62,12 +62,12 @@ Usage
62
62
  -----
63
63
 
64
64
  To use this module, you must first download or create a MaxMind DB file. We
65
- provide `free GeoLite2 databases
66
- <https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en>`_. These
65
+ provide `free GeoLite databases
66
+ <https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=en>`_. These
67
67
  files must be decompressed with ``gunzip``.
68
68
 
69
69
  After you have obtained a database and imported the module, call
70
- ``open_database`` with a path, or file descriptor (in the case of ``Mode.FD``),
70
+ ``open_database`` with a path, or binary file object (with ``Mode.FD`` or ``Mode.AUTO``),
71
71
  to the database as the first argument. Optionally, you may pass a mode as the
72
72
  second argument. The modes are available from ``maxminddb.Mode``. Valid modes are:
73
73
 
@@ -75,18 +75,21 @@ second argument. The modes are available from ``maxminddb.Mode``. Valid modes ar
75
75
  * ``Mode.MMAP`` - read from memory map. Pure Python.
76
76
  * ``Mode.FILE`` - read database as standard file. Pure Python.
77
77
  * ``Mode.MEMORY`` - load database into memory. Pure Python.
78
- * ``Mode.FD`` - load database into memory from a file descriptor. Pure Python.
78
+ * ``Mode.FD`` - load database into memory from a binary file object. Pure Python.
79
79
  * ``Mode.AUTO`` - try ``Mode.MMAP_EXT``, ``Mode.MMAP``, ``Mode.FILE`` in that
80
- order. Default.
80
+ order. A file object is read into memory with the pure Python reader, as
81
+ with ``Mode.FD``. Pass a path to use the faster C extension. Default.
81
82
 
82
- **NOTE**: When using ``Mode.FD``, it is the *caller's* responsibility to be
83
- sure that the file descriptor gets closed properly. The caller may close the
84
- file descriptor immediately after the ``Reader`` object is created.
83
+ **NOTE**: When using a file object, it is the *caller's* responsibility to be
84
+ sure that the file object gets closed properly. The caller may close the
85
+ file object immediately after the ``Reader`` object is created. The pure
86
+ Python reader closes a file descriptor that you pass to it. This includes
87
+ ``Mode.AUTO`` when the C extension is not installed.
85
88
 
86
89
  The ``open_database`` function returns a ``Reader`` object. To look up an IP
87
90
  address, use the ``get`` method on this object. The method will return the
88
91
  corresponding values for the IP address from the database (e.g., a dictionary
89
- for GeoIP2/GeoLite2 databases). If the database does not contain a record for
92
+ for GeoIP/GeoLite databases). If the database does not contain a record for
90
93
  that IP address, the method will return ``None``.
91
94
 
92
95
  If you wish to also retrieve the prefix length for the record, use the
@@ -122,6 +125,11 @@ The module will return an ``InvalidDatabaseError`` if the database is corrupt
122
125
  or otherwise invalid. A ``ValueError`` will be thrown if you look up an
123
126
  invalid IP address or an IPv6 address in an IPv4 database.
124
127
 
128
+ The reader also raises ``InvalidDatabaseError`` when one record, or the
129
+ database metadata, exceeds its resource limits: 65,536 decoded values, 512
130
+ levels of nesting, or 2 MiB of string and bytes data. Real databases stay far
131
+ below these limits. Python's recursion limit may stop decoding sooner.
132
+
125
133
  Thread Safety
126
134
  -------------
127
135
 
@@ -144,5 +152,6 @@ Please report all issues with this code using the `GitHub issue tracker
144
152
  <https://github.com/maxmind/MaxMind-DB-Reader-python/issues>`_
145
153
 
146
154
  If you are having an issue with a MaxMind service that is not specific to this
147
- API, please contact `MaxMind support <https://www.maxmind.com/en/support>`_ for
155
+ API, please contact `MaxMind support
156
+ <https://support.maxmind.com/knowledge-base>`_ for
148
157
  assistance.
@@ -34,12 +34,12 @@ Usage
34
34
  -----
35
35
 
36
36
  To use this module, you must first download or create a MaxMind DB file. We
37
- provide `free GeoLite2 databases
38
- <https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en>`_. These
37
+ provide `free GeoLite databases
38
+ <https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=en>`_. These
39
39
  files must be decompressed with ``gunzip``.
40
40
 
41
41
  After you have obtained a database and imported the module, call
42
- ``open_database`` with a path, or file descriptor (in the case of ``Mode.FD``),
42
+ ``open_database`` with a path, or binary file object (with ``Mode.FD`` or ``Mode.AUTO``),
43
43
  to the database as the first argument. Optionally, you may pass a mode as the
44
44
  second argument. The modes are available from ``maxminddb.Mode``. Valid modes are:
45
45
 
@@ -47,18 +47,21 @@ second argument. The modes are available from ``maxminddb.Mode``. Valid modes ar
47
47
  * ``Mode.MMAP`` - read from memory map. Pure Python.
48
48
  * ``Mode.FILE`` - read database as standard file. Pure Python.
49
49
  * ``Mode.MEMORY`` - load database into memory. Pure Python.
50
- * ``Mode.FD`` - load database into memory from a file descriptor. Pure Python.
50
+ * ``Mode.FD`` - load database into memory from a binary file object. Pure Python.
51
51
  * ``Mode.AUTO`` - try ``Mode.MMAP_EXT``, ``Mode.MMAP``, ``Mode.FILE`` in that
52
- order. Default.
52
+ order. A file object is read into memory with the pure Python reader, as
53
+ with ``Mode.FD``. Pass a path to use the faster C extension. Default.
53
54
 
54
- **NOTE**: When using ``Mode.FD``, it is the *caller's* responsibility to be
55
- sure that the file descriptor gets closed properly. The caller may close the
56
- file descriptor immediately after the ``Reader`` object is created.
55
+ **NOTE**: When using a file object, it is the *caller's* responsibility to be
56
+ sure that the file object gets closed properly. The caller may close the
57
+ file object immediately after the ``Reader`` object is created. The pure
58
+ Python reader closes a file descriptor that you pass to it. This includes
59
+ ``Mode.AUTO`` when the C extension is not installed.
57
60
 
58
61
  The ``open_database`` function returns a ``Reader`` object. To look up an IP
59
62
  address, use the ``get`` method on this object. The method will return the
60
63
  corresponding values for the IP address from the database (e.g., a dictionary
61
- for GeoIP2/GeoLite2 databases). If the database does not contain a record for
64
+ for GeoIP/GeoLite databases). If the database does not contain a record for
62
65
  that IP address, the method will return ``None``.
63
66
 
64
67
  If you wish to also retrieve the prefix length for the record, use the
@@ -94,6 +97,11 @@ The module will return an ``InvalidDatabaseError`` if the database is corrupt
94
97
  or otherwise invalid. A ``ValueError`` will be thrown if you look up an
95
98
  invalid IP address or an IPv6 address in an IPv4 database.
96
99
 
100
+ The reader also raises ``InvalidDatabaseError`` when one record, or the
101
+ database metadata, exceeds its resource limits: 65,536 decoded values, 512
102
+ levels of nesting, or 2 MiB of string and bytes data. Real databases stay far
103
+ below these limits. Python's recursion limit may stop decoding sooner.
104
+
97
105
  Thread Safety
98
106
  -------------
99
107
 
@@ -116,5 +124,6 @@ Please report all issues with this code using the `GitHub issue tracker
116
124
  <https://github.com/maxmind/MaxMind-DB-Reader-python/issues>`_
117
125
 
118
126
  If you are having an issue with a MaxMind service that is not specific to this
119
- API, please contact `MaxMind support <https://www.maxmind.com/en/support>`_ for
127
+ API, please contact `MaxMind support
128
+ <https://support.maxmind.com/knowledge-base>`_ for
120
129
  assistance.
@@ -35,6 +35,24 @@ Database Reader
35
35
  :undoc-members:
36
36
  :show-inheritance:
37
37
 
38
+ =====
39
+ Types
40
+ =====
41
+
42
+ .. automodule:: maxminddb.types
43
+ :members:
44
+ :undoc-members:
45
+ :exclude-members: Primitive, Record
46
+
47
+ .. The runtime values of these aliases contain AnyStr, so give the types that
48
+ type checkers see.
49
+
50
+ .. autodata:: maxminddb.types.Primitive
51
+ :annotation: = str | bytes | bytearray | bool | float | int
52
+
53
+ .. autodata:: maxminddb.types.Record
54
+ :annotation: = Primitive | RecordList | RecordDict
55
+
38
56
  ==================
39
57
  Indices and tables
40
58
  ==================
@@ -0,0 +1,6 @@
1
+ BasedOnStyle: LLVM
2
+ IndentWidth: 4
3
+ BinPackArguments: false
4
+ BinPackParameters: false
5
+ IndentCaseLabels: true
6
+ IndentPPDirectives: BeforeHash
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ time: '14:00'
9
+ groups:
10
+ codeql:
11
+ patterns:
12
+ - github/codeql-action*
13
+ cooldown:
14
+ default-days: 7
15
+ - package-ecosystem: gitsubmodule
16
+ directory: /
17
+ schedule:
18
+ interval: weekly
19
+ day: monday
20
+ time: '14:00'
21
+ cooldown:
22
+ default-days: 7
@@ -0,0 +1,28 @@
1
+ name: Run Clang AddressSanitizer
2
+ on:
3
+ push:
4
+ pull_request:
5
+ schedule:
6
+ - cron: '13 20 * * SUN'
7
+ permissions: {}
8
+ jobs:
9
+ addresssanitizer:
10
+ name: Clang AddressSanitizer
11
+ runs-on: ubuntu-latest
12
+ env:
13
+ ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_invalid_pointer_pairs=2
14
+ CC: clang
15
+ CXX: clang++
16
+ CFLAGS: -fsanitize=address -Wall -Wextra -Wpedantic -Wformat=2 -Walloca -Wvla -Wimplicit-fallthrough -Wcast-qual -Wconversion -Wshadow -Wundef -Wstrict-prototypes -Wswitch-enum -fstack-protector -D_FORTIFY_SOURCE=2
17
+ CXXFLAGS: -fsanitize=address
18
+ LDFLAGS: -fsanitize=address
19
+ steps:
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ submodules: true
23
+ persist-credentials: false
24
+ - run: sudo apt install clang libipc-run3-perl
25
+ - run: ./bootstrap
26
+ - run: ./configure
27
+ - run: make
28
+ - run: make check
@@ -0,0 +1,22 @@
1
+ name: Run Clang Static Analysis
2
+ on:
3
+ push:
4
+ pull_request:
5
+ schedule:
6
+ - cron: '3 20 * * SUN'
7
+ permissions: {}
8
+ jobs:
9
+ clang-analyzer:
10
+ name: Clang static analysis
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14
+ with:
15
+ persist-credentials: false
16
+ - run: sudo apt install clang-tools libipc-run3-perl
17
+ - run: ./bootstrap
18
+ - run: scan-build ./configure
19
+ env:
20
+ CFLAGS: -std=c99 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter
21
+ - run: cd src; scan-build --status-bugs make; cd ..
22
+ - run: cd bin; scan-build --status-bugs make; cd ..
@@ -0,0 +1,46 @@
1
+ name: "Code scanning - action"
2
+
3
+ on:
4
+ push:
5
+ branches-ignore:
6
+ - 'dependabot/**'
7
+ pull_request:
8
+ schedule:
9
+ - cron: '0 7 * * 2'
10
+
11
+ jobs:
12
+ CodeQL-Build:
13
+
14
+ runs-on: ubuntu-latest
15
+
16
+ permissions:
17
+ security-events: write
18
+
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ # We must fetch at least the immediate parents so that if this is
24
+ # a pull request then we can checkout the head.
25
+ fetch-depth: 2
26
+ submodules: true
27
+ persist-credentials: false
28
+
29
+ # If this run was triggered by a pull request event, then checkout
30
+ # the head of the pull request instead of the merge commit.
31
+ - run: git checkout HEAD^2
32
+ if: ${{ github.event_name == 'pull_request' }}
33
+
34
+ # Initializes the CodeQL tools for scanning.
35
+ - name: Initialize CodeQL
36
+ uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
37
+
38
+ - run: sudo apt install libipc-run3-perl pandoc
39
+ - run: |
40
+ ./bootstrap
41
+ ./configure
42
+ make
43
+ make safedist
44
+
45
+ - name: Perform CodeQL Analysis
46
+ uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
@@ -0,0 +1,123 @@
1
+ name: Dependabot Failure Watcher
2
+
3
+ # Dependabot version updates run as GitHub Actions workflow runs named
4
+ # "Dependabot Updates". This scheduled job looks back over the past week for any
5
+ # version-update run that failed and fails itself if it finds one, so a
6
+ # silently-broken ecosystem surfaces as a red scheduled run instead of only a red
7
+ # triangle in the Dependabot tab that nobody checks. Security-update runs share
8
+ # that workflow name and are deliberately excluded -- see below.
9
+ #
10
+ # GitHub reuses the "Dependabot Updates" name for three different kinds of run:
11
+ #
12
+ # 1. A version update's scheduled scan: one run per .github/dependabot.yml
13
+ # entry, on the schedule set there. It works out what is out of date and
14
+ # opens or updates pull requests. This is the kind this watcher primarily
15
+ # exists to catch -- when a scan breaks, the whole ecosystem quietly stops
16
+ # being updated and nothing else tells anyone.
17
+ # 2. A version update's per-pull-request refresh: one run per already-open
18
+ # Dependabot pull request, rebasing or re-checking it. These are not driven
19
+ # by the schedule at all -- a push to the base branch, a rebase, or an
20
+ # "@dependabot recreate" comment triggers them, so they arrive in bursts
21
+ # after merges rather than at the scheduled time. A failure here means one
22
+ # open pull request has gone stale, which is worth knowing but is much
23
+ # narrower than a broken scan.
24
+ # 3. A security update: one ad-hoc job per vulnerable package, triggered by a
25
+ # Dependabot alert rather than by dependabot.yml at all.
26
+ #
27
+ # Kind 3 routinely fails for reasons no pull request can fix: the advisory is
28
+ # against a dependency this project does not declare directly, or no patched
29
+ # version is reachable. Counting those would keep this workflow permanently red
30
+ # and train everyone to ignore it, so they are filtered out below.
31
+ #
32
+ # Of the fields "gh run list --json" exposes, only the title separates the three
33
+ # -- event, headBranch and actor are identical. Titles come in these shapes:
34
+ #
35
+ # - "<eco> in /." -- kind 1 at the repo root, which
36
+ # has no " for " suffix
37
+ # - "<eco> in <configured-dir>" -- kind 1 elsewhere, path verbatim
38
+ # - "<eco> in / for <deps>" -- kind 2 at the repo root
39
+ # - "<eco> in <configured-dir> for <deps>" -- kind 2 elsewhere
40
+ # - "<eco> in /. for <one-dep>" -- kind 3 at the repo root
41
+ # - "<eco> in <manifest-dir> for <one-dep>" -- kind 3 elsewhere, where
42
+ # <manifest-dir> is wherever the vulnerable manifest was discovered
43
+ #
44
+ # At the root, then, kind 3 is marked by "/." AND a " for " suffix together, and
45
+ # BOTH HALVES of " in /. for " are load-bearing -- do not shorten it. Matching on
46
+ # " in /." alone would also discard every kind 1 run, which is most of the runs
47
+ # here and the shape both failures this watcher was written for actually took.
48
+ #
49
+ # Outside the root, kinds 2 and 3 cannot be told apart by title, so the filter
50
+ # has to name directories instead. e2e/js and e2e/ts (in the Node repos this
51
+ # workflow is shared with) are consumer smoke tests carrying committed
52
+ # lockfiles, so their transitive dev dependencies attract advisories that no
53
+ # pull request can fix, and nothing in them is shipped code.
54
+ #
55
+ # Be clear about the cost, because it is not zero: both Node repos configure npm
56
+ # with directories: ["/", "**/*"], and that glob does match e2e/js and e2e/ts,
57
+ # so those directories DO get version updates. Dropping the pattern therefore
58
+ # discards their kind 2 failures as well as their kind 3 ones -- there is an
59
+ # open version-update pull request under e2e/ts in both repos as this is
60
+ # written. The npm ecosystem label does not rescue the distinction either:
61
+ # Dependabot writes "npm_and_yarn" for both kinds, so "npm_and_yarn in /e2e/ts
62
+ # for js-yaml" could be either a security job or the refresh of a
63
+ # version-update pull request.
64
+ #
65
+ # Accepted deliberately anyway. Kind 1 is what this watcher primarily exists to
66
+ # catch and is still reported for those directories, so what is given up is the
67
+ # narrower "one open pull request has gone stale" signal, for two directories of
68
+ # test scaffolding, in exchange for dropping 16 unactionable failures in each of
69
+ # the two Node repos over retained history.
70
+ #
71
+ # Reading the directories out of dependabot.yml instead looks more general but is
72
+ # worse: entries may use globs (directories: ["**/*"]), which never match a title
73
+ # literally, so genuine failures would be dropped without a word. Prefer a
74
+ # denylist: when it goes stale it re-introduces noise, which is loud, whereas a
75
+ # stale allowlist hides failures, which is silent.
76
+ #
77
+ # Runs entirely within this repo (no external service). A failed scheduled run
78
+ # emails the person who last edited the cron below. Note: GitHub auto-disables
79
+ # scheduled workflows after 60 days of repo inactivity.
80
+
81
+ on:
82
+ schedule:
83
+ - cron: "17 14 * * 3" # Wednesdays 14:17 UTC
84
+ workflow_dispatch:
85
+
86
+ permissions:
87
+ actions: read
88
+
89
+ jobs:
90
+ check-dependabot-runs:
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - name: Fail if any Dependabot version update failed in the last 8 days
94
+ env:
95
+ GH_TOKEN: ${{ github.token }}
96
+ REPO: ${{ github.repository }}
97
+ run: |
98
+ since=$(date -u -d '8 days ago' +%Y-%m-%dT%H:%M:%SZ)
99
+ # --created filters server-side, so --limit applies to runs already
100
+ # narrowed to the window rather than to all of history. Runs come back
101
+ # newest-first, so reaching the limit would drop the oldest in-window
102
+ # runs and this step would report all-clear without them -- hence a
103
+ # limit far above any plausible week's worth of runs.
104
+ runs=$(gh run list \
105
+ --repo "$REPO" \
106
+ --workflow "Dependabot Updates" \
107
+ --created ">=$since" \
108
+ --limit 500 \
109
+ --json conclusion,createdAt,displayTitle,url)
110
+ failures=$(echo "$runs" | jq '
111
+ [.[]
112
+ | select((.displayTitle | contains(" in /. for ")) | not)
113
+ | select((.displayTitle | test(" in /e2e/(js|ts) for ")) | not)
114
+ | select(.conclusion == "failure"
115
+ or .conclusion == "startup_failure"
116
+ or .conclusion == "timed_out")]')
117
+ count=$(echo "$failures" | jq 'length')
118
+ if [ "$count" -gt 0 ]; then
119
+ echo "::error::$count failed Dependabot version update run(s) in the last 8 days:"
120
+ echo "$failures" | jq -r '.[] | "- \(.displayTitle) (\(.createdAt))\n \(.url)"'
121
+ exit 1
122
+ fi
123
+ echo "No failed Dependabot version update runs in the last 8 days."
@@ -0,0 +1,32 @@
1
+ name: Links
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ schedule:
7
+ - cron: "0 13 * * 1" # weekly, to catch external link rot without a commit
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ linkChecker:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
+ with:
19
+ persist-credentials: false
20
+
21
+ - name: Setup mise
22
+ uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
23
+ with:
24
+ install: false
25
+
26
+ # Install only lychee (not the repo's full toolchain) and run the check.
27
+ - name: Check links
28
+ env:
29
+ MISE_AUTO_INSTALL: "false"
30
+ run: |
31
+ mise install lychee
32
+ mise run check-links
@@ -0,0 +1,54 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ workflow_dispatch:
7
+
8
+ permissions: {}
9
+
10
+ concurrency:
11
+ group: pages
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: read
19
+ steps:
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ persist-credentials: false
23
+
24
+ - name: Setup mise
25
+ uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
26
+ with:
27
+ cache: true
28
+
29
+ - name: Build docs
30
+ env:
31
+ HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/
32
+ run: mise run build-docs
33
+
34
+ - name: Configure Pages
35
+ uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
36
+
37
+ - name: Upload artifact
38
+ uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
39
+ with:
40
+ path: docs/public
41
+
42
+ deploy:
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ permissions:
46
+ pages: write
47
+ id-token: write
48
+ environment:
49
+ name: github-pages
50
+ url: ${{ steps.deployment.outputs.page_url }}
51
+ steps:
52
+ - name: Deploy to GitHub Pages
53
+ id: deployment
54
+ uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
@@ -0,0 +1,24 @@
1
+ name: precious
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions: {}
8
+
9
+ jobs:
10
+ precious:
11
+ name: lint
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15
+ with:
16
+ persist-credentials: false
17
+
18
+ - name: Setup mise
19
+ uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
20
+ with:
21
+ cache: true
22
+
23
+ - name: Run precious lint
24
+ run: precious lint --all