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.
- {maxminddb-3.1.1 → maxminddb-3.3.0}/HISTORY.rst +123 -0
- {maxminddb-3.1.1/maxminddb.egg-info → maxminddb-3.3.0}/PKG-INFO +22 -13
- {maxminddb-3.1.1 → maxminddb-3.3.0}/README.rst +19 -10
- {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/index.rst +18 -0
- maxminddb-3.3.0/extension/libmaxminddb/.clang-format +6 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/dependabot.yml +22 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/clang-addresssanitizer.yml +28 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/clang-analyzer.yml +22 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/codeql-analysis.yml +46 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/dependabot-failure-watcher.yml +123 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/links.yml +32 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/pages.yml +54 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/precious.yml +24 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/test.yml +63 -0
- maxminddb-3.3.0/extension/libmaxminddb/.github/workflows/zizmor.yml +23 -0
- maxminddb-3.3.0/extension/libmaxminddb/.gitignore +49 -0
- maxminddb-3.3.0/extension/libmaxminddb/.gitmodules +6 -0
- maxminddb-3.3.0/extension/libmaxminddb/.perltidyrc +11 -0
- maxminddb-3.3.0/extension/libmaxminddb/.precious.toml +24 -0
- maxminddb-3.3.0/extension/libmaxminddb/CMakeLists.txt +168 -0
- maxminddb-3.3.0/extension/libmaxminddb/Changes.md +544 -0
- maxminddb-3.3.0/extension/libmaxminddb/LICENSE +202 -0
- maxminddb-3.3.0/extension/libmaxminddb/Makefile.am +48 -0
- maxminddb-3.3.0/extension/libmaxminddb/NOTICE +13 -0
- maxminddb-3.3.0/extension/libmaxminddb/README.dev.md +74 -0
- maxminddb-3.3.0/extension/libmaxminddb/README.fuzzing.md +42 -0
- maxminddb-3.3.0/extension/libmaxminddb/README.md +164 -0
- maxminddb-3.3.0/extension/libmaxminddb/bin/CMakeLists.txt +24 -0
- maxminddb-3.3.0/extension/libmaxminddb/bin/Makefile.am +14 -0
- maxminddb-3.3.0/extension/libmaxminddb/bin/mmdblookup.c +790 -0
- maxminddb-3.3.0/extension/libmaxminddb/bootstrap +21 -0
- maxminddb-3.3.0/extension/libmaxminddb/c_flag_overrides.cmake +7 -0
- maxminddb-3.3.0/extension/libmaxminddb/cmake_uninstall.cmake.in +21 -0
- maxminddb-3.3.0/extension/libmaxminddb/common.mk +7 -0
- maxminddb-3.3.0/extension/libmaxminddb/configure.ac +138 -0
- maxminddb-3.3.0/extension/libmaxminddb/cxx_flag_overrides.cmake +6 -0
- maxminddb-3.3.0/extension/libmaxminddb/dev-bin/make-man-pages.pl +120 -0
- maxminddb-3.3.0/extension/libmaxminddb/dev-bin/ppa-release.sh +63 -0
- maxminddb-3.3.0/extension/libmaxminddb/dev-bin/release.sh +123 -0
- maxminddb-3.3.0/extension/libmaxminddb/dev-bin/valgrind-all.pl +53 -0
- maxminddb-3.3.0/extension/libmaxminddb/doc/libmaxminddb.md +955 -0
- maxminddb-3.3.0/extension/libmaxminddb/doc/mmdblookup.md +104 -0
- maxminddb-3.3.0/extension/libmaxminddb/docs/assets/css/main.css +189 -0
- maxminddb-3.3.0/extension/libmaxminddb/docs/hugo.toml +18 -0
- maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/404.html +24 -0
- maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/_default/_markup/render-heading.html +4 -0
- maxminddb-3.3.0/extension/libmaxminddb/docs/layouts/_default/default.html +27 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/include/maxminddb.h +2 -0
- maxminddb-3.3.0/extension/libmaxminddb/include/maxminddb_config.h.cmake.in +14 -0
- maxminddb-3.3.0/extension/libmaxminddb/include/maxminddb_config.h.in +14 -0
- maxminddb-3.3.0/extension/libmaxminddb/lychee.toml +60 -0
- maxminddb-3.3.0/extension/libmaxminddb/mise.lock +399 -0
- maxminddb-3.3.0/extension/libmaxminddb/mise.toml +28 -0
- maxminddb-3.3.0/extension/libmaxminddb/src/Makefile.am +29 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/data-pool.c +28 -12
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/data-pool.h +11 -7
- maxminddb-3.3.0/extension/libmaxminddb/src/libmaxminddb.pc.in +11 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/maxminddb.c +183 -37
- maxminddb-3.3.0/extension/libmaxminddb/t/CMakeLists.txt +72 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/Makefile.am +39 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_data_size_t.c +78 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_databases_t.c +92 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_epoch_t.c +53 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_indent_t.c +64 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_pointers_t.c +60 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/bad_search_tree_t.c +103 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/basic_lookup_t.c +215 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/compile_c++_t.pl +120 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/data-pool-t.c +392 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/data_entry_list_t.c +429 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/data_types_t.c +533 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/decoder_limits_t.pl +268 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/double_close_t.c +47 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/dump_t.c +99 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/empty_container_metadata_t.c +43 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/external_symbols_t.pl +114 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/fuzz_mmdb.c +60 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/gai_error_t.c +33 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/get_value_pointer_bug_t.c +71 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/get_value_t.c +404 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/invalid_sockaddr_t.c +51 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/ipv4_start_cache_t.c +36 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/ipv6_lookup_in_ipv4_t.c +48 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/max_depth_t.c +117 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/maxminddb_test_helper.c +282 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/maxminddb_test_helper.h +75 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/metadata_marker_t.c +23 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/metadata_pointers_t.c +31 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/metadata_t.c +271 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/mmdblookup_t.pl +158 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/no_map_get_value_t.c +34 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/overflow_bounds_t.c +67 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/pointer_dos_t.c +238 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/read_node_t.c +298 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/threads_t.c +207 -0
- maxminddb-3.3.0/extension/libmaxminddb/t/version_t.c +9 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/maxminddb.c +379 -118
- maxminddb-3.3.0/lychee.toml +67 -0
- maxminddb-3.3.0/maxminddb/__init__.py +113 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/const.py +5 -2
- maxminddb-3.3.0/maxminddb/decoder.py +430 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/extension.pyi +27 -9
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/file.py +26 -6
- maxminddb-3.3.0/maxminddb/reader.py +646 -0
- maxminddb-3.3.0/maxminddb/types.py +38 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0/maxminddb.egg-info}/PKG-INFO +22 -13
- maxminddb-3.3.0/maxminddb.egg-info/SOURCES.txt +266 -0
- maxminddb-3.3.0/mise.lock +69 -0
- maxminddb-3.3.0/mise.toml +10 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/pyproject.toml +16 -4
- maxminddb-3.3.0/tests/__init__.py +0 -0
- maxminddb-3.3.0/tests/data/.gitattributes +1 -0
- maxminddb-3.3.0/tests/data/.gitconfig +2 -0
- maxminddb-3.3.0/tests/data/.github/dependabot.yml +23 -0
- maxminddb-3.3.0/tests/data/.github/workflows/check-untagged-deps.yml +20 -0
- maxminddb-3.3.0/tests/data/.github/workflows/codeql-analysis.yml +45 -0
- maxminddb-3.3.0/tests/data/.github/workflows/dependabot-failure-watcher.yml +123 -0
- maxminddb-3.3.0/tests/data/.github/workflows/go.yml +42 -0
- maxminddb-3.3.0/tests/data/.github/workflows/links.yml +32 -0
- maxminddb-3.3.0/tests/data/.github/workflows/pages.yml +54 -0
- maxminddb-3.3.0/tests/data/.github/workflows/precious.yml +24 -0
- maxminddb-3.3.0/tests/data/.github/workflows/zizmor.yml +23 -0
- maxminddb-3.3.0/tests/data/.gitignore +6 -0
- maxminddb-3.3.0/tests/data/.golangci.yml +760 -0
- maxminddb-3.3.0/tests/data/.precious.toml +39 -0
- maxminddb-3.3.0/tests/data/LICENSE-APACHE +202 -0
- maxminddb-3.3.0/tests/data/LICENSE-MIT +17 -0
- maxminddb-3.3.0/tests/data/MaxMind-DB-spec.md +711 -0
- maxminddb-3.3.0/tests/data/README.md +39 -0
- maxminddb-3.3.0/tests/data/bad-data/README.md +29 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-corrupt-search-tree.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-deep-array-nesting.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-deep-nesting.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-empty-array-last-in-metadata.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-empty-map-last-in-metadata.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-metadata-marker-only.mmdb +1 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-oversized-array.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-oversized-map.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-description-key.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-metadata-key.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-node-count.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-repeated-pointer-key.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-max-left.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-min-left.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-separator-record-min-right.mmdb +0 -0
- maxminddb-3.3.0/tests/data/bad-data/libmaxminddb/libmaxminddb-uint64-max-epoch.mmdb +0 -0
- maxminddb-3.3.0/tests/data/cmd/write-test-data/main.go +144 -0
- maxminddb-3.3.0/tests/data/docs/assets/css/main.css +189 -0
- maxminddb-3.3.0/tests/data/docs/hugo.toml +10 -0
- maxminddb-3.3.0/tests/data/docs/layouts/404.html +24 -0
- maxminddb-3.3.0/tests/data/docs/layouts/_default/_markup/render-heading.html +4 -0
- maxminddb-3.3.0/tests/data/docs/layouts/_default/default.html +20 -0
- maxminddb-3.3.0/tests/data/go.mod +11 -0
- maxminddb-3.3.0/tests/data/go.sum +12 -0
- maxminddb-3.3.0/tests/data/lychee.toml +54 -0
- maxminddb-3.3.0/tests/data/mise.lock +214 -0
- maxminddb-3.3.0/tests/data/mise.toml +34 -0
- maxminddb-3.3.0/tests/data/pkg/writer/baddata.go +171 -0
- maxminddb-3.3.0/tests/data/pkg/writer/decoder.go +161 -0
- maxminddb-3.3.0/tests/data/pkg/writer/fixtures_test.go +165 -0
- maxminddb-3.3.0/tests/data/pkg/writer/geoip2.go +216 -0
- maxminddb-3.3.0/tests/data/pkg/writer/geoip2_test.go +237 -0
- maxminddb-3.3.0/tests/data/pkg/writer/ip.go +39 -0
- maxminddb-3.3.0/tests/data/pkg/writer/maxmind.go +246 -0
- maxminddb-3.3.0/tests/data/pkg/writer/nestedstructures.go +72 -0
- maxminddb-3.3.0/tests/data/pkg/writer/pointerdos.go +502 -0
- maxminddb-3.3.0/tests/data/pkg/writer/pointerdos_test.go +597 -0
- maxminddb-3.3.0/tests/data/pkg/writer/rawmmdb.go +589 -0
- maxminddb-3.3.0/tests/data/pkg/writer/rawmmdb_test.go +199 -0
- maxminddb-3.3.0/tests/data/pkg/writer/writer.go +65 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP-Anonymous-Plus-Test.json +205 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP-Regions-Test.json +474 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP-Residential-Proxy-Test.json +204 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Anonymous-IP-Test.json +79 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-City-Test.json +13434 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Connection-Type-Test.json +127 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Country-Test.json +17735 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-DensityIncome-Test.json +14 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Domain-Test.json +457 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Enterprise-Test.json +4576 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-IP-Risk-Test.json +111 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-ISP-Test.json +12605 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-Static-IP-Score-Test.json +2147 -0
- maxminddb-3.3.0/tests/data/source-data/GeoIP2-User-Count-Test.json +2855 -0
- maxminddb-3.3.0/tests/data/source-data/GeoLite2-ASN-Test.json +4120 -0
- maxminddb-3.3.0/tests/data/source-data/GeoLite2-City-Test.json +12993 -0
- maxminddb-3.3.0/tests/data/source-data/GeoLite2-Country-Test.json +11369 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP-Regions-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP-Residential-Proxy-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-City-Shield-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Country-Shield-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Enterprise-Shield-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-IP-Risk-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decode-path-shared-budget.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-payload-limit-over.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-payload-limit.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit-over.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit-pointer-heavy.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder-value-limit.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-metadata-payload-limit.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos-string.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos-worst-case.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-payload-amplification-dos.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-pointer-decoder-dos-ipv6.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/MaxMind-DB-test-pointer-decoder-dos.mmdb +0 -0
- maxminddb-3.3.0/tests/data/test-data/README.md +122 -0
- maxminddb-3.3.0/tests/decoder_test.py +662 -0
- maxminddb-3.3.0/tests/reader_test.py +2405 -0
- maxminddb-3.3.0/tests/typing_test.py +52 -0
- maxminddb-3.3.0/uv.lock +618 -0
- maxminddb-3.1.1/maxminddb/__init__.py +0 -91
- maxminddb-3.1.1/maxminddb/decoder.py +0 -214
- maxminddb-3.1.1/maxminddb/reader.py +0 -360
- maxminddb-3.1.1/maxminddb/types.py +0 -15
- maxminddb-3.1.1/maxminddb.egg-info/SOURCES.txt +0 -78
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-City-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-DensityIncome-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-Static-IP-Score-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoIP2-User-Count-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoLite2-ASN-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoLite2-City-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/GeoLite2-Country-Test.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
- maxminddb-3.1.1/tests/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
- maxminddb-3.1.1/tests/decoder_test.py +0 -234
- maxminddb-3.1.1/tests/reader_test.py +0 -745
- maxminddb-3.1.1/uv.lock +0 -466
- {maxminddb-3.1.1 → maxminddb-3.3.0}/LICENSE +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/MANIFEST.in +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/Makefile +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/docs/conf.py +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/examples/benchmark.py +0 -0
- /maxminddb-3.1.1/maxminddb/py.typed → /maxminddb-3.3.0/extension/libmaxminddb/AUTHORS +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/libmaxminddb/src/maxminddb-compat-util.h +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/extension/maxminddb_config.h +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb/errors.py +0 -0
- /maxminddb-3.1.1/tests/__init__.py → /maxminddb-3.3.0/maxminddb/py.typed +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb.egg-info/dependency_links.txt +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/maxminddb.egg-info/top_level.txt +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/setup.cfg +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/setup.py +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/libmaxminddb/libmaxminddb-offset-integer-overflow.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/cyclic-data-structure.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-bytes-length.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-data-record-offset.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-map-key-length.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/invalid-string-length.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/metadata-is-an-uint128.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-golang/unexpected-bytes.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/bad-data/maxminddb-python/bad-unicode-in-map-key.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/GeoIP2-City-Test-Invalid-Node-Count.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/MaxMind-DB-test-pointer-decoder.mmdb +0 -0
- {maxminddb-3.1.1 → maxminddb-3.3.0}/tests/data/test-data/maps-with-pointers.raw +0 -0
- {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.
|
|
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.
|
|
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
|
|
66
|
-
<https://dev.maxmind.com/geoip/geolocate-an-ip/databases
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
83
|
-
sure that the file
|
|
84
|
-
file
|
|
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
|
|
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
|
|
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
|
|
38
|
-
<https://dev.maxmind.com/geoip/geolocate-an-ip/databases
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
55
|
-
sure that the file
|
|
56
|
-
file
|
|
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
|
|
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
|
|
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,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
|