-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from WSE-research/70-create-analysemavenlist-p…
…ost-endpoint 70 create analysemavenlist post endpoint
- Loading branch information
Showing
33 changed files
with
8,603 additions
and
1,126 deletions.
There are no files selected for viewing
810 changes: 406 additions & 404 deletions
810
code/AmIVulnerable/AmIVulnerable/Controllers/DbController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
577 changes: 289 additions & 288 deletions
577
code/AmIVulnerable/AmIVulnerable/Controllers/DependeciesController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
702 changes: 354 additions & 348 deletions
702
code/AmIVulnerable/AmIVulnerable/Controllers/GitController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
590 changes: 590 additions & 0 deletions
590
code/AmIVulnerable/AmIVulnerable/Controllers/MetricController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
82 changes: 41 additions & 41 deletions
82
code/AmIVulnerable/AmIVulnerable/Controllers/MySqlConnectionController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using MySql.Data.MySqlClient; | ||
using SerilogTimings; | ||
using System.Data; | ||
|
||
namespace AmIVulnerable.Controllers { | ||
|
||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class MySqlConnectionController : ControllerBase { | ||
|
||
private readonly IConfiguration Configuration; | ||
|
||
public MySqlConnectionController(IConfiguration configuration) { | ||
Configuration = configuration; | ||
} | ||
|
||
[HttpGet, Route("checkReachable")] | ||
public IActionResult PingWithDb() { | ||
using (Operation.Time("TaskDuration")) { | ||
try { | ||
MySqlConnection c = new MySqlConnection(Configuration["ConnectionStrings:cvedb"]); | ||
|
||
MySqlCommand cmd = new MySqlCommand("SELECT cve_number, designation FROM cve.cve", c); | ||
|
||
c.Open(); | ||
MySqlDataReader reader = cmd.ExecuteReader(); | ||
DataTable dataTable = new DataTable(); | ||
dataTable.Load(reader); | ||
reader.Close(); | ||
c.Close(); | ||
|
||
return Ok(); | ||
} | ||
catch (Exception ex) { | ||
return BadRequest(ex.StackTrace!.ToString()); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
//using Microsoft.AspNetCore.Mvc; | ||
//using MySql.Data.MySqlClient; | ||
//using SerilogTimings; | ||
//using System.Data; | ||
|
||
//namespace AmIVulnerable.Controllers { | ||
|
||
// //[Route("api/[controller]")] | ||
// //[ApiController] | ||
// public class MySqlConnectionController : ControllerBase { | ||
|
||
// private readonly IConfiguration Configuration; | ||
|
||
// public MySqlConnectionController(IConfiguration configuration) { | ||
// Configuration = configuration; | ||
// } | ||
|
||
// //[HttpGet, Route("checkReachable")] | ||
// public IActionResult PingWithDb() { | ||
// using (Operation.Time("TaskDuration")) { | ||
// try { | ||
// MySqlConnection c = new MySqlConnection(Configuration["ConnectionStrings:cvedb"]); | ||
|
||
// MySqlCommand cmd = new MySqlCommand("SELECT cve_number, designation FROM cve.cve", c); | ||
|
||
// c.Open(); | ||
// MySqlDataReader reader = cmd.ExecuteReader(); | ||
// DataTable dataTable = new DataTable(); | ||
// dataTable.Load(reader); | ||
// reader.Close(); | ||
// c.Close(); | ||
|
||
// return Ok(); | ||
// } | ||
// catch (Exception ex) { | ||
// return BadRequest(ex.StackTrace!.ToString()); | ||
// } | ||
// } | ||
// } | ||
// } | ||
//} |
Oops, something went wrong.