MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / TestSchemaQueryWithACL

Method TestSchemaQueryWithACL

acl/acl_test.go:2319–2408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2317}
2318
2319func (asuite *AclTestSuite) TestSchemaQueryWithACL() {
2320 t := asuite.T()
2321 dgraphtest.ShouldSkipTest(t, "9a964dd9c794a9731fa6ec35aded6693acc7a1fd", asuite.dc.GetVersion())
2322
2323 ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
2324 defer cancel()
2325
2326 schemaQuery := "schema{}"
2327
2328 aliceSchema := `{
2329 "schema": [
2330 {
2331 "predicate": "name",
2332 "type": "string",
2333 "index": true,
2334 "tokenizer": [
2335 "exact"
2336 ]
2337 }
2338 ],
2339 "types": [
2340 {
2341 "fields": [],
2342 "name": "dgraph.graphql"
2343 },
2344 {
2345 "fields":[],
2346 "name":"dgraph.graphql.persisted_query"
2347 },
2348 {
2349 "fields": [],
2350 "name": "dgraph.namespace"
2351 },
2352 {
2353 "fields": [],
2354 "name": "dgraph.type.Group"
2355 },
2356 {
2357 "fields": [],
2358 "name": "dgraph.type.Rule"
2359 },
2360 {
2361 "fields": [],
2362 "name": "dgraph.type.User"
2363 }
2364 ]
2365}`
2366
2367 // guardian user should be able to view full schema
2368 gc, cleanup, err := asuite.dc.Client()
2369 require.NoError(t, err)
2370 defer cleanup()
2371 require.NoError(t, gc.LoginIntoNamespace(ctx, dgraphapi.DefaultUser,
2372 dgraphapi.DefaultPassword, x.RootNamespace))
2373
2374 hc, err := asuite.dc.HTTPClient()
2375 require.NoError(t, err)
2376 require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.RootNamespace))

Callers

nothing calls this directly

Calls 12

UpgradeMethod · 0.95
ShouldSkipTestFunction · 0.92
IsHigherVersionFunction · 0.92
cleanupFunction · 0.85
resetUserFunction · 0.85
addDataAndRulesFunction · 0.85
LoginIntoNamespaceMethod · 0.80
DropAllMethod · 0.80
GetVersionMethod · 0.65
ClientMethod · 0.65
HTTPClientMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected