Repository navigation
Downloads MaxMind databases with the license key and checks releases with HEAD - #4
Merged
Merged
Conversation
… new releases with HEAD before the checksum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
geo-ip-service now downloads the GeoLite2 databases with the license key alone, so it can run with the key already in use, and it checks for a new release with a
HEADrequest, which MaxMind does not count against the download limit, before fetching anything else.Changes
app/geoip_download?edition_id=...&license_key=...&suffix=...).MAXMIND_LICENSE_KEYalone turns downloads on;MAXMIND_ACCOUNT_IDand the Basic auth requests are gone.HEADrequest reads the release fromLast-Modified, orContent-Dispositionwhen that is missing. A release matching the one installed last time isunchangedwith nothing downloaded.HEADanswer without either header.updatein/healthz.HEADwith a release date per published archive, and checks the key.service-kitsecrets rule names how to handle a provider that accepts a credential only in the URL.Verified
bun run checkunder Bun 1.4.3: typecheck clean, 104 tests pass. Update tests cover:HEAD-only checks when the release is unchangedHEADgives no releaseHEAD-only checks reportingunchanged./healthzshows the recorded release. No log line contains the key.401from theHEADrequest, logged without the key.HEADwith401 Invalid license key. Whether a valid key'sHEADanswer carriesLast-Modifiedis checked on the first stage deploy; without it, the checksum comparison decides.