(chain string)
| 317 | } |
| 318 | |
| 319 | func parseImpersonationChain(chain string) (string, []string) { |
| 320 | accts := strings.Split(chain, ",") |
| 321 | target := accts[0] |
| 322 | // Assign delegates if the chain is more than one account. Delegation |
| 323 | // goes from last back towards target, e.g., With sa1,sa2,sa3, sa3 |
| 324 | // delegates to sa2, which impersonates the target sa1. |
| 325 | var delegates []string |
| 326 | if l := len(accts); l > 1 { |
| 327 | for i := l - 1; i > 0; i-- { |
| 328 | delegates = append(delegates, accts[i]) |
| 329 | } |
| 330 | } |
| 331 | return target, delegates |
| 332 | } |
| 333 | |
| 334 | const iamLoginScope = "https://www.googleapis.com/auth/sqlservice.login" |
| 335 |
no outgoing calls