* ✨ 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
180 lines
4.5 KiB
Plaintext
180 lines
4.5 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`safelink management addRule allows admins to add rules 1`] = `
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Known phishing domain targeting users",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 1,
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"url": "https://malicious-site.com",
|
|
}
|
|
`;
|
|
|
|
exports[`safelink management queryEvents allows querying safelink events 1`] = `
|
|
Array [
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Escalated to block",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "updateRule",
|
|
"id": 10,
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"url": "https://events-test.com",
|
|
},
|
|
Object {
|
|
"action": "warn",
|
|
"comment": "Initial rule creation",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 9,
|
|
"pattern": "domain",
|
|
"reason": "spam",
|
|
"url": "https://events-test.com",
|
|
},
|
|
Object {
|
|
"action": "warn",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 8,
|
|
"pattern": "url",
|
|
"reason": "spam",
|
|
"url": "https://query-test2.com/specific-path",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 7,
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"url": "https://query-test1.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 6,
|
|
"pattern": "domain",
|
|
"reason": "spam",
|
|
"url": "https://remove-test2.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Removing rule - false positive",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "removeRule",
|
|
"id": 5,
|
|
"pattern": "url",
|
|
"reason": "csam",
|
|
"url": "https://remove-test.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Rule to be removed",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 4,
|
|
"pattern": "url",
|
|
"reason": "csam",
|
|
"url": "https://remove-test.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Updated: confirmed phishing site",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "updateRule",
|
|
"id": 3,
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"url": "https://update-test.com",
|
|
},
|
|
Object {
|
|
"action": "warn",
|
|
"comment": "Initially marked as spam",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 2,
|
|
"pattern": "domain",
|
|
"reason": "spam",
|
|
"url": "https://update-test.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Known phishing domain targeting users",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"eventType": "addRule",
|
|
"id": 1,
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"url": "https://malicious-site.com",
|
|
},
|
|
]
|
|
`;
|
|
|
|
exports[`safelink management queryRules allows querying all active rules 1`] = `
|
|
Array [
|
|
Object {
|
|
"action": "warn",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"pattern": "url",
|
|
"reason": "spam",
|
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
"url": "https://query-test2.com/specific-path",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
"url": "https://query-test1.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"pattern": "domain",
|
|
"reason": "spam",
|
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
"url": "https://remove-test2.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Updated: confirmed phishing site",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
"url": "https://update-test.com",
|
|
},
|
|
Object {
|
|
"action": "block",
|
|
"comment": "Known phishing domain targeting users",
|
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
"createdBy": "user(0)",
|
|
"pattern": "domain",
|
|
"reason": "phishing",
|
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
"url": "https://malicious-site.com",
|
|
},
|
|
]
|
|
`;
|