coredata: split SCRIPT/IFRAME into tracker_resources table
Move resource tracking (scripts, iframes) out of the pattern-based tracker_patterns/detected_trackers machinery into its own tracker_resources table keyed by (banner, type, origin, path). - Add migration that creates the tracker_resource_type enum, the tracker_resources table with a unique index, drops existing SCRIPT/IFRAME rows (not yet in production), and recreates the tracker_type enum without those values. - Add TrackerResource coredata model with full CRUD, Upsert (bumps last_detected_at on conflict), list/count/move operations, filter, and order field support. - Register TrackerResourceEntityType (91) in the entity type registry. - Drop TrackerTypeScript/TrackerTypeIframe from TrackerType enum. - Update handler to use TrackerResourceType for resource detection. - Temporarily stub out resource ingestion in ReportDetectedTrackers pending the service-layer wiring in the next commit. - Drop SCRIPT/IFRAME from the GraphQL TrackerType enum. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -52,14 +52,6 @@ enum TrackerType
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIndexedDB"
|
||||
)
|
||||
SCRIPT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeScript"
|
||||
)
|
||||
IFRAME
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIframe"
|
||||
)
|
||||
}
|
||||
|
||||
enum CookieBannerOrderField
|
||||
|
||||
@@ -405,12 +405,12 @@ func (h *Handler) handleReportDetectedTrackers(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
|
||||
for _, res := range body.Resources {
|
||||
var resourceType coredata.TrackerType
|
||||
var resourceType coredata.TrackerResourceType
|
||||
switch strings.TrimSpace(res.ResourceType) {
|
||||
case "script":
|
||||
resourceType = coredata.TrackerTypeScript
|
||||
resourceType = coredata.TrackerResourceTypeScript
|
||||
case "iframe":
|
||||
resourceType = coredata.TrackerTypeIframe
|
||||
resourceType = coredata.TrackerResourceTypeIframe
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user