From 5a75e6eca789665fb08eeaa7f440387a92583096 Mon Sep 17 00:00:00 2001 From: Edoardo Rosa <6991986+notdodo@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:00:37 +0100 Subject: [PATCH] fix: gosec (#42) --- pkg/infra/neo4j/neo4j_client.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/infra/neo4j/neo4j_client.go b/pkg/infra/neo4j/neo4j_client.go index ce4c587..9f97274 100644 --- a/pkg/infra/neo4j/neo4j_client.go +++ b/pkg/infra/neo4j/neo4j_client.go @@ -32,15 +32,14 @@ type neo4jClient struct { log logging.LogManager } -/* #nosec */ //nolint:all func (c *neo4jClient) setUpDb(session neo4j.SessionWithContext) { c.log.Info("Flushing the database") - session.Run(context.TODO(), "MATCH (n) DETACH DELETE n;", nil) + session.Run(context.TODO(), "MATCH (n) DETACH DELETE n;", nil) // #nosec G104 c.log.Info("Creating indexes") - session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (u:User) REQUIRE u.User_Id IS UNIQUE;", nil) - session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (g:Group) REQUIRE g.Group_Id IS UNIQUE;", nil) - session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (r:Rule) REQUIRE r.GroupRule_Id IS UNIQUE;", nil) + session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (u:User) REQUIRE u.User_Id IS UNIQUE;", nil) // #nosec G104 + session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (g:Group) REQUIRE g.Group_Id IS UNIQUE;", nil) // #nosec G104 + session.Run(context.TODO(), "CREATE CONSTRAINT IF NOT EXISTS FOR (r:Rule) REQUIRE r.GroupRule_Id IS UNIQUE;", nil) // #nosec G104 } func NewNeo4jClient(dbUri, username, password string) Neo4jClient {