Commit 7f0e22b
committed
refactor(apigee): replace scope-based auth with credentials injection
Per reviewer feedback, drop the internal google.auth.default() call and the _APIGEE_SCOPES constant. Instead, expose an opt-in credentials parameter on ApigeeLlm.__init__ that is forwarded to genai.Client when provided. When omitted, the credentials kwarg is not forwarded at all, preserving the default genai.Client auth flow (and avoiding its Gemini Developer API warning about credentials usage).
Callers needing additional OAuth scopes (e.g., userinfo.email for Apigee tokeninfo identification, the original #4721 use case) can now construct credentials with their preferred scopes and inject them.1 parent 1d6e9b0 commit 7f0e22b
2 files changed
Lines changed: 45 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| 96 | + | |
101 | 97 | | |
102 | 98 | | |
103 | 99 | | |
| |||
129 | 125 | | |
130 | 126 | | |
131 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
243 | | - | |
244 | | - | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | | - | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 36 | | |
48 | 37 | | |
49 | 38 | | |
| |||
664 | 653 | | |
665 | 654 | | |
666 | 655 | | |
667 | | - | |
668 | | - | |
| 656 | + | |
| 657 | + | |
669 | 658 | | |
670 | | - | |
| 659 | + | |
671 | 660 | | |
672 | | - | |
673 | 661 | | |
674 | 662 | | |
675 | 663 | | |
| |||
689 | 677 | | |
690 | 678 | | |
691 | 679 | | |
| 680 | + | |
692 | 681 | | |
693 | 682 | | |
694 | 683 | | |
695 | | - | |
696 | | - | |
697 | 684 | | |
698 | 685 | | |
699 | 686 | | |
700 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
701 | 719 | | |
702 | 720 | | |
703 | 721 | | |
| |||
0 commit comments