-
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.
* feat(style): CVSS calc layout * feat: tab persist on refresh for issue page * chore: refactor for dependency graph --------- Co-authored-by: Christopher Langton <[email protected]>
- Loading branch information
1 parent
944823e
commit bfbecde
Showing
44 changed files
with
13,485 additions
and
8,722 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- checksum: c738bdb53e1c886dfa387a0b25416449be043d008547da8e31237a9673e84c838084af8df4872a609b90684fce1650d6af69329884856698341da9ee7f9775e0 | ||
path: .yarn/plugins/@yarnpkg/plugin-cyclonedx.cjs | ||
spec: "https://github.com/CycloneDX/cyclonedx-node-yarn/releases/latest/download/yarn-plugin-cyclonedx.cjs" | ||
- checksum: 006d0325e832b7267fa88084a62d319de313ca2541dca62f8fea3125f095a4cc1b8791897f1d803d38179a972aa2152533d11525e463fb8073ca358ee8601f44 | ||
path: .yarn/plugins/@yarnpkg/plugin-spdx.cjs | ||
spec: "https://raw.githubusercontent.com/spdx/yarn-plugin-spdx/main/bundles/@yarnpkg/plugin-spdx.js" |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { AuthResult, Server } from "@/utils"; | ||
import { PrismaD1 } from '@prisma/adapter-d1'; | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
export async function onRequestGet(context) { | ||
const { | ||
request, // same as existing Worker API | ||
env, // same as existing Worker API | ||
params, // if filename includes [id] or [[path]] | ||
waitUntil, // same as ctx.waitUntil in existing Worker API | ||
next, // used for middleware or to fetch assets | ||
data, // arbitrary space for passing data between middlewares | ||
} = context | ||
try { | ||
const adapter = new PrismaD1(env.d1db) | ||
const prisma = new PrismaClient({ | ||
adapter, | ||
transactionOptions: { | ||
maxWait: 1500, // default: 2000 | ||
timeout: 2000, // default: 5000 | ||
}, | ||
}) | ||
const verificationResult = await (new Server(request, prisma)).authenticate() | ||
if (!verificationResult.isValid) { | ||
return Response.json({ ok: false, result: verificationResult.message }) | ||
} | ||
const { searchParams } = new URL(request.url) | ||
const take = parseInt(searchParams.get('take'), 10) || 50 | ||
const skip = parseInt(searchParams.get('skip'), 10) || 0 | ||
const findings = await prisma.Finding.findMany({ | ||
where: { | ||
orgId: verificationResult.session.orgId, | ||
AND: { | ||
triage: { | ||
some: { analysisState: { in: ['resolved', 'resolved_with_pedigree', 'false_positive', 'not_affected'] } } | ||
} | ||
}, | ||
}, | ||
include: { | ||
triage: { | ||
orderBy: { | ||
triagedAt: 'desc' | ||
} | ||
}, | ||
spdx: { | ||
include: { | ||
repo: true | ||
} | ||
}, | ||
cdx: { | ||
include: { | ||
repo: true | ||
} | ||
}, | ||
}, | ||
take, | ||
skip, | ||
orderBy: { | ||
modifiedAt: 'desc', | ||
} | ||
}) | ||
|
||
return Response.json({ | ||
ok: true, findings: findings.map(finding => { | ||
finding.references = JSON.parse(finding.referencesJSON) | ||
delete finding.referencesJSON | ||
finding.aliases = JSON.parse(finding.aliases) | ||
finding.cwes = JSON.parse(finding.cwes) | ||
return finding | ||
}) | ||
}) | ||
} catch (err) { | ||
console.error(err) | ||
return Response.json({ ok: false, error: { message: err }, result: AuthResult.REVOKED }) | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.