Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,13 @@ area/testing/jepsen:
- changed-files:
- any-glob-to-any-file: contrib/jepsen/**

area/enterprise:
area/backup:
- changed-files:
- any-glob-to-any-file: ee/**
- any-glob-to-any-file: backup/**

area/enterprise/backup:
area/acl:
- changed-files:
- any-glob-to-any-file: ee/backup/**

area/enterprise/acl:
- changed-files:
- any-glob-to-any-file: ee/acl/**
- any-glob-to-any-file: acl/**

area/schema:
- changed-files:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-dgraph-core-upgrade-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cp dgraph/dgraph ~/go/bin/dgraph
# run the core upgrade tests
go test -v -timeout=120m -failfast -tags=upgrade \
github.com/hypermodeinc/dgraph/v24/ee/acl \
github.com/hypermodeinc/dgraph/v24/acl \
github.com/hypermodeinc/dgraph/v24/worker \
github.com/hypermodeinc/dgraph/v24/query
# clean up docker containers after test execution
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"--security",
"whitelist=0.0.0.0/0;",
"--acl",
"secret-file=../ee/acl/hmac-secret; access-ttl=300000s;"
"secret-file=../acl/hmac-secret; access-ttl=300000s;"
],
"showLog": true
}
Expand Down
16 changes: 0 additions & 16 deletions LICENSE.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion ee/acl/acl.go → acl/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func chMod(conf *viper.Viper) error {
if !ok {
return errors.New("Malformed output of groupUIDCount")
} else if uidCount == 0 {
// We already have a check for multiple groups with same name at dgraph/ee/acl/utils.go:142
// We already have a check for multiple groups with same name at dgraph/acl/utils.go:142
return errors.Errorf("Group <%s> doesn't exist", groupName)
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions ee/acl/acl_curl_test.go → acl/acl_curl_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !oss && integration
// +build !oss,integration
//go:build integration
// +build integration

/*
* SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
Expand Down
File renamed without changes.
42 changes: 2 additions & 40 deletions ee/acl/acl_test.go → acl/acl_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build (!oss && integration) || upgrade
// +build !oss,integration upgrade
//go:build integration || upgrade
// +build integration upgrade

/*
* SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
Expand Down Expand Up @@ -462,34 +462,6 @@
}`
)

func checkUserCount(t *testing.T, resp []byte, expected int) {
type Response struct {
AddUser struct {
User []struct {
Name string
}
}
}

var r Response
require.NoError(t, json.Unmarshal(resp, &r))
require.Equal(t, expected, len(r.AddUser.User))
}

func checkGroupCount(t *testing.T, resp []byte, expected int) {
type Response struct {
AddGroup struct {
Group []struct {
Name string
}
}
}

var r Response
require.NoError(t, json.Unmarshal(resp, &r))
require.Equal(t, expected, len(r.AddGroup.Group))
}

func (asuite *AclTestSuite) TestGetCurrentUser() {
t := asuite.T()

Expand Down Expand Up @@ -733,16 +705,16 @@
supported, err := dgraphtest.IsHigherVersion(clusterVersion, "532df27a09ba25f88687bab344e3add2b81b5c23")
require.NoError(t, err)
if supported {
require.NoError(t, dg.Alter(ctx, &api.Operation{

Check failure on line 708 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: dg.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
Schema: "dgraph.xid: string @index(exact) @upsert @unique .",
}))
} else {
require.NoError(t, dg.Alter(ctx, &api.Operation{

Check failure on line 712 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: dg.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
Schema: "dgraph.xid: string @index(exact) @upsert .",
}))
}

err = dg.Alter(ctx, &api.Operation{Schema: "dgraph.xid: int ."})

Check failure on line 717 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: dg.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
require.Error(t, err)
require.Contains(t, err.Error(), "predicate dgraph.xid is pre-defined and is not allowed to be modified")

Expand Down Expand Up @@ -809,7 +781,7 @@
}

func alterPredicateWithUserAccount(t *testing.T, gc *dgraphapi.GrpcClient, shouldFail bool) {
err := gc.Alter(context.Background(), &api.Operation{Schema: fmt.Sprintf(`%s: int .`, predicateToAlter)})

Check failure on line 784 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: gc.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
if shouldFail {
require.Error(t, err, "the alter should have failed")
} else {
Expand All @@ -823,7 +795,7 @@
dgraphapi.DefaultPassword, x.GalaxyNamespace))

require.NoError(t, gc.DropAll(), "Unable to cleanup db")
require.NoError(t, gc.Alter(context.Background(), &api.Operation{

Check failure on line 798 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: gc.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
Schema: fmt.Sprintf(`%s: string @index(exact) .`, predicateToRead),
}))
// wait for 5 seconds to ensure the new acl have reached all acl caches
Expand All @@ -837,16 +809,6 @@
require.NoError(t, err)
}

type rule struct {
Predicate string `json:"predicate"`
Permission int32 `json:"permission"`
}

type group struct {
Name string `json:"name"`
Rules []rule `json:"rules"`
}

func createGroupAndAcls(t *testing.T, group string, addUserToGroup bool, hc *dgraphapi.HTTPClient) {
// create a new group
createdGroup, err := hc.CreateGroup(group)
Expand Down Expand Up @@ -985,7 +947,7 @@

unAuthPred := "unauthorizedPredicate"
op := api.Operation{Schema: fmt.Sprintf("%s: string @index(exact) .", unAuthPred)}
require.NoError(t, gc.Alter(ctx, &op))

Check failure on line 950 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: gc.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.

hc, err := asuite.dc.HTTPClient()
require.NoError(t, err)
Expand Down Expand Up @@ -1042,7 +1004,7 @@

require.NoError(t, gc.DropAll())
op := api.Operation{Schema: "unauthpred: string @index(exact) ."}
require.NoError(t, gc.Dgraph.Alter(ctx, &op))

Check failure on line 1007 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: gc.Dgraph.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.

user, err := hc.CreateUser("guardian", "guardianpass")
require.NoError(t, err)
Expand Down Expand Up @@ -1085,7 +1047,7 @@
require.Contains(t, string(resp.GetJson()), "uid")

op = api.Operation{Schema: "unauthpred: int ."}
require.NoError(t, gClient.Alter(ctx, &op), "Error while altering unauthorized predicate")

Check failure on line 1050 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: gClient.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.

hc, err = asuite.dc.HTTPClient()
require.NoError(t, err)
Expand Down Expand Up @@ -2771,20 +2733,20 @@
require.NoError(t, err)
require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
dgraphapi.DefaultPassword, x.GalaxyNamespace))
userClient, cancel, err := asuite.dc.Client()

Check failure on line 2736 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(ineffassign)

[new] ineffectual assignment to cancel
defer cleanup()
require.NoError(t, err)
require.NoError(t, userClient.LoginIntoNamespace(ctx, userid, userpassword, x.GalaxyNamespace))

// Alice doesn't have access to create new predicate.
err = userClient.Alter(ctx, &api.Operation{Schema: `newpred: string .`})

Check failure on line 2742 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: userClient.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
require.Error(t, err, "User can't create new predicate. Alter should have returned error.")

require.NoError(t, hc.AddUserToGroup(userid, "guardians"))
time.Sleep(expireJwtSleep)

// Alice is a guardian now, it can create new predicate.
err = userClient.Alter(ctx, &api.Operation{

Check failure on line 2749 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: userClient.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
Schema: `newpred: string .`,
})
require.NoError(t, err, "User is a guardian. Alter should have succeeded.")
Expand Down Expand Up @@ -2880,12 +2842,12 @@
"Mutation test failed for: "+user+", shouldFail: "+strconv.FormatBool(shouldFail))
}
dgAlter := func(client *dgraphapi.GrpcClient, shouldFail bool, user string) {
err := client.Alter(ctx, &api.Operation{Schema: `newpred: string @index(exact) .`})

Check failure on line 2845 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: client.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
require.True(t, (err != nil) == shouldFail,
"Alter test failed for: "+user+", shouldFail: "+strconv.FormatBool(shouldFail))

// set back the schema to initial value
err = client.Alter(ctx, &api.Operation{Schema: `newpred: string .`})

Check failure on line 2850 in acl/acl_test.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(staticcheck)

[new] SA1019: client.Alter is deprecated: use DropAllNamespaces, DropAll, DropData, DropPredicate, DropType, SetSchema instead.
require.True(t, (err != nil) == shouldFail,
"Alter test failed for: "+user+", shouldFail: "+strconv.FormatBool(shouldFail))
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ee/acl/run.go → acl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const defaultGroupList = "dgraph-unused-group"
func init() {
CmdAcl.Cmd = &cobra.Command{
Use: "acl",
Short: "Run the Dgraph Enterprise Edition ACL tool",
Short: "Run the Dgraph ACL tool",
Annotations: map[string]string{"group": "security"},
}
CmdAcl.Cmd.SetHelpTemplate(x.NonRootTemplate)
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 1 addition & 5 deletions ee/audit/audit.go → audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ func readAuditEncKey(conf *z.SuperFlag) ([]byte, error) {
return encKey, nil
}

// InitAuditorIfNecessary accepts conf and enterprise edition check function.
// This method keep tracks whether cluster is part of enterprise edition or not.
// It pools eeEnabled function every five minutes to check if the license is still valid or not.
// InitAuditorIfNecessary accepts conf and initialized auditor.
func InitAuditorIfNecessary(conf *x.LoggerConf) error {
if conf == nil {
return nil
Expand All @@ -99,8 +97,6 @@ func InitAuditorIfNecessary(conf *x.LoggerConf) error {
}

// InitAuditor initializes the auditor.
// This method doesnt keep track of whether cluster is part of enterprise edition or not.
// Client has to keep track of that.
func InitAuditor(conf *x.LoggerConf, gId, nId uint64) error {
ntype := NodeTypeAlpha
if gId == 0 {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions ee/backup/run.go → backup/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

bpb "github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/ristretto/v2/z"
"github.com/hypermodeinc/dgraph/v24/ee"
"github.com/hypermodeinc/dgraph/v24/posting"
"github.com/hypermodeinc/dgraph/v24/protos/pb"
"github.com/hypermodeinc/dgraph/v24/worker"
Expand Down Expand Up @@ -62,9 +61,9 @@ func init() {
func initRestore() {
Restore.Cmd = &cobra.Command{
Use: "restore",
Short: "Restore backup from Dgraph Enterprise Edition",
Short: "Restore backup from Dgraph",
Long: `
Restore loads objects created with the backup feature in Dgraph Enterprise Edition (EE).
Restore loads objects created with the backup.
Backups are originated from HTTP at /admin/backup, then can be restored using CLI restore
command. Restore is intended to be used with new Dgraph clusters in offline state.
The --location flag indicates a source URI with Dgraph backup objects. This URI supports all
Expand Down Expand Up @@ -135,7 +134,7 @@ $ dgraph restore -p . -l /var/backups/dgraph -z localhost:5080
"update the timestamp and max uid when you start the cluster. The correct values are "+
"printed near the end of this command's output.")
x.RegisterClientTLSFlags(flag)
ee.RegisterEncFlag(flag)
x.RegisterEncFlag(flag)
_ = Restore.Cmd.MarkFlagRequired("postings")
_ = Restore.Cmd.MarkFlagRequired("location")
}
Expand Down Expand Up @@ -164,7 +163,7 @@ func initBackupLs() {
}

func runRestoreCmd() error {
keys, err := ee.GetKeys(Restore.Conf)
keys, err := x.GetEncAclKeys(Restore.Conf)
if err != nil {
return err
}
Expand Down Expand Up @@ -324,7 +323,7 @@ func initExportBackup() {
`If true, retrieve the CORS from DB and append at the end of GraphQL schema.
It also deletes the deprecated types and predicates.
Use this option when exporting a backup of 20.11 for loading onto 21.03.`)
ee.RegisterEncFlag(flag)
x.RegisterEncFlag(flag)
}

type bufWriter struct {
Expand Down Expand Up @@ -388,7 +387,7 @@ func (bw *bufWriter) Write(buf *z.Buffer) error {
}

func runExportBackup() error {
keys, err := ee.GetKeys(ExportBackup.Conf)
keys, err := x.GetEncAclKeys(ExportBackup.Conf)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion chunker/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/pkg/errors"

"github.com/hypermodeinc/dgraph/v24/ee/enc"
"github.com/hypermodeinc/dgraph/v24/enc"
"github.com/hypermodeinc/dgraph/v24/lex"
"github.com/hypermodeinc/dgraph/v24/x"
)
Expand Down
3 changes: 0 additions & 3 deletions dgraph/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ BUILD_FLAGS ?= -ldflags '-X ${lastCommitSHA}=${BUILD} -X "${lastCommitTime}=${
# Insert build tags if specified
ifneq ($(strip $(BUILD_TAGS)),)
BUILD_FLAGS += -tags '$(BUILD_TAGS)'
ifneq (,$(findstring oss,$(BUILD_TAGS)))
BUILD_VERSION := $(BUILD_VERSION)-oss
endif
endif

# Build with compiler optimizations disabled, which will help debugging with dlv.
Expand Down
1 change: 1 addition & 0 deletions dgraph/cmd/alpha/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) {
jwt := &api.Jwt{}
if err := proto.Unmarshal(resp.Json, jwt); err != nil {
x.SetStatusWithData(w, x.Error, err.Error())
return
}

response := map[string]interface{}{}
Expand Down
8 changes: 3 additions & 5 deletions dgraph/cmd/alpha/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ import (
apiv25 "github.com/dgraph-io/dgo/v240/protos/api.v25"
_ "github.com/dgraph-io/gqlparser/v2/validator/rules" // make gql validator init() all rules
"github.com/dgraph-io/ristretto/v2/z"
"github.com/hypermodeinc/dgraph/v24/audit"
"github.com/hypermodeinc/dgraph/v24/edgraph"
"github.com/hypermodeinc/dgraph/v24/ee"
"github.com/hypermodeinc/dgraph/v24/ee/audit"
"github.com/hypermodeinc/dgraph/v24/graphql/admin"
"github.com/hypermodeinc/dgraph/v24/posting"
"github.com/hypermodeinc/dgraph/v24/schema"
Expand Down Expand Up @@ -95,7 +94,7 @@ they form a Raft group and provide synchronous replication.
// --tls SuperFlag
x.RegisterServerTLSFlags(flag)
// --encryption and --vault Superflag
ee.RegisterAclAndEncFlags(flag)
x.RegisterAclAndEncFlags(flag)

flag.StringP("postings", "p", "p", "Directory to store posting lists.")
flag.String("tmp", "t", "Directory to store temporary buffers.")
Expand Down Expand Up @@ -605,7 +604,6 @@ func setupServer(closer *z.Closer) {
// Therefore we wait for the cluster initialization to be done.
for {
if x.HealthCheck() == nil {
// Audit is enterprise feature.
x.Check(audit.InitAuditorIfNecessary(worker.Config.Audit))
break
}
Expand Down Expand Up @@ -659,7 +657,7 @@ func run() {
TypeFilterUidLimit: x.Config.Limit.GetUint64("type-filter-uid-limit"),
}

keys, err := ee.GetKeys(Alpha.Conf)
keys, err := x.GetEncAclKeys(Alpha.Conf)
x.Check(err)

if keys.AclSecretKey != nil {
Expand Down
4 changes: 2 additions & 2 deletions dgraph/cmd/bulk/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/y"
"github.com/hypermodeinc/dgraph/v24/chunker"
"github.com/hypermodeinc/dgraph/v24/ee/enc"
"github.com/hypermodeinc/dgraph/v24/enc"
"github.com/hypermodeinc/dgraph/v24/filestore"
gqlSchema "github.com/hypermodeinc/dgraph/v24/graphql/schema"
"github.com/hypermodeinc/dgraph/v24/protos/pb"
Expand Down Expand Up @@ -71,7 +71,7 @@ type options struct {
shardOutputDirs []string

// ........... Badger options ..........
// EncryptionKey is the key used for encryption. Enterprise only feature.
// EncryptionKey is the key used for encryption.
EncryptionKey x.Sensitive
// Badger options.
Badger badger.Options
Expand Down
2 changes: 1 addition & 1 deletion dgraph/cmd/bulk/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"github.com/dgraph-io/dgo/v240/protos/api"
"github.com/dgraph-io/ristretto/v2/z"
"github.com/hypermodeinc/dgraph/v24/acl"
"github.com/hypermodeinc/dgraph/v24/chunker"
"github.com/hypermodeinc/dgraph/v24/dql"
"github.com/hypermodeinc/dgraph/v24/ee/acl"
"github.com/hypermodeinc/dgraph/v24/posting"
"github.com/hypermodeinc/dgraph/v24/protos/pb"
"github.com/hypermodeinc/dgraph/v24/tok"
Expand Down
5 changes: 2 additions & 3 deletions dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/ristretto/v2/z"
"github.com/hypermodeinc/dgraph/v24/ee"
"github.com/hypermodeinc/dgraph/v24/filestore"
"github.com/hypermodeinc/dgraph/v24/protos/pb"
"github.com/hypermodeinc/dgraph/v24/tok"
Expand Down Expand Up @@ -121,7 +120,7 @@ func init() {

x.RegisterClientTLSFlags(flag)
// Encryption and Vault options
ee.RegisterEncFlag(flag)
x.RegisterEncFlag(flag)
}

func run() {
Expand All @@ -131,7 +130,7 @@ func run() {

bopts := badger.DefaultOptions("").FromSuperFlag(BulkBadgerDefaults + cacheDefaults).
FromSuperFlag(Bulk.Conf.GetString("badger"))
keys, err := ee.GetKeys(Bulk.Conf)
keys, err := x.GetEncAclKeys(Bulk.Conf)
x.Check(err)

opt := options{
Expand Down
5 changes: 2 additions & 3 deletions dgraph/cmd/debug/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
bpb "github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/ristretto/v2/z"
"github.com/hypermodeinc/dgraph/v24/codec"
"github.com/hypermodeinc/dgraph/v24/ee"
"github.com/hypermodeinc/dgraph/v24/posting"
"github.com/hypermodeinc/dgraph/v24/protos/pb"
"github.com/hypermodeinc/dgraph/v24/raftwal"
Expand Down Expand Up @@ -106,7 +105,7 @@ func init() {
"Set snapshot term,index,readts to this. Value must be comma-separated list containing"+
" the value for these vars in that order.")
flag.StringVar(&opt.parseKey, "parse_key", "", "Parse hex key.")
ee.RegisterEncFlag(flag)
x.RegisterEncFlag(flag)
}

func toInt(o *pb.Posting) int {
Expand Down Expand Up @@ -986,7 +985,7 @@ func run() {
dir = opt.wdir
isWal = true
}
keys, err := ee.GetKeys(Debug.Conf)
keys, err := x.GetEncAclKeys(Debug.Conf)
x.Check(err)
opt.key = keys.EncKey

Expand Down
7 changes: 3 additions & 4 deletions dgraph/cmd/decrypt/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
"github.com/golang/glog"
"github.com/spf13/cobra"

"github.com/hypermodeinc/dgraph/v24/ee"
"github.com/hypermodeinc/dgraph/v24/ee/enc"
"github.com/hypermodeinc/dgraph/v24/enc"
"github.com/hypermodeinc/dgraph/v24/x"
)

Expand Down Expand Up @@ -43,10 +42,10 @@ func init() {
flag := Decrypt.Cmd.Flags()
flag.StringP("file", "f", "", "Path to file to decrypt.")
flag.StringP("out", "o", "", "Path to the decrypted file.")
ee.RegisterEncFlag(flag)
x.RegisterEncFlag(flag)
}
func run() {
keys, err := ee.GetKeys(Decrypt.Conf)
keys, err := x.GetEncAclKeys(Decrypt.Conf)
x.Check(err)
if len(keys.EncKey) == 0 {
glog.Fatal("Error while reading encryption key: Key is empty")
Expand Down
Loading