GoogleCloudPlatform / cloud-run-proxy

Local proxy for authenticating requests to Cloud Run
Apache License 2.0
124 stars 20 forks source link

Use X-Serverless-Authorization instead of Authorization header #25

Closed Rokirok closed 1 year ago

Rokirok commented 1 year ago

The usage of X-Serverless-Authorization in the cloud-run-proxy will prevent conflicts with the actual cloud run applications authentication/authorization flow.

If the Authorization header is overwritten by cloud-run-proxy it will in some applications conflict with the app's own authorization logic resulting in an unauthorized request.

X-Serverless-Authorization is a header supported by Identity-Aware-Proxy and it is also supported for google cloud run IAM authorization. If X-Serverless-Authorization and Authorization are both present, cloud run will use X-Serverless-Authorization for authorizing the user and resolving their IAM permissions.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

sethvargo commented 1 year ago

@steren can you confirm this change is correct?

steren commented 1 year ago

The behavior described in the first comment is accurate: https://cloud.google.com/run/docs/authenticating/service-to-service#acquire-token