Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0950666
Model mod actions for actor takedowns
devinivy Dec 21, 2022
734d754
Merge remote-tracking branch 'origin/main' into mod-ban
devinivy Dec 21, 2022
eff6ba0
Add administration lex schemas for moderation actions
devinivy Dec 21, 2022
9527826
Initial implementation of takedown mod action and reversal
devinivy Dec 21, 2022
973ec78
Refactor admin actions into a service
devinivy Dec 21, 2022
ba6fd23
Check for account takedown when creating new session or refreshing se…
devinivy Dec 21, 2022
4f30ef2
Sweep usage of getUser() and getUserByEmail() for takedowns
devinivy Dec 21, 2022
141239f
Begin sweep for account takedowns
devinivy Dec 21, 2022
34e9c4f
Tidy takedown checks
devinivy Dec 21, 2022
ff091b8
Handle post author takedowns
devinivy Dec 21, 2022
989f5fe
Fix tests and migrations for mod takedown
devinivy Dec 22, 2022
449f0a2
Fix xrpc-server delayed read of blob payloads
devinivy Dec 22, 2022
1281fa7
Test takedown mod action, misc fixes
devinivy Dec 22, 2022
3968984
Remodel lex schemas for admin moderation actions
devinivy Dec 24, 2022
093caae
Remove delcaration cid from actor takedowns, lex schema tidy
devinivy Dec 29, 2022
00e2a9b
Add notes
devinivy Dec 29, 2022
bb576d8
Move moderation methods to com.atproto, based around repo rather than…
devinivy Dec 29, 2022
a0a4a63
Moderation reports of repos and records
devinivy Dec 30, 2022
5d498f6
Implement moderation report resolution method
devinivy Dec 30, 2022
f93d8c1
Tidy
devinivy Dec 30, 2022
22775c1
Merge remote-tracking branch 'origin/server-moderation' into mod-ban
devinivy Dec 30, 2022
a19b92c
Merge remote-tracking branch 'origin/mod-ban' into mod-report
devinivy Dec 30, 2022
d2fe4bc
Merge pull request #440 from bluesky-social/mod-ban
devinivy Dec 30, 2022
ed5a5ac
Place moderation-init migration after mute-init
devinivy Dec 30, 2022
f78d3b7
Allow services to reference each other
devinivy Dec 30, 2022
bcfe783
Model record takedowns in db
devinivy Dec 30, 2022
052e802
Lex schemas for record takedowns
devinivy Dec 30, 2022
f299a8c
Service/methods for record takedowns, fix report view subject
devinivy Dec 30, 2022
e5963f3
Apply record takedown to posts in feeds
devinivy Jan 2, 2023
54cc622
Test record takedown effects, fix reversal
devinivy Jan 2, 2023
18c6ecc
Support server moderation flag and acknowledge actions, fix action/re…
devinivy Jan 2, 2023
cb255a1
Track repo takedowns on repo_root rather than did_handle
devinivy Jan 2, 2023
e83b4ea
Move repo/record reporting under com.atproto.report
devinivy Jan 3, 2023
c73f329
Colocate all moderation functionality into moderation service, combin…
devinivy Jan 3, 2023
57cdc70
Tidy
devinivy Jan 3, 2023
10e83f4
Tidy
devinivy Jan 3, 2023
1e9ac94
Merge pull request #447 from bluesky-social/mod-report
devinivy Jan 3, 2023
a1c119f
Merge remote-tracking branch 'origin/server-moderation' into mod-record
devinivy Jan 3, 2023
9f68e41
Unify mod report and action methods with new repo/record ref schemas
devinivy Jan 3, 2023
35c0d0a
Merge pull request #448 from bluesky-social/mod-record
devinivy Jan 4, 2023
57f5334
Merge remote-tracking branch 'origin/server-moderation' into mod-simp…
devinivy Jan 4, 2023
4d91656
Merge pull request #450 from bluesky-social/mod-simple-action-tidy
devinivy Jan 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions lexicons/com/atproto/admin/moderationAction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"lexicon": 1,
"id": "com.atproto.admin.moderationAction",
"defs": {
"view": {
"type": "object",
"required": ["id", "action", "subject", "reason", "createdBy", "createdAt", "resolvedReports"],
"properties": {
"id": {"type": "integer"},
"action": {"type": "string", "knownValues": ["com.atproto.admin.moderationAction#takedown"]},
"subject": {
"type": "union",
"refs": [
"com.atproto.repo.repoRef",
"com.atproto.repo.strongRef"
]
},
"reason": {"type": "string"},
"createdBy": {"type": "string"},
"createdAt": {"type": "string"},
"reversal": {"type": "ref", "ref": "#reversal"},
"resolvedReports": {"type": "array", "items": {"type" :"ref", "ref": "#resolvedReport"}}
}
},
"reversal": {
"type": "object",
"required": ["reason", "createdBy", "createdAt"],
"properties": {
"reason": {"type": "string"},
"createdBy": {"type": "string"},
"createdAt": {"type": "string"}
}
},
"resolvedReport": {
"type": "object",
"required": ["id"],
"properties": {
"id": {"type": "integer"}
}
},
"takedown": {
"type": "token",
"description": "Moderation action type: Takedown. Indicates that content should not be served by the PDS."
},
"flag": {
"type": "token",
"description": "Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served."
},
"acknowledge": {
"type": "token",
"description": "Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules."
}
}
}
29 changes: 29 additions & 0 deletions lexicons/com/atproto/admin/resolveModerationReports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"lexicon": 1,
"id": "com.atproto.admin.resolveModerationReports",
"defs": {
"main": {
"type": "procedure",
"description": "Resolve moderation reports by an action.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["actionId", "reportIds", "createdBy"],
"properties": {
"actionId": {"type": "integer"},
"reportIds": {"type": "array", "items": {"type": "integer"}},
"createdBy": {"type": "string"}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "ref",
"ref": "com.atproto.admin.moderationAction#view"
}
}
}
}
}
29 changes: 29 additions & 0 deletions lexicons/com/atproto/admin/reverseModerationAction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"lexicon": 1,
"id": "com.atproto.admin.reverseModerationAction",
"defs": {
"main": {
"type": "procedure",
"description": "Reverse a moderation action.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["id", "reason", "createdBy"],
"properties": {
"id": {"type": "integer"},
"reason": {"type": "string"},
"createdBy": {"type": "string"}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "ref",
"ref": "com.atproto.admin.moderationAction#view"
}
}
}
}
}
43 changes: 43 additions & 0 deletions lexicons/com/atproto/admin/takeModerationAction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"lexicon": 1,
"id": "com.atproto.admin.takeModerationAction",
"defs": {
"main": {
"type": "procedure",
"description": "Take a moderation action on a repo.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["action", "subject", "reason", "createdBy"],
"properties": {
"action": {
"type": "string",
"knownValues": [
"com.atproto.admin.moderationAction#takedown",
"com.atproto.admin.moderationAction#flag",
"com.atproto.admin.moderationAction#acknowledge"
]
},
"subject": {
"type": "union",
"refs": [
"com.atproto.repo.repoRef",
"com.atproto.repo.recordRef"
]
},
"reason": {"type": "string"},
"createdBy": {"type": "string"}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "ref",
"ref": "com.atproto.admin.moderationAction#view"
}
}
}
}
}
15 changes: 15 additions & 0 deletions lexicons/com/atproto/repo/recordRef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"lexicon": 1,
"id": "com.atproto.repo.recordRef",
"description": "A URI with optional content-hash fingerprint.",
"defs": {
"main": {
"type": "object",
"required": ["uri"],
"properties": {
"uri": {"type": "string"},
"cid": {"type": "string"}
}
}
}
}
14 changes: 14 additions & 0 deletions lexicons/com/atproto/repo/repoRef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"lexicon": 1,
"id": "com.atproto.repo.repoRef",
"description": "A did identifying a repository.",
"defs": {
"main": {
"type": "object",
"required": ["did"],
"properties": {
"did": {"type": "string"}
}
}
}
}
49 changes: 49 additions & 0 deletions lexicons/com/atproto/report/create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"lexicon": 1,
"id": "com.atproto.report.create",
"defs": {
"main": {
"type": "procedure",
"description": "Report a repo or a record.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["reasonType", "subject"],
"properties": {
"reasonType": {"type": "ref", "ref": "com.atproto.report.reasonType"},
"reason": {"type": "string"},
"subject": {
"type": "union",
"refs": [
"com.atproto.repo.repoRef",
"com.atproto.repo.recordRef"
]
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["id", "reasonType", "subject", "reportedByDid", "createdAt"],
"properties": {
"id": {"type": "integer"},
"reasonType": {"type": "ref", "ref": "com.atproto.report.reasonType"},
"reason": {"type": "string"},
"subject": {
"type": "union",
"refs": [
"com.atproto.repo.repoRef",
"com.atproto.repo.strongRef"
]
},
"reportedByDid": {"type": "string"},
"createdAt": {"type": "datetime"}
}
}
}
}
}
}
21 changes: 21 additions & 0 deletions lexicons/com/atproto/report/reasonType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"lexicon": 1,
"id": "com.atproto.report.reasonType",
"defs": {
"main": {
"type": "string",
"knownValues": [
"com.atproto.report.reason#spam",
"com.atproto.report.reason#other"
]
},
"spam": {
"type": "token",
"description": "Moderation report reason: Spam."
},
"other": {
"type": "token",
"description": "Moderation report reason: Other."
}
}
}
31 changes: 31 additions & 0 deletions lexicons/com/atproto/report/subject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "com.atproto.report.subject",
"defs": {
"repo": {
"type": "object",
"required": ["did"],
"properties": {
"did": {"type": "string", "description": "The DID of the repo."}
}
},
"record": {
"type": "object",
"required": ["did", "collection", "rkey"],
"properties": {
"did": {"type": "string", "description": "The DID of the repo."},
"collection": {"type": "string", "description": "The NSID of the collection."},
"rkey": {"type": "string", "description": "The key of the record."},
"cid": {"type": "string", "description": "The CID of the version of the record. If not specified, defaults to the most recent version."}
}
},
"recordRef": {
"type": "object",
"required": ["uri", "cid"],
"properties": {
"uri": {"type": "string"},
"cid": {"type": "string"}
}
}
}
}
7 changes: 5 additions & 2 deletions lexicons/com/atproto/session/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"did": {"type": "string"}
}
}
}
},
"errors": [
{"name": "AccountTakedown"}
]
}
}
}
}
7 changes: 5 additions & 2 deletions lexicons/com/atproto/session/refresh.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"did": {"type": "string"}
}
}
}
},
"errors": [
{"name": "AccountTakedown"}
]
}
}
}
}
Loading