Commit 7de043f
deploy: fix(bigquery): add impersonateServiceAccount to prebuilt config (googleapis#2770)
## Summary
Add `BIGQUERY_IMPERSONATE_SERVICE_ACCOUNT` env var support to the
prebuilt BigQuery configuration, enabling service account impersonation
without requiring a custom `--tools-file`.
## Problem
The BigQuery source already supports `impersonateServiceAccount` (added
in googleapis#1641 / googleapis#906), but the prebuilt config at
`internal/prebuiltconfigs/tools/bigquery.yaml` does not expose it via an
environment variable. This forces users who need impersonation to
abandon `--prebuilt bigquery` entirely and create a custom
`--tools-file` that manually redefines all 9 tools — just to set one
field on the source.
This is a common need for organizations that use service account
impersonation to scope permissions for AI agents, rather than granting
broad access to individual user accounts.
## Solution
Add a single line to the prebuilt BigQuery YAML:
```yaml
impersonateServiceAccount: ${BIGQUERY_IMPERSONATE_SERVICE_ACCOUNT:}
```
The empty default (`:`) means existing users are unaffected — the field
is ignored when the env var is not set, preserving full backward
compatibility.
## Validation
Built the patched binary locally and confirmed:
- Without the env var: `SESSION_USER()` returns the personal account
(unchanged behavior)
- With the env var: `SESSION_USER()` returns the impersonated service
account
## PR Checklist
- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change
🛠️ Fixes googleapis#2769
---------
Co-authored-by: kkeefer1 <kyle_keefer@intuit.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> 9c3a7481 parent 8e85c07 commit 7de043f
File tree
31 files changed
+26
-11
lines changed- dev
- integrations
- bigquery/prebuilt-configs
- bigquery
- mongodb/tools
- mongodb-find-one
- pagefind
- fragment
- index
31 files changed
+26
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7417 | 7417 | | |
7418 | 7418 | | |
7419 | 7419 | | |
7420 | | - | |
| 7420 | + | |
7421 | 7421 | | |
7422 | 7422 | | |
7423 | 7423 | | |
| |||
17748 | 17748 | | |
17749 | 17749 | | |
17750 | 17750 | | |
| 17751 | + | |
| 17752 | + | |
| 17753 | + | |
| 17754 | + | |
17751 | 17755 | | |
17752 | 17756 | | |
17753 | 17757 | | |
| |||
Lines changed: 6 additions & 3 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
17694 | 17694 | | |
17695 | 17695 | | |
17696 | 17696 | | |
| 17697 | + | |
| 17698 | + | |
| 17699 | + | |
| 17700 | + | |
17697 | 17701 | | |
17698 | 17702 | | |
17699 | 17703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments