Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Last active January 29, 2019 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylertreat/1603f353c1ff04be3045c2e593f3895b to your computer and use it in GitHub Desktop.
Save tylertreat/1603f353c1ff04be3045c2e593f3895b to your computer and use it in GitHub Desktop.
GCP OIDC proxy whitelist
# 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