feat: Adding GO callout for extauthz for block ip and adding callout server and tools#280
Open
mateustd-ciandt wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Open
Conversation
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.
This update introduces functionality for extracting the client IP address from the
x-forwarded-forheader.It checks if the client IP falls within a blocked range (e.g. 10.0.0.0/24).
If the IP is blocked: the request will be denied, and the response will include a header x-client-ip-allowed set to false.
If the request is allowed: the response will include a header x-client-ip-allowed set to true.
This functionality is exemplified in two new files:
block_ip.goandblock_ip_test.go, which include the corresponding logic and tests.Also adding a
callout_server.goandcallout_tools.gojust like we have for extproc but for extauthz, we will also use this for other examples in the future.Since this is the first commit for extauthz for GO I'm also adding a
Dockerfile,docker-composeand thessl_credsfolder.