-
Notifications
You must be signed in to change notification settings - Fork 9
/
data.go
30 lines (25 loc) · 786 Bytes
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package csprcollector
import "time"
type CSPReport struct {
DocumentUri string `json:"document-uri"`
Referrer string `json:"referrer"`
ViolatedDirective string `json:"violated-directive"`
EffectiveDirective string `json:"effective-directive"`
OriginalPolicy string `json:"original-policy"`
Disposition string `json:"disposition"`
BlockedUri string `json:"blocked-uri"`
StatusCode int `json:"status-code"`
ScriptSample string `json:"script-sample"`
Occurred time.Time `json:"occurred"`
}
func NewCSPRequest() CSPRequest {
report := CSPRequest{
Report: CSPReport{
Occurred: time.Now(),
},
}
return report
}
type CSPRequest struct {
Report CSPReport `json:"csp-report"`
}