(auth *coreauth.Auth)
| 542 | } |
| 543 | |
| 544 | func authProjectID(auth *coreauth.Auth) string { |
| 545 | if auth == nil { |
| 546 | return "" |
| 547 | } |
| 548 | if auth.Metadata != nil { |
| 549 | if v, ok := auth.Metadata["project_id"].(string); ok { |
| 550 | if projectID := strings.TrimSpace(v); projectID != "" { |
| 551 | return projectID |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | if auth.Attributes != nil { |
| 556 | if projectID := strings.TrimSpace(auth.Attributes["project_id"]); projectID != "" { |
| 557 | return projectID |
| 558 | } |
| 559 | } |
| 560 | return "" |
| 561 | } |
| 562 | |
| 563 | func authAttribute(auth *coreauth.Auth, key string) string { |
| 564 | if auth == nil || len(auth.Attributes) == 0 { |
no outgoing calls
no test coverage detected