-
-
Notifications
You must be signed in to change notification settings - Fork 647
Add Evidence Management Dashboard #5057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/bod-candidate-transparency
Are you sure you want to change the base?
Changes from all commits
b4f565b
731811c
1af6996
bd4a54a
e80f85e
a15bf82
ab08b9c
3d5f326
625db7b
867c94f
974318e
3d65c52
88af465
b5e6c6d
497af6c
00ae269
79d1a7c
bb605c7
93a7d07
6370b08
4157b4e
f0112e9
d68477c
7b56553
6fe2194
c6ea05b
fd34abb
6fbd993
8f4fe72
640208f
55466a9
b502f9b
ee4005b
bcc61fa
9c34d81
2caede4
29097a0
a2073d2
4808531
1c3c434
1ba8581
3eff335
719325c
71fa26b
abc3ec6
1de83ec
2c6eb8b
bebd592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| export const authCookies = [ | ||
| { | ||
| name: 'csrftoken', | ||
| value: 'abc123', | ||
| domain: 'localhost', | ||
| path: '/', | ||
| }, | ||
| { | ||
| name: 'nest.session-id', | ||
| value: 'test-session-id', | ||
| domain: 'localhost', | ||
| path: '/', | ||
| }, | ||
| { | ||
| name: 'next-auth.csrf-token', | ||
| value: 'test-csrf-token', | ||
| domain: 'localhost', | ||
| path: '/', | ||
| }, | ||
| { | ||
| name: 'next-auth.callback-url', | ||
| value: '/', | ||
| domain: 'localhost', | ||
| path: '/', | ||
| }, | ||
| { | ||
| name: 'next-auth.session-token', | ||
| value: 'test-session-token', | ||
| domain: 'localhost', | ||
| path: '/', | ||
| }, | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { authCookies } from './mockAuthCookies' | ||
|
|
||
| export const mockClaimAuth = async (page, mockData, login = 'testuser', operationNames?: string[]) => { | ||
| await page.route('**/api/auth/session', async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| json: { | ||
| accessToken: 'test-access-token', | ||
| expires: '2125-08-28T01:33:56.550Z', | ||
| user: { | ||
| isOwaspStaff: false, | ||
| login, | ||
| }, | ||
| }, | ||
| }) | ||
| }) | ||
| await page.route('**/graphql/', async (route, request) => { | ||
| const postData = request.postDataJSON() | ||
|
Comment on lines
+17
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\nUsages of mockClaimAuth:\n'
rg -n --type=ts --type=tsx '\bmockClaimAuth\s*\(' e2e frontend
printf '\nPotential multipart/upload GraphQL paths:\n'
rg -n --type=ts --type=tsx 'createUploadLink|multipart/form-data|FormData|Upload|postDataJSON\(' e2e frontendRepository: OWASP/Nest Length of output: 202 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Usages of mockClaimAuth ==="
rg -n '\bmockClaimAuth\s*\(' --type ts --type ts --glob "*test*" --glob "*.spec.ts" --glob "*e2e*" e2e frontend || true
echo "=== Potential multipart/upload GraphQL patterns ==="
rg -n 'createUploadLink|multipart/form-data|new FormData|Upload' --type ts e2e frontend || true
echo "=== Check mockClaimAuth definition ==="
cat -n e2e/helpers/mockClaimAuth.ts | head -40Repository: OWASP/Nest Length of output: 4932 Fix The Gate the JSON parsing behind a content-type check: const headers = request.headers()
const contentType = headers['content-type'] || ''
let postData
if (contentType.includes('application/json')) {
postData = request.postDataJSON()
} else {
// For multipart uploads, parse body as text and extract operationName manually
postData = { operationName: null }
// Alternative: skip operationName check for non-JSON or parse text body if needed
}Update the route handler to conditionally access 🤖 Prompt for AI Agents |
||
| if (postData.operationName === 'SyncDjangoSession') { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| json: { | ||
| data: { | ||
| githubAuth: { | ||
| message: 'test message', | ||
| ok: true, | ||
| user: { isOwaspStaff: false }, | ||
| }, | ||
| }, | ||
| }, | ||
| }) | ||
| } else if (operationNames && postData.operationName && !operationNames.includes(postData.operationName)) { | ||
| await route.abort('aborted') | ||
| } else { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| json: { data: mockData }, | ||
| }) | ||
| } | ||
| }) | ||
| await page.context().addCookies(authCookies) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
Assert the
evidence_existsannotation, not just the chain.These tests now only stub
annotate(), so they will still pass ifboard_candidate_claimsstops annotating and the dashboard falls back to one.exists()query per claim. Please assert thatannotateis called with anevidence_existskwarg to lock in the optimization contract.Also applies to: 52-53, 73-74
🤖 Prompt for AI Agents