Conversation
mbleigh
left a comment
There was a problem hiding this comment.
You might want to look for x-goog-user-project in the codebase and think about the behavior we want - for instance I manually set it to the current project for auth recently but maybe the env var should override that?
I think you were actually setting x-goog-quota-user (https://cloud.google.com/apis/docs/system-parameters#definitions), which is closely related but only affects quota (x-goog-user-project affects quota and billing). I think x-goog-user-project is the right one to use here for consistency with other tools. Either way, that is the current behavior here - we always overwrite any heades provided at the call site with this value. |
Description
When GOOGLE_CLOUD_QUOTA_PROJECT is set, we should set
x-goog-user-projecton outgoing API requests.This is a common standard accross many google libraries (https://cloud.google.com/docs/quotas/set-quota-project), and we've had a few different cases where this would be useful. It also fixes #6801.
However, I don't have the most thorough understand of how the various x-goog headers work, and whether this is the correct/narrowest one to set here. I'd love a review from someone who is well versed in this.