Commit e9b9997
committed
Skip list_secrets call when case_sensitive=True
When case_sensitive=True, secret names are used as-is without any
name translation, so there's no need to enumerate all secrets via
list_secrets (which requires secretmanager.secrets.list permission).
__getitem__ now calls _get_secret_value directly when case_sensitive=True.
get_field_value likewise uses env_name directly when case_sensitive=True,
avoiding access to _secret_name_map (and the underlying list_secrets call)
even when a SecretVersion is specified.1 parent f4fcb53 commit e9b9997
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | | - | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
204 | 211 | | |
205 | 212 | | |
206 | 213 | | |
207 | | - | |
208 | | - | |
209 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| |||
0 commit comments