* ✨ Adds safelink module * ✨ Remove createdAt timestamp bloat * :rotating_lights: Fix lint issue * 🐛 Fix pagination * 🔨 Refactor safelink rule table * 🧹 Add better default * ✨ Better search params * ✨ Remove mod requirement for query rules and events * ✨ Cleanup search for queryEvents * 📝 Add changeset * :rotating_lights: Fix lint issue * 🧹 Adjust as per review feedback * ✨ Add support for sort direction in safelink rules * :rotating_lights: Fix lint issue * ✨ Split input and response object shape * :rotating_lights: Fix lint issue
126 lines
2.9 KiB
JSON
126 lines
2.9 KiB
JSON
{
|
|
"lexicon": 1,
|
|
"id": "tools.ozone.safelink.defs",
|
|
"defs": {
|
|
"event": {
|
|
"type": "object",
|
|
"description": "An event for URL safety decisions",
|
|
"required": [
|
|
"id",
|
|
"eventType",
|
|
"url",
|
|
"pattern",
|
|
"action",
|
|
"reason",
|
|
"createdBy",
|
|
"createdAt"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"description": "Auto-incrementing row ID"
|
|
},
|
|
"eventType": {
|
|
"type": "ref",
|
|
"ref": "#eventType"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "The URL that this rule applies to"
|
|
},
|
|
"pattern": {
|
|
"type": "ref",
|
|
"ref": "#patternType"
|
|
},
|
|
"action": {
|
|
"type": "ref",
|
|
"ref": "#actionType"
|
|
},
|
|
"reason": {
|
|
"type": "ref",
|
|
"ref": "#reasonType"
|
|
},
|
|
"createdBy": {
|
|
"type": "string",
|
|
"format": "did",
|
|
"description": "DID of the user who created this rule"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "datetime"
|
|
},
|
|
"comment": {
|
|
"type": "string",
|
|
"description": "Optional comment about the decision"
|
|
}
|
|
}
|
|
},
|
|
"eventType": {
|
|
"type": "string",
|
|
"knownValues": ["addRule", "updateRule", "removeRule"]
|
|
},
|
|
"patternType": {
|
|
"type": "string",
|
|
"knownValues": ["domain", "url"]
|
|
},
|
|
"actionType": {
|
|
"type": "string",
|
|
"knownValues": ["block", "warn", "whitelist"]
|
|
},
|
|
"reasonType": {
|
|
"type": "string",
|
|
"knownValues": ["csam", "spam", "phishing", "none"]
|
|
},
|
|
"urlRule": {
|
|
"type": "object",
|
|
"description": "Input for creating a URL safety rule",
|
|
"required": [
|
|
"url",
|
|
"pattern",
|
|
"action",
|
|
"reason",
|
|
"createdBy",
|
|
"createdAt",
|
|
"updatedAt"
|
|
],
|
|
"properties": {
|
|
"url": {
|
|
"type": "string",
|
|
"description": "The URL or domain to apply the rule to"
|
|
},
|
|
"pattern": {
|
|
"type": "ref",
|
|
"ref": "#patternType"
|
|
},
|
|
"action": {
|
|
"type": "ref",
|
|
"ref": "#actionType"
|
|
},
|
|
"reason": {
|
|
"type": "ref",
|
|
"ref": "#reasonType"
|
|
},
|
|
"comment": {
|
|
"type": "string",
|
|
"description": "Optional comment about the decision"
|
|
},
|
|
"createdBy": {
|
|
"type": "string",
|
|
"format": "did",
|
|
"description": "DID of the user added the rule."
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "datetime",
|
|
"description": "Timestamp when the rule was created"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "datetime",
|
|
"description": "Timestamp when the rule was last updated"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|