Skip to content

Commit 7893305

Browse files
authored
rename galaxy to root and guardian to superadmin (#9396)
This PR also updates the telemetry URL to events.hypermode.com
1 parent 7546846 commit 7893305

File tree

101 files changed

+678
-673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+678
-673
lines changed

acl/acl_curl_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ func (asuite *AclTestSuite) TestCurlAuthorization() {
3333
require.NoError(t, err)
3434
defer cleanup()
3535
require.NoError(t, gc.LoginIntoNamespace(ctx, dgraphapi.DefaultUser,
36-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
36+
dgraphapi.DefaultPassword, x.RootNamespace))
3737

3838
hc, err := asuite.dc.HTTPClient()
3939
require.NoError(t, err)
4040
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
41-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
41+
dgraphapi.DefaultPassword, x.RootNamespace))
4242
createAccountAndData(t, gc, hc)
4343

4444
// test query through curl
45-
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.GalaxyNamespace))
45+
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.RootNamespace))
4646
// No ACL rules are specified, so query should return empty response,
4747
// alter and mutate should fail.
4848
queryArgs := func(jwt string) []string {
@@ -96,20 +96,20 @@ func (asuite *AclTestSuite) TestCurlAuthorization() {
9696
DgraphErrMsg: "Token is expired",
9797
})
9898
// login again using the refreshJwt
99-
require.NoError(t, hc.LoginUsingToken(x.GalaxyNamespace))
99+
require.NoError(t, hc.LoginUsingToken(x.RootNamespace))
100100
require.NoError(t, err, fmt.Sprintf("login through refresh httpToken failed: %v", err))
101101
hcWithGroot, err := asuite.dc.HTTPClient()
102102
require.NoError(t, err)
103103
require.NoError(t, hcWithGroot.LoginIntoNamespace(dgraphapi.DefaultUser,
104-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
104+
dgraphapi.DefaultPassword, x.RootNamespace))
105105
createGroupAndAcls(t, unusedGroup, false, hcWithGroot)
106106
time.Sleep(expireJwtSleep)
107107
testutil.VerifyCurlCmd(t, queryArgs(hc.AccessJwt), &testutil.CurlFailureConfig{
108108
ShouldFail: true,
109109
DgraphErrMsg: "Token is expired",
110110
})
111111
// refresh the jwts again
112-
require.NoError(t, hc.LoginUsingToken(x.GalaxyNamespace))
112+
require.NoError(t, hc.LoginUsingToken(x.RootNamespace))
113113

114114
require.NoError(t, err, fmt.Sprintf("login through refresh httpToken failed: %v", err))
115115
// verify that with an ACL rule defined, all the operations except query should
@@ -126,11 +126,11 @@ func (asuite *AclTestSuite) TestCurlAuthorization() {
126126
DgraphErrMsg: "PermissionDenied",
127127
})
128128
require.NoError(t, hcWithGroot.LoginIntoNamespace(dgraphapi.DefaultUser,
129-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
129+
dgraphapi.DefaultPassword, x.RootNamespace))
130130
createGroupAndAcls(t, devGroup, true, hcWithGroot)
131131
time.Sleep(defaultTimeToSleep)
132132
// refresh the jwts again
133-
require.NoError(t, hc.LoginUsingToken(x.GalaxyNamespace))
133+
require.NoError(t, hc.LoginUsingToken(x.RootNamespace))
134134

135135
require.NoError(t, err, fmt.Sprintf("login through refresh httpToken failed: %v", err))
136136
// verify that the operations should be allowed again through the dev group

acl/acl_integration_test.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (asuite *AclTestSuite) TestPasswordReturn() {
3636
hc, err := asuite.dc.HTTPClient()
3737
require.NoError(t, err)
3838
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
39-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
39+
dgraphapi.DefaultPassword, x.RootNamespace))
4040
query := dgraphapi.GraphQLParams{
4141
Query: `
4242
query {
@@ -56,18 +56,18 @@ func (asuite *AclTestSuite) TestHealthForAcl() {
5656
hc, err := asuite.dc.HTTPClient()
5757
require.NoError(t, err)
5858
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
59-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
59+
dgraphapi.DefaultPassword, x.RootNamespace))
6060

6161
resetUser(t, hc)
62-
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.GalaxyNamespace))
62+
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.RootNamespace))
6363
gqlResp, err := hc.HealthForInstance()
6464
require.Error(t, err)
6565
// assert errors for non-guardians
6666
assertNonGuardianFailure(t, "health", false, gqlResp, err)
6767

6868
// assert data for guardians
6969
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
70-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
70+
dgraphapi.DefaultPassword, x.RootNamespace))
7171

7272
resp, err := hc.HealthForInstance()
7373
require.NoError(t, err, "health request failed")
@@ -313,10 +313,10 @@ func (asuite *AclTestSuite) TestGuardianOnlyAccessForAdminEndpoints() {
313313
hc, err := asuite.dc.HTTPClient()
314314
require.NoError(t, err)
315315
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
316-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
316+
dgraphapi.DefaultPassword, x.RootNamespace))
317317

318318
resetUser(t, hc)
319-
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.GalaxyNamespace))
319+
require.NoError(t, hc.LoginIntoNamespace(userid, userpassword, x.RootNamespace))
320320
gqlResp, err := hc.RunGraphqlQuery(params, true)
321321
require.Error(t, err)
322322
// assert ACL error for non-guardians
@@ -325,7 +325,7 @@ func (asuite *AclTestSuite) TestGuardianOnlyAccessForAdminEndpoints() {
325325
// for guardians, assert non-ACL error or success
326326
if tcase.testGuardianAccess {
327327
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
328-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
328+
dgraphapi.DefaultPassword, x.RootNamespace))
329329

330330
resp, err := hc.RunGraphqlQuery(params, true)
331331
if tcase.guardianErr == "" {
@@ -352,26 +352,26 @@ func (asuite *AclTestSuite) TestFailedLogin() {
352352
require.NoError(t, err)
353353
defer cleanup()
354354
require.NoError(t, gc.LoginIntoNamespace(ctx, dgraphapi.DefaultUser,
355-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
355+
dgraphapi.DefaultPassword, x.RootNamespace))
356356

357357
hc, err := asuite.dc.HTTPClient()
358358
require.NoError(t, err)
359359
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
360-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
360+
dgraphapi.DefaultPassword, x.RootNamespace))
361361

362362
require.NoError(t, gc.DropAll())
363363

364364
client, _, err := asuite.dc.Client()
365365
require.NoError(t, err)
366366

367367
// User is not present
368-
err = client.LoginIntoNamespace(ctx, userid, "simplepassword", x.GalaxyNamespace)
368+
err = client.LoginIntoNamespace(ctx, userid, "simplepassword", x.RootNamespace)
369369
require.Error(t, err)
370370
require.Contains(t, err.Error(), x.ErrorInvalidLogin.Error())
371371

372372
resetUser(t, hc)
373373
// User is present
374-
require.Error(t, client.LoginIntoNamespace(ctx, userid, "randomstring", x.GalaxyNamespace))
374+
require.Error(t, client.LoginIntoNamespace(ctx, userid, "randomstring", x.RootNamespace))
375375
require.Contains(t, err.Error(), x.ErrorInvalidLogin.Error())
376376
}
377377

@@ -384,7 +384,7 @@ func (asuite *AclTestSuite) TestWrongPermission() {
384384
require.NoError(t, err)
385385
defer cleanup()
386386
require.NoError(t, gc.LoginIntoNamespace(ctx, dgraphapi.DefaultUser,
387-
dgraphapi.DefaultPassword, x.GalaxyNamespace))
387+
dgraphapi.DefaultPassword, x.RootNamespace))
388388
require.NoError(t, gc.DropAll())
389389

390390
mu := &api.Mutation{SetNquads: []byte(`
@@ -418,7 +418,7 @@ func (asuite *AclTestSuite) TestACLNamespaceEdge() {
418418
require.NoError(t, err)
419419
defer cleanup()
420420
require.NoError(t, gc.LoginIntoNamespace(context.Background(),
421-
dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.GalaxyNamespace))
421+
dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.RootNamespace))
422422

423423
json := `
424424
{
@@ -449,7 +449,7 @@ func (asuite *AclTestSuite) TestACLDuplicateGrootUser() {
449449
require.NoError(t, err)
450450
defer cleanup()
451451
require.NoError(t, gc.LoginIntoNamespace(context.Background(),
452-
dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.GalaxyNamespace))
452+
dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.RootNamespace))
453453

454454
rdfs := `_:a <dgraph.xid> "groot" .
455455
_:a <dgraph.type> "dgraph.type.User" .`

0 commit comments

Comments
 (0)