envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Add country mapping overwrite field on geoip maxmind filter

Open barroca opened this issue 1 year ago • 6 comments

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:]

barroca avatar Feb 14 '24 16:02 barroca

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/).

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/32404 was opened by barroca.

see: more, trace.

/docs

phlax avatar Feb 15 '24 10:02 phlax

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.

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/32404#issuecomment-1945794245 was created by @phlax.

see: more, trace.

/docs

barroca avatar Feb 15 '24 11:02 barroca

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.

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/32404#issuecomment-1945856813 was created by @barroca.

see: more, trace.

@barroca the docs will render once they are able to - theres still an issue with the changelog link

phlax avatar Feb 15 '24 11:02 phlax

Now that nezdolik has the comments I'm going to assign it over. :)

ravenblackx avatar Feb 29 '24 17:02 ravenblackx

Apologies for delayed review, i have been swamped past weeks.

nezdolik avatar Feb 29 '24 18:02 nezdolik

@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.

barroca avatar Mar 04 '24 16:03 barroca

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!

github-actions[bot] avatar Apr 14 '24 00:04 github-actions[bot]

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!

github-actions[bot] avatar Apr 21 '24 04:04 github-actions[bot]