Last active
January 29, 2019 06:52
-
-
Save tylertreat/1603f353c1ff04be3045c2e593f3895b to your computer and use it in GitHub Desktop.
GCP OIDC proxy whitelist
This file contains 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
# Check path against whitelist. | |
path = proxied_request.path | |
if not path: | |
path = '/' | |
# TODO: Implement proper wildcarding for paths. | |
if '*' not in _whitelist and path not in _whitelist: | |
logging.warn('Rejected {} {}, not in whitelist'.format( | |
proxied_request.method, url)) | |
return 'Requested path {} not in whitelist'.format(path), 403 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment