envoy
envoy copied to clipboard
Add country mapping overwrite field on geoip maxmind filter
Commit Message:
Add country map file to ovewrite country code.
Added :ref:Geoip country mapping path option<envoy_v3_api_msg_extensions.geoip_providers.maxmind.v3.MaxMindConfig.country_mapping_path
to allow override of country code when needed. The country mapping file is a json containing the iso code to be mapped from:to so it is possible to override the result read from the Maxmind database. If the path is incorrect or the json is invalid, a warning will be logged, the metric country_mapping.parse_error will be incrementedand an empty map will be used.
Additional Description: I've added a commit that changes the behaviour to throw exceptions instead of logging errors when the country mapping file is invalid. Feel free to ask for removal if you prefer to have it just sending warnings.
Risk Level: This PR changes the maxmind geoip filter and should have low risk since it doesn't change other filter behaviours.
Testing:
Using curl with curl -k -H "X-Forwarded-For: 85.24.143.2, 40.0.0.1" -H "X-Real-IP: 1.1.1.10"
might be enough to validate the configuration.
Docs Changes: Release Notes: Platform Specific Features: [Optional Runtime guard:] [Optional Fixes #Issue] [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional API Considerations:]
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/)
.
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/)
.
/docs
Docs for this Pull Request will be rendered here:
https://storage.googleapis.com/envoy-pr/32404/docs/index.html
The docs are (re-)rendered each time the CI envoy-presubmit (precheck docs)
job completes.
/docs
Docs for this Pull Request will be rendered here:
https://storage.googleapis.com/envoy-pr/32404/docs/index.html
The docs are (re-)rendered each time the CI envoy-presubmit (precheck docs)
job completes.
@barroca the docs will render once they are able to - theres still an issue with the changelog link
Now that nezdolik has the comments I'm going to assign it over. :)
Apologies for delayed review, i have been swamped past weeks.
@nezdolik I addressed your comments, but right now I'm having trouble identifying the leak that I'm getting from the presubmit job https://dev.azure.com/cncf/envoy/_build/results?buildId=163920&view=logs&j=1439b9f7-a348-5b50-b5fe-ea612ea91241&t=1002ac43-da84-5fae-70b2-98833b702d09
I'm still investigating, but if you have any clue let me know.
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!