Commit 1ef7605
committed
feat: add Secret Manager fallback for API credentials
- Add `cloud.google.com/go/secretmanager` dependency.
- Create `pkg/utils/secrets.go` to fetch secrets from Google Cloud Secret Manager.
- Update `pkg/app/api_client.go` to check `GCLOUD_PROJECT_ID` and fetch credentials from Secret Manager if environment variables are missing.
- Implement caching in `getAPIConfig` to avoid repeated Secret Manager calls.
- Add `resetAPIConfigCache` helper for testing.
- Update `pkg/app/test_utils_test.go` to reset config cache when setting mock env vars.
- Add `TestGetAPIConfig_SecretManagerFallback` to verify fallback logic.1 parent ae362a3 commit 1ef7605
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments