MCPcopy
hub / github.com/dgraph-io/dgraph / getClientWithAdminCtx

Function getClientWithAdminCtx

acl/utils.go:159–171  ·  view source on GitHub ↗

getClientWithAdminCtx creates a client by checking the --alpha, various --tls*, and --retries options, and then login using groot id and password

(conf *viper.Viper)

Source from the content-addressed store, hash-verified

157// getClientWithAdminCtx creates a client by checking the --alpha, various --tls*, and --retries
158// options, and then login using groot id and password
159func getClientWithAdminCtx(conf *viper.Viper) (*dgo.Dgraph, x.CloseFunc, error) {
160 dg, closeClient := x.GetDgraphClient(conf, false)
161 creds := z.NewSuperFlag(conf.GetString("guardian-creds"))
162 err := x.GetPassAndLogin(dg, &x.CredOpt{
163 UserID: creds.GetString("user"),
164 Password: creds.GetString("password"),
165 Namespace: creds.GetUint64("namespace"),
166 })
167 if err != nil {
168 return nil, nil, err
169 }
170 return dg, closeClient, nil
171}
172
173// CreateUserNQuads creates the NQuads needed to store a user with the given ID and
174// password in the ACL system.

Callers 7

userAddFunction · 0.85
groupAddFunction · 0.85
userOrGroupDelFunction · 0.85
changePasswordFunction · 0.85
userModFunction · 0.85
chModFunction · 0.85
infoFunction · 0.85

Calls 2

GetDgraphClientFunction · 0.92
GetPassAndLoginFunction · 0.92

Tested by

no test coverage detected