MCPcopy Create free account
hub / github.com/Scalingo/cli / extractCredentials

Function extractCredentials

db/env.go:52–63  ·  view source on GitHub ↗
(ctx context.Context, u *url.URL)

Source from the content-addressed store, hash-verified

50}
51
52func 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}

Callers 1

dbURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected