MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / parseImpersonationChain

Function parseImpersonationChain

internal/proxy/proxy.go:319–332  ·  view source on GitHub ↗
(chain string)

Source from the content-addressed store, hash-verified

317}
318
319func 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
334const iamLoginScope = "https://www.googleapis.com/auth/sqlservice.login"
335

Callers 2

credentialsOptFunction · 0.85

Calls

no outgoing calls

Tested by 1