fix(GraphQL): Make auth work with multi-tenancy and accept CORS in schema (GRAPHQL-1016)#7431
Conversation
…to abhimanyu/remove-cors # Conflicts: # graphql/admin/admin.go # graphql/authorization/auth.go # graphql/e2e/directives/schema_response.json # graphql/e2e/normal/schema_response.json # graphql/resolve/auth_test.go # graphql/resolve/mutation_rewriter.go
…emove-cors # Conflicts: # graphql/authorization/auth.go # graphql/schema/schemagen.go
pawanrawal
left a comment
There was a problem hiding this comment.
Reviewed 38 of 44 files at r1, 14 of 14 files at r2, 3 of 3 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @abhimanyusinghgaur, @manishrjain, and @vvbalaji-dgraph)
graphql/e2e/common/common.go, line 528 at r2 (raw file):
func SafelyDropAllWithGroot(t *testing.T) { // first, make an initial probe to get the schema update counter oldCounter := RetryProbeGraphQL(t, Alpha1HTTP, nil).SchemaUpdateCounter
this and the function below can be combined into one which can take a boolean parameter and do things accordingly
abhimanyusinghgaur
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @manishrjain, @pawanrawal, and @vvbalaji-dgraph)
graphql/e2e/common/common.go, line 528 at r2 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
this and the function below can be combined into one which can take a boolean parameter and do things accordingly
Done.
…tes) change (#7486) Some of the internal predicates have been removed in #7431 and #7451. When restoring from a backup taken on a version older than 21.03, we should skip restoring them. Also, its export will fail in data loading(bulk/live load). Instead of polluting the backup code with the restore fixation logic, we will use the dgraph upgrade tool to do the migration. When upgrading from version 20.11 to 21.03, the changes of this PR will be applied. It will update the graphql schema with CORS information and drop the depreciated predicates/types. It will also update the persisted query. This PR also fixes the restored backup when a --upgrade is set to true in the export_backup command. Note that persisted query is not fixed in export_backup.
…tes) change (#7486) Some of the internal predicates have been removed in #7431 and #7451. When restoring from a backup taken on a version older than 21.03, we should skip restoring them. Also, its export will fail in data loading(bulk/live load). Instead of polluting the backup code with the restore fixation logic, we will use the dgraph upgrade tool to do the migration. When upgrading from version 20.11 to 21.03, the changes of this PR will be applied. It will update the graphql schema with CORS information and drop the depreciated predicates/types. It will also update the persisted query. This PR also fixes the restored backup when a --upgrade is set to true in the export_backup command. Note that persisted query is not fixed in export_backup. (cherry picked from commit 2d36978)
…es) change (#7486) (#7606) Some of the internal predicates have been removed in #7431 and #7451. When restoring from a backup taken on a version older than 21.03, we should skip restoring them. Also, its export will fail in data loading(bulk/live load). Instead of polluting the backup code with the restore fixation logic, we will use the dgraph upgrade tool to do the migration. When upgrading from version 20.11 to 21.03, the changes of this PR will be applied. It will update the graphql schema with CORS information and drop the depreciated predicates/types. It will also update the persisted query. This PR also fixes the restored backup when a --upgrade is set to true in the export_backup command. Note that persisted query is not fixed in export_backup. (cherry picked from commit 2d36978)
It is a continuation of #7400.
This PR does a bunch of things:
@authwork with multi-tenancydgraph.graphql.schema_historyleftoversdgraph.corsas an internal predicate and any associated admin mutations# Dgraph.Allow-Originin GraphQL schemaThis change is