|
| 1 | +// Dummy data for the technical review queue, used when backend is unavailable |
| 2 | + |
| 3 | +export type DelphiReportSeverity = 'LOW' | 'MEDIUM' | 'HIGH' | 'SEVERE' |
| 4 | +export type DelphiReportIssueStatus = 'pending' | 'approved' | 'rejected' |
| 5 | + |
| 6 | +export interface DelphiIssueJavaClass { |
| 7 | + id: number |
| 8 | + issue_id: number |
| 9 | + internal_class_name: string |
| 10 | + decompiled_source?: string | null |
| 11 | +} |
| 12 | + |
| 13 | +export interface DelphiReportSummary { |
| 14 | + id: number |
| 15 | + file_id?: number | null |
| 16 | + delphi_version: number |
| 17 | + artifact_url: string |
| 18 | + created: string // ISO date |
| 19 | + severity: DelphiReportSeverity |
| 20 | +} |
| 21 | + |
| 22 | +export interface DelphiIssueSummary { |
| 23 | + id: number |
| 24 | + report_id: number |
| 25 | + issue_type: string |
| 26 | + status: DelphiReportIssueStatus |
| 27 | +} |
| 28 | + |
| 29 | +export interface DelphiIssueResult { |
| 30 | + issue: DelphiIssueSummary |
| 31 | + report: DelphiReportSummary |
| 32 | + java_classes: DelphiIssueJavaClass[] |
| 33 | + project_id?: number | null |
| 34 | + project_published?: string | null |
| 35 | +} |
| 36 | + |
| 37 | +export const DUMMY_ISSUE_TYPES: string[] = [ |
| 38 | + 'reflection_indirection', |
| 39 | + 'xor_obfuscation', |
| 40 | + 'included_libraries', |
| 41 | + 'suspicious_binaries', |
| 42 | + 'corrupt_classes', |
| 43 | + 'suspicious_classes', |
| 44 | + 'url_usage', |
| 45 | + 'classloader_usage', |
| 46 | + 'processbuilder_usage', |
| 47 | + 'runtime_exec_usage', |
| 48 | + 'jni_usage', |
| 49 | + 'main_method', |
| 50 | + 'native_loading', |
| 51 | + 'malformed_jar', |
| 52 | + 'nested_jar_too_deep', |
| 53 | + 'failed_decompilation', |
| 54 | + 'analysis_failure', |
| 55 | + 'malware_easyforme', |
| 56 | + 'malware_simplyloader', |
| 57 | +] |
| 58 | + |
| 59 | +export const DUMMY_ISSUES: DelphiIssueResult[] = [ |
| 60 | + { |
| 61 | + issue: { |
| 62 | + id: 1001, |
| 63 | + report_id: 501, |
| 64 | + issue_type: 'suspicious_classes', |
| 65 | + status: 'pending', |
| 66 | + }, |
| 67 | + report: { |
| 68 | + id: 501, |
| 69 | + file_id: 90001, |
| 70 | + delphi_version: 47, |
| 71 | + artifact_url: 'https://cdn.modrinth.com/data/abc/versions/1.0.0.jar', |
| 72 | + created: new Date(Date.now() - 3 * 24 * 3600 * 1000).toISOString(), |
| 73 | + severity: 'SEVERE', |
| 74 | + }, |
| 75 | + java_classes: [ |
| 76 | + { |
| 77 | + id: 7001, |
| 78 | + issue_id: 1001, |
| 79 | + internal_class_name: 'com/example/Suspect', |
| 80 | + decompiled_source: 'public class Suspect { /* ... */ }', |
| 81 | + }, |
| 82 | + ], |
| 83 | + project_id: 123456, |
| 84 | + project_published: new Date(Date.now() - 30 * 24 * 3600 * 1000).toISOString(), |
| 85 | + }, |
| 86 | + { |
| 87 | + issue: { |
| 88 | + id: 1002, |
| 89 | + report_id: 502, |
| 90 | + issue_type: 'url_usage', |
| 91 | + status: 'pending', |
| 92 | + }, |
| 93 | + report: { |
| 94 | + id: 502, |
| 95 | + file_id: 90002, |
| 96 | + delphi_version: 47, |
| 97 | + artifact_url: 'https://cdn.modrinth.com/data/def/versions/2.3.4.jar', |
| 98 | + created: new Date(Date.now() - 1 * 24 * 3600 * 1000).toISOString(), |
| 99 | + severity: 'HIGH', |
| 100 | + }, |
| 101 | + java_classes: [], |
| 102 | + project_id: 789012, |
| 103 | + project_published: new Date(Date.now() - 45 * 24 * 3600 * 1000).toISOString(), |
| 104 | + }, |
| 105 | +] |
0 commit comments