googleapis / googleapis/google-cloud-rust

Quota project from ADC is hard (impossible?) to unset

Open
#2,007 3 comments 0 reactions 0 assignees View on GitHub
auth priority: p3 type: feature request
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

## Problem

Auth can add in a header to use for quota projects. This can be detected automatically via ADC.

Some RPCs (at least `google.storage.control.v2.StorageControl/RenameFolder`) do not work with quota projects. They just return an error saying "We don't support quota projects".[^1]

It is difficult to clear a quota project. The credential builders only accept a concrete quota project, (i.e. they do not accept `None`). The quota project env var will only overwrite the value if it is set. It also cannot clear the quota project.

In my local development, I had to edit my ADC to get a successful request.

## Solutions?

One of the simplest solutions is to add a `clear_quota_project_id()` to the credential builder. Or we change `set_quota_project_id` to accept `Option`. Both are kinda ugly.

[^1]: This seems strange to me, but it is an intentional decision made by the service. 🤷

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.