Skip to content

Commit

Permalink
fix(acl): fix duplicate groot user creation (#51)
Browse files Browse the repository at this point in the history
This PR adds the unique directive to the 'dgraph.xid' &
'dgraph.graphql.xid' predicates. Prior to this change, users could
create duplicate users leading to misconfiguration of ACL.
  • Loading branch information
shivaji-dgraph authored and mangalaman93 committed Mar 13, 2024
1 parent ec08d12 commit 8cb6aec
Show file tree
Hide file tree
Showing 10 changed files with 362 additions and 144 deletions.
2 changes: 1 addition & 1 deletion dgraphtest/ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (hc *HTTPClient) CreateGroup(name string) (string, error) {
}
resp, err := hc.RunGraphqlQuery(params, true)
if err != nil {
return "", nil
return "", err
}
type Response struct {
AddGroup struct {
Expand Down
1 change: 1 addition & 0 deletions ee/acl/acl_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ func (asuite *AclTestSuite) TestWrongPermission() {
defer cleanup()
require.NoError(t, gc.LoginIntoNamespace(ctx, dgraphtest.DefaultUser,
dgraphtest.DefaultPassword, x.GalaxyNamespace))
require.NoError(t, gc.DropAll())

mu := &api.Mutation{SetNquads: []byte(`
_:dev <dgraph.type> "dgraph.type.Group" .
Expand Down
Loading

0 comments on commit 8cb6aec

Please sign in to comment.