(ctx context.Context, u *url.URL)
| 50 | } |
| 51 | |
| 52 | func extractCredentials(ctx context.Context, u *url.URL) (string, string, error) { |
| 53 | if u.User == nil { |
| 54 | return "", "", errors.Newf(ctx, "%v has no information about the instance credentials", u) |
| 55 | } |
| 56 | |
| 57 | password, ok := u.User.Password() |
| 58 | if !ok { |
| 59 | return "", "", errors.Newf(ctx, "%v has no information about the instance password", u) |
| 60 | } |
| 61 | |
| 62 | return u.User.Username(), password, nil |
| 63 | } |