Quota project from ADC is hard (impossible?) to unset
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<T>. Both are kinda ugly.
[^1]: This seems strange to me, but it is an intentional decision made by the service. 🤷
Should we add this to the stabilization milestone? At least one of the solutions seems to change the API, and it is not clear if the change is breaking?
It is strange that this service said it doesn't accept quota project. Quota project is honored by resource-less (client based) APIs like translate and is just ignored by resourceful (resource based) APIs like compute.
It is weird that this service complains about it. I will look into this.
As discussed today, fixing this would just require adding some new functions, it would not be a breaking change.