Skip to content

C++ auth library: Add x-goog-user-project metadata header for outgoing requests #21225

@tmatsuo

Description

@tmatsuo

Is your feature request related to a problem? Please describe.

When using 3 legged OAuth credentials(type=authorized_user), the requests are associated with a single project (in gcloud sdk's case, it's gcloud project). Users experienced various issues like quota, rate limiting, etc.

There is an on-going effort to avoid this problem by:

  1. gcloud sdk will soon start adding quota_project field in the auth json file.
  2. on the server side, if x-goog-user-project metadata is present, treat that project as the quota project.
  3. client library should pick the quota_project field from the auth json file and set the value as x-goog-user-project metadata.

Describe the solution you'd like

For the point 3) above for C++ client libraries, we need some changes in gRPC's auth library.

The auth library picks quota_project field from the auth json file with type "authorized_user" , and set that value as x-goog-user-project metadata for every outgoing requests.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions