-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Issue 2889: Support loading JSON data with live loader #2923
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
Conversation
…generic test data filenames.
… name. Improve live loader messages.
dgraph/cmd/live/run.go
Outdated
| // overwritten, but the attacker could accomplish the same thing by simply omitting the over- | ||
| // written data from the load files in the first place. | ||
| md := md5.New() | ||
| io.WriteString(md, str) |
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.
Error return value of io.WriteString is not checked (from errcheck)
dgraph/cmd/live/run.go
Outdated
| if opt.keyFields == "" { | ||
| return fmt.Errorf("No uid field found: %+v\n", nqs) | ||
| } | ||
| assignBlankId(nqs) |
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.
Error return value of assignBlankId is not checked (from errcheck)
| } | ||
| } | ||
|
|
||
| cmd[i].Start() |
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.
Error return value of (*os/exec.Cmd).Start is not checked (from errcheck)
dgraph/cmd/live/run.go
Outdated
| @@ -21,6 +21,7 @@ import ( | |||
| "bytes" | |||
| "compress/gzip" | |||
| "context" | |||
| "crypto/md5" | |||
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.
G501: Blacklisted import crypto/md5: weak cryptographic primitive (from gosec)
dgraph/cmd/live/run.go
Outdated
| // here. If an "attacker" crafted a JSON file such that a collision occurs some data may be | ||
| // overwritten, but the attacker could accomplish the same thing by simply omitting the over- | ||
| // written data from the load files in the first place. | ||
| md := md5.New() |
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.
G401: Use of weak cryptographic primitive (from gosec)
| } | ||
|
|
||
| var opt options | ||
| var tlsConf x.TLSHelperConfig | ||
|
|
||
| var Live x.SubCommand | ||
|
|
||
| var keyFields []string |
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.
File is not goimports-ed (from goimports)
…id, just pass the concatenated string to get a real uid.
This change set add support for loading JSON-formatted data using the live loader. Changes:
This change is