1+ using System . ComponentModel . DataAnnotations ;
2+
3+ namespace UmbracoWeb . Models ;
4+
5+ /// <summary>
6+ /// Request model for submitting a phishing incident
7+ /// </summary>
8+ public class PhishLabsIncidentRequest
9+ {
10+ /// <summary>
11+ /// The suspicious URL to report
12+ /// </summary>
13+ [ Required ( ErrorMessage = "URL is required" ) ]
14+ [ Url ( ErrorMessage = "Please enter a valid URL" ) ]
15+ [ StringLength ( 2048 , ErrorMessage = "URL cannot exceed 2048 characters" ) ]
16+ public string Url { get ; set ; } = string . Empty ;
17+
18+ /// <summary>
19+ /// Optional details about the incident (max 1000 characters)
20+ /// </summary>
21+ [ StringLength ( 1000 , ErrorMessage = "Details cannot exceed 1000 characters" ) ]
22+ public string ? Details { get ; set ; }
23+ }
24+
25+ /// <summary>
26+ /// Response model for PhishLabs incident submission
27+ /// </summary>
28+ public class PhishLabsIncidentResponse
29+ {
30+ /// <summary>
31+ /// Indicates if the submission was successful
32+ /// </summary>
33+ public bool Success { get ; set ; }
34+
35+ /// <summary>
36+ /// Correlation ID for tracking the request
37+ /// </summary>
38+ public string CorrelationId { get ; set ; } = string . Empty ;
39+
40+ /// <summary>
41+ /// Message to display to the user
42+ /// </summary>
43+ public string Message { get ; set ; } = string . Empty ;
44+
45+ /// <summary>
46+ /// Error details if submission failed
47+ /// </summary>
48+ public string ? ErrorDetails { get ; set ; }
49+ }
50+
51+ /// <summary>
52+ /// Internal model for PhishLabs API request
53+ /// </summary>
54+ internal class PhishLabsApiRequest
55+ {
56+ public string Url { get ; set ; } = string . Empty ;
57+ public string ? Description { get ; set ; }
58+ public string Source { get ; set ; } = "umbraco-web" ;
59+ public DateTime Timestamp { get ; set ; } = DateTime . UtcNow ;
60+ }
61+
62+ /// <summary>
63+ /// Internal model for PhishLabs API response
64+ /// </summary>
65+ internal class PhishLabsApiResponse
66+ {
67+ public bool Success { get ; set ; }
68+ public string ? IncidentId { get ; set ; }
69+ public string ? Message { get ; set ; }
70+ public string ? Error { get ; set ; }
71+ }
0 commit comments