Closed Rokirok closed 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.
@steren can you confirm this change is correct?
The behavior described in the first comment is accurate: https://cloud.google.com/run/docs/authenticating/service-to-service#acquire-token
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.