Skip to content

Commit 123f6c9

Browse files
committed
removes osv api fetching, only using osv last modified timestamp
1 parent 5889a96 commit 123f6c9

6 files changed

Lines changed: 100 additions & 892 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Copyright (C) 2026 l3montree GmbH
2+
--
3+
-- This program is free software: you can redistribute it and/or modify
4+
-- it under the terms of the GNU Affero General Public License as
5+
-- published by the Free Software Foundation, either version 3 of the
6+
-- License, or (at your option) any later version.
7+
--
8+
-- This program is distributed in the hope that it will be useful,
9+
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
-- GNU Affero General Public License for more details.
12+
--
13+
-- You should have received a copy of the GNU Affero General Public License
14+
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Copyright (C) 2026 l3montree GmbH
2+
--
3+
-- This program is free software: you can redistribute it and/or modify
4+
-- it under the terms of the GNU Affero General Public License as
5+
-- published by the Free Software Foundation, either version 3 of the
6+
-- License, or (at your option) any later version.
7+
--
8+
-- This program is distributed in the hope that it will be useful,
9+
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
-- GNU Affero General Public License for more details.
12+
--
13+
-- You should have received a copy of the GNU Affero General Public License
14+
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
16+
ALTER TABLE public.cves DROP COLUMN IF EXISTS created_at;
17+
ALTER TABLE public.cves DROP COLUMN IF EXISTS updated_at;

database/models/cve_model.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ type cveReference struct {
2929
type CVE struct {
3030
ID int64 `json:"id" gorm:"type:bigint;primaryKey;not null;"`
3131
CVE string `json:"cve" gorm:"type:text;"`
32-
CreatedAt time.Time `json:"createdAt" cve:"createdAt"`
33-
UpdatedAt time.Time `json:"updatedAt" cve:"updatedAt"`
3432
DatePublished time.Time `json:"datePublished" cve:"datePublished"`
3533
DateLastModified time.Time `json:"dateLastModified" cve:"dateLastModified"`
3634
Weaknesses []Weakness `json:"weaknesses" gorm:"foreignKey:CVEID;references:CVE;constraint:OnDelete:CASCADE;" cve:"weaknesses"`

services/csaf_service_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ func setUpVulns() (models.Asset, models.AssetVersion, models.Artifact, []models.
524524
assetVersion := models.AssetVersion{Name: "main", AssetID: asset.ID, Type: "branch", CreatedAt: time1, DefaultBranch: true, Slug: "main"}
525525
artifact := models.Artifact{ArtifactName: "pkg:devguard/testorg/testgroup/csaf-test", AssetVersionName: assetVersion.Name, AssetID: asset.ID, CreatedAt: time1}
526526

527-
cve1 := models.CVE{CVE: "GO-2026-4309", CreatedAt: time2, Description: "Test Description", CVSS: 7.50, EPSS: utils.Ptr(0.00753)}
527+
cve1 := models.CVE{CVE: "GO-2026-4309", Description: "Test Description", CVSS: 7.50, EPSS: utils.Ptr(0.00753)}
528528

529529
affectedComponent1 := models.AffectedComponent{Ecosystem: "GIT", PurlWithoutVersion: "pkg:github.com/jetbrains/kotlin", Version: utils.Ptr("v872")}
530530
affectedComponent2 := models.AffectedComponent{Ecosystem: "GIT", PurlWithoutVersion: "pkg:github.com/jetbrains/kotlin", Version: utils.Ptr("build-0.7.536")}

transformer/dependency_vuln_transformer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import (
2929
func CVEToDTO(cve models.CVE) dtos.CVEDTO {
3030
return dtos.CVEDTO{
3131
CVE: cve.CVE,
32-
CreatedAt: cve.CreatedAt,
33-
UpdatedAt: cve.UpdatedAt,
3432
DatePublished: cve.DatePublished,
3533
DateLastModified: cve.DateLastModified,
3634
Description: cve.Description,

0 commit comments

Comments
 (0)