Merge pull request #935 from Human-Connection/fix_cypher_injection

Patch cypher injection vulnerability
This commit is contained in:
mattwr18 2019-07-01 12:30:31 -03:00 committed by GitHub
commit 730c18faec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -143,7 +143,7 @@ describe('users', () => {
let deleteUserVariables
let asAuthor
const deleteUserMutation = gql`
mutation($id: ID!, $resource: [String]) {
mutation($id: ID!, $resource: [Deletable]) {
DeleteUser(id: $id, resource: $resource) {
id
contributions {

View File

@ -40,7 +40,7 @@ type Mutation {
follow(id: ID!, type: FollowTypeEnum): Boolean!
# Unfollow the given Type and ID
unfollow(id: ID!, type: FollowTypeEnum): Boolean!
DeleteUser(id: ID!, resource: [String]): User
DeleteUser(id: ID!, resource: [Deletable]): User
}
type Statistics {
@ -92,6 +92,11 @@ type Report {
user: User @relation(name: "REPORTED", direction: "OUT")
}
enum Deletable {
Post
Comment
}
enum ShoutTypeEnum {
Post
Organization

View File

@ -111,7 +111,7 @@ export default {
this.$apollo
.mutate({
mutation: gql`
mutation($id: ID!, $resource: [String]) {
mutation($id: ID!, $resource: [Deletable]) {
DeleteUser(id: $id, resource: $resource) {
id
}