Skip to content

Commit

Permalink
fix: gosec (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
notdodo authored Mar 13, 2024
1 parent 191c4eb commit 5a75e6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/infra/neo4j/neo4j_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5a75e6e

Please sign in to comment.