Skip to content

Infer project from credentials if not passed explicitly #27

@tseaver

Description

@tseaver

Split off from #17

See also: googleapis/python-datastore#74
See also: googleapis/python-storage#177

In a "blank slate" design, I would argue that the credentials' project should supersede the one present in the environment. However, for backward compatibility, we need to use the credentials' project only if the environment variable is not set. So the order should follow the pattern from google.auth.default when inferring project ID:

  • Explicit project ID passed to client constructor
  • Project ID set in GOOGLE_CLOUD_PROJECT envvar
  • Project ID from credentials, if present
  • Project ID from SDK
  • Project ID from GAE
  • Project ID from GCE

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions