Skip to content

Make GOOGLE_CLOUD_PROJECT property not mandatory #2102

@gustavovnicius

Description

@gustavovnicius

Component(s)

gcp-auth-extension

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

Currently the gcp-auth-extension has the GOOGLE_CLOUD_PROJECT as a required property (either system properties or environment variable).

That, on some setups, is an inconvenience and one needs a few workarounds to supply that property. Which, in a first glance, is also redundant, as the extension itself requires the ADC context, and in most cases the project id can be inferred from it. See ServiceOptions on google-cloud-core package for project id resolution strategies.

Having the option to provide the project as a configuration option is still useful though, for those who have setups where the reporting and quota are on different projects.

Describe the solution you'd like

The extension should infer the project from the existing context, ideally by using ServiceOptions resolution, and not have it as a required configuration property.

In case it can neither infer it, and a project id isn't provided, then it should fail (same behavior today when the option isn't provided).

Describe alternatives you've considered

No response

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions