Skip to content

Commit 61907bf

Browse files
authored
FossGraph. Created new tables (#1930)
* FossGraph. Create new tables Closes #1929
1 parent 5104386 commit 61907bf

16 files changed

Lines changed: 230 additions & 35 deletions

File tree

db/test-data/db.changelog-insert.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<include file="file-insert.xml" relativeToChangelogFile="true"/>
3131
<include file="lnk-execution-file-insert.xml" relativeToChangelogFile="true"/>
3232
<include file="tests-source-version-insert.xml" relativeToChangelogFile="true"/>
33+
<include file="vulnerability-insert.xml" relativeToChangelogFile="true"/>
34+
<include file="vulnerability-description-insert.xml" relativeToChangelogFile="true"/>
35+
<include file="vulnerability-project-insert.xml" relativeToChangelogFile="true"/>
3336

3437
<changeSet id="add-tests-data" author="nulls">
3538
<tagDatabase tag="test-data-insert"/>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id;description;vulnerability_id
2+
1;"In Spring Security versions 5.5.6 and 5.6.3 and older unsupported versions, RegexRequestMatcher can easily be misconfigured to be bypassed on some servlet containers. Applications using RegexRequestMatcher with `.` in the regular expression are possibly vulnerable to an authorization bypass";1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id;name;url;is_open_source;vulnerability_id
2+
1;"spring-projects/spring-security";"https://github.com/spring-projects/spring-security";1;1
3+
2;"org.springframework.security:spring-security-web";"https://mvnrepository.com/artifact/org.springframework.security/spring-security-web";0;1
4+
3;"org.springframework.security:spring-security-core";"https://mvnrepository.com/artifact/org.springframework.security/spring-security-core";0;1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
7+
8+
<changeSet id="vulnerability-description-insert" author="frolov" context="dev">
9+
<loadData tableName="vulnerability_description" encoding="UTF-8" separator=";" quotchar="&quot;" file="db/test-data/sqlRequests/vulnerability-description.csv">
10+
<column header="id" name="id" type="bigint"/>
11+
<column header="vulnerability_id" name="vulnerability_id" type="bigint"/>
12+
<column header="description" name="description" type="TEXT"/>
13+
</loadData>
14+
</changeSet>
15+
16+
</databaseChangeLog>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
7+
8+
<changeSet id="vulnerability-project-insert" author="frolov" context="dev">
9+
<loadData tableName="vulnerability_project" encoding="UTF-8" separator=";" quotchar="&quot;" file="db/test-data/sqlRequests/vulnerability-project.csv">
10+
<column header="id" name="id" type="bigint"/>
11+
<column header="name" name="name" type="varchar(250)"/>
12+
<column header="url" name="url" type="varchar(250)"/>
13+
<column header="is_open_source" name="is_open_source" type="BOOLEAN"/>
14+
<column header="vulnerability_id" name="vulnerability_id" type="bigint"/>
15+
</loadData>
16+
</changeSet>
17+
18+
</databaseChangeLog>

db/v-2/tables/db.changelog-tables.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<include file="lnk-execution-file.xml" relativeToChangelogFile="true"/>
3636
<include file="tests-source-snapshot.xml" relativeToChangelogFile="true"/>
3737
<include file="tests-source-version.xml" relativeToChangelogFile="true"/>
38+
<include file="vulnerability.xml" relativeToChangelogFile="true"/>
39+
<include file="vulnerability-description.xml" relativeToChangelogFile="true"/>
40+
<include file="vulnerability-project.xml" relativeToChangelogFile="true"/>
3841

3942
<changeSet id="02-tables" author="frolov">
4043
<tagDatabase tag="v2.0-tables"/>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
7+
8+
<changeSet id="vulnerability-description-1" author="frolov" context="dev or prod">
9+
<createTable tableName="vulnerability_description">
10+
<column name="id" type="bigint" autoIncrement="true">
11+
<constraints primaryKey="true" nullable="false"/>
12+
</column>
13+
<column name="vulnerability_id" type="bigint">
14+
<constraints foreignKeyName="fk_vulnerability_description_vulnerability" references="vulnerability(id)" nullable="false" deleteCascade="true"/>
15+
</column>
16+
<column name="description" type="TEXT">
17+
<constraints nullable="false"/>
18+
</column>
19+
</createTable>
20+
</changeSet>
21+
22+
</databaseChangeLog>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
7+
8+
<changeSet id="vulnerability-project-1" author="frolov" context="dev or prod">
9+
<createTable tableName="vulnerability_project">
10+
<column name="id" type="bigint" autoIncrement="true">
11+
<constraints primaryKey="true" nullable="false"/>
12+
</column>
13+
<column name="name" type="varchar(250)">
14+
<constraints nullable="false"/>
15+
</column>
16+
<column name="url" type="varchar(250)"/>
17+
<column name="is_open_source" type="BOOLEAN" defaultValue="0"/>
18+
<column name="vulnerability_id" type="bigint">
19+
<constraints foreignKeyName="fk_vulnerability_project_vulnerability" references="vulnerability(id)" nullable="false" deleteCascade="true"/>
20+
</column>
21+
</createTable>
22+
</changeSet>
23+
24+
</databaseChangeLog>

save-cloud-common/src/commonMain/kotlin/com/saveourtool/save/entities/VulnerabilityDto.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.saveourtool.save.entities.vulnerability
2+
3+
import kotlinx.serialization.Serializable
4+
5+
/**
6+
* @property name name of vulnerability
7+
* @property progress vulnerability criticality percentage
8+
* @property projects links to projects with this vulnerability
9+
* @property description description of vulnerability
10+
*/
11+
@Serializable
12+
data class VulnerabilityDto(
13+
val name: String,
14+
val progress: Int,
15+
val description: String?,
16+
val projects: List<VulnerabilityProjectDto>,
17+
)

0 commit comments

Comments
 (0)