pjfanning opened a new pull request, #1926:
URL: https://github.com/apache/pekko-connectors/pull/1926

   The project id used by the Google connectors was always taken from the 
credentials provider, so the only way to target a project other than the one 
owning the credentials' principal was to override `GoogleSettings.projectId` 
programmatically. That combination is common in practice — a service account in 
one project is frequently granted access to resources in another, since Google 
principals are global.
   
   This adds two additive settings at the top level of 
`pekko.connectors.google`:
   
   * `project-id` — used in preference to the project id reported by the 
credentials provider.
   * `default-project-id` — used when neither `project-id` nor the credentials 
provider supplies one. It reads `GOOGLE_CLOUD_PROJECT`, `GCLOUD_PROJECT` and 
`GCP_PROJECT`, which GCP runtimes (App Engine, Cloud Run, Cloud Functions) and 
GKE Workload Identity commonly set for you.
   
   So the resolution order is `project-id`, then the credentials provider, then 
`default-project-id`.
   
   Both settings default to empty, so an existing configuration resolves 
exactly the project id it did before. `GoogleSettings.apply(Config)` guards the 
two new lookups with `hasPath`, so a hand-built `Config` that predates them 
keeps working rather than throwing `ConfigException.Missing`.
   
   Note that `credentials.google-application-default.project-id` already read 
`GOOGLE_CLOUD_PROJECT`/`GCLOUD_PROJECT`; that is left alone, and the new 
top-level settings make the same environment fallback available to every 
provider.
   
   Tested with new cases in `GoogleSettingsSpec` covering each step of the 
resolution order, the all-empty case, and a config with the new keys removed.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to