| 46 | } |
| 47 | |
| 48 | func fetchAuthIdentity( |
| 49 | ctx context.Context, |
| 50 | client string, |
| 51 | refreshToken string, |
| 52 | scopes []string, |
| 53 | timeout time.Duration, |
| 54 | ) (googleauth.Identity, error) { |
| 55 | if runtime, ok := app.FromContext(ctx); ok && runtime.Auth.FetchAuthorizedIdentity != nil { |
| 56 | return runtime.Auth.FetchAuthorizedIdentity(ctx, client, refreshToken, scopes, timeout) |
| 57 | } |
| 58 | return googleauth.Identity{}, fmt.Errorf("%w: authorized identity", errRuntimeServiceRequired) |
| 59 | } |
| 60 | |
| 61 | func ensureKeychainAccessIfNeeded(ctx context.Context) error { |
| 62 | backendInfo, err := resolveKeyringBackendInfo(ctx) |