Patch cypher injection vulnerability

@mattwr18 this patches the vulnerability. However we should never do
string interpolation with user input.
This commit is contained in:
Robert Schäfer 2019-06-29 13:45:37 +02:00
parent 7763083bd6
commit 4e687a06ea
2 changed files with 7 additions and 2 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