-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(Multi-tenancy): Add namespaces field to state #7808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
golint shows 2 issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @abhimanyusinghgaur, @manishrjain, @pawanrawal, @vmrajas, and @vvbalaji-dgraph)
graphql/admin/admin.go, line 153 at r1 (raw file):
cid: String license: License namespaces: [UInt64]
Would be good to have a comment that proto's membership state does not contain namespaces.
graphql/admin/state.go, line 83 at r1 (raw file):
// namespaces stores set of namespaces namespaces := make(map[uint64]bool)
Use map[uint64]struct{}
see https://dave.cheney.net/2014/03/25/the-empty-struct
x/keys.go, line 122 at r1 (raw file):
func ExtractNamespaceFromPredicate(predicate string) (uint64, error) { splitString := strings.Split(predicate, "-")
This function won't be needed after the JSON marshal fix. I will remove that when I merge my change #7817
* Add namespaces to state * Add tests * Fix golint errors * Address Naman's comments (cherry picked from commit d2bd832)
* Add namespaces to state * Add tests * Fix golint errors * Address Naman's comments (cherry picked from commit d2bd832)
Motivation: Currently, there is no way to query namespaces. This adds namespaces field to state. This field can be used to query list of namespaces. Note that this will output list of namespace only in case the user is an admin user (guardians of galaxy). In all other cases, it will return an empty list. (cherry picked from commit d2bd832) Co-authored-by: vmrajas <rajas@dgraph.io>
Motivation: Currently, there is no way to query namespaces. This adds namespaces field to state. This field can be used to query list of namespaces. Note that this will output list of namespace only in case the user is an admin user (guardians of galaxy). In all other cases, it will return an empty list. (cherry picked from commit d2bd832) Co-authored-by: vmrajas <rajas@dgraph.io>
Motivation:
Currently, there is no way to query namespaces. This adds namespaces field to state. This field can be used to query list of namespaces.
Note that this will output list of namespace only in case the user is an admin user (guardians of galaxy). In all other cases, it will return an empty list.
Testing:
Fixes DGRAPH-3310
This change is