45 Commits

Author SHA1 Message Date
Foysal Ahamed
55cc15cdd6
Add ozone proxy for revokeCredentials endpoint (#4170)
*  Add ozone proxy for revokeCredentials endpoint

* 📝 Add changeset

*  Add mod event for revoke credentials

*  Add tests
2025-09-09 14:13:48 +02:00
Eric Bailey
a5b20f0218
Add expanded moderation report reasons (#3881)
* Integrate new reporting reasons

* Update bnn to BNR, prefix all with reason* to match previous

* Remap deprecations

* Update naming, add notes about Bluesky-only reasons

* Update reason

* Move new defs to tools.ozone namespace

* Add ozone lexicons to app view

* Copy known values to merge defs

* Update comments

* Add reasonAppeal to new ozone namespace defs

* Changeset

* ❇️ Support new reporting categories in ozone (#3974)

*  Validate report reason using labeler service profile

*  Rename test

* :rotating_lights: Fix lint issue

*  Use both appeal reason type for materialized views

*  Add old to new reason mapping for fallback

*  Update test snapshot

* :rotating_lights: Fix lint issue

* 🧹 Cleanup

* :rotating_lights: Fix lint issue

*  Adjust report reason tagging

* 📝 Additional comment for new migration

---------

Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2025-09-02 21:40:31 +02:00
Foysal Ahamed
3156ddf615
Add batchId filter for queryEvents (#4109)
*  Add batchId filter for queryEvents

* 📝 Add changeset
2025-08-20 21:39:24 +02:00
Foysal Ahamed
171efadb49
❇️ Ozone events timeline (#3927)
* 🚧 WIP

*  Blend in plc and account history events in account timeline

*  Adjust snapshot

* 🧹 Cleanup and address review comments

*  Update test snapshot

* 🐛 Add back the helper function

* 📝 Add explainer comment

*  Map plc events to conforming naming convention

*  Update test snapshot

* 🧹 Cleanup

*  Add known values for event types

* 📝 Add changeset
2025-08-04 20:37:05 +02:00
Foysal Ahamed
3b356c5096
External ID in ozone events to help dedupe events (#4048)
*  Add externalId to ozone events for deduping events per subject and event type

* 📝 Add changeset

*  Move duplicate event check inside transaction
2025-07-15 18:32:22 +02:00
Foysal Ahamed
926193f825
Ozone support for age assurance compliance events (#4029)
* 🚧 WIP

*  Make age assurance state queryable

*  Split age assurance events into 2

*  Implement admin and user state overrides

*  Add blocked as a known value for age assurance state

*  Update test snapshot

*  Update test snapshot

*  Cleanup
2025-07-11 18:00:55 +02:00
Foysal Ahamed
0c0381a2bb
❇️ Ozone user agent (#3991)
*  Add userAgent tracking for events

* :rotating_lights: Fix lint issue

* ♻️ Refactor userAgent to modTool

*  Rename extra to meta

* 📝 Add changeset

*  Support modTools param in createReport

*  Add support for mod tool in createReport
2025-07-02 22:34:15 +02:00
Foysal Ahamed
02c358d0ca
Adds safelink module (#3945)
*  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
2025-07-02 21:17:38 +02:00
Foysal Ahamed
37b5a4ef29
🐛 Add missing union ref to ozone mod subject (#3605) 2025-05-28 10:30:54 +02:00
Foysal Ahamed
fe2a1d12bb
🐛 Add datetime format in lexicon def for createdAt field on grantVerification input (#3829) 2025-05-28 10:30:43 +02:00
Foysal Ahamed
45354c84f8
❇️ Verifications manager in ozone (#3765)
* First vouch implementation

* Remove unneeded endpoints

* wip

*  wip

*  Process jetstream events through p-queue and add tests

*  Add test for cursor update

* 🐛 Use utc time to update updatedAt

* 🧹 Cleanup

* 🔨 Fix pnpm versioning issues

*  Replace jetstream lib with manual implementation

*  Remove unnecessary 3p dep

*  Add e2e test for jetstream

* 🚨 Fix import

* 🧹 Remove unnecessary property

*  Fix dev-env and add profile to verification view in ozone

*  Add profile type

*  Add backpressure handling to jetstream listener

*  Use WebSocketKeepAlive from xrpc-server and replace partysocket

*  Add a new verifier role to ozone team meber roles

* 📝 Run codegen

* 🐛 Fix auth check

* 🐛 Fix test failure check

* 🚨 Fix json formatting

* 🐛 Fix team role check

* 🚧 Checking failing test

*  Fix tests

*  Address review comments

*  Add xrpc-server to version

* 🚨 Fix linter issue

* 🚨 Fix linter issue

*  Resolve race condition in cursor update

*  Add verification check on profile

* 🐛 Fix missing cid in test and firehose cursor

*  Fix test

*  Add record validation for verification and separate xrpc-server version

*  Return error object for failed revocations

*  Add re-login on expired session case

* 📝 Fix typo

---------

Co-authored-by: rafael <rafael@blueskyweb.xyz>
2025-04-24 10:49:45 +02:00
devin ivy
7af77f3edf
Ozone: support for tools.ozone.hosting.getAccountHistory (#3768)
* update ozone lexicons w/ tools.ozone.hosting

* ozone: tidy deprecated usage

* ozone: proxy tools.ozone.hosting.getAccountHistory

* changeset

* ozone: consistency in account history lexicon
2025-04-23 18:06:36 -04:00
Foysal Ahamed
076c2f9872
Add getSubjects endpoint to ozone for full view of subjects (#3651)
*  Add getSubjects endpoint to ozone for full view of subjects

* 📝 Better lexicon description

* 📝 Add changeset

*  Add subject to subject view

*  Update snapshot

* :rotating_lights: Fix lint issue

*  Make subject required in subjectView

* 🐛 Add subject check before attempting to run queries

*  Keed the order of subjects from the request in the responding array

*  Use a union for profile field

* 🐛 Remove minLength and address profile value

* 📝 Bring back minLength
2025-03-27 10:50:44 -04:00
Foysal Ahamed
18fbfa0005
Add team member handle and displayName (#3587)
*  Add team member handle and displayName

*  Add periodic profile details sync

* 📝 Add changeset

*  Update team service instantiation

* 🐛 Cleanup

* 🧹 Cleanup unnecessary index
2025-03-07 23:00:25 +00:00
Foysal Ahamed
5e61126157
🐛 Store empty comment for ozone events (#3571)
* 🐛 Store empty comment for ozone events

*  Make comment property optional

* 📝 Better comment event description
2025-02-24 14:15:20 +01:00
Foysal Ahamed
b9cb049d94
🐛 Add missing divert event to list of events on emitEvent (#3561)
* 🐛 Add missing divert event to list of events on emitEvent

* ♻️ Clean up

* 📝 Add changeset
2025-02-21 17:11:17 +01:00
Foysal Ahamed
7449f8607c
Allow filtering ozone team list by role and status (#3554)
*  Allow filtering ozone team list by role and status

* fix style

* changeset

---------

Co-authored-by: Matthieu Sieben <matthieu.sieben@gmail.com>
2025-02-19 10:15:58 +01:00
Foysal Ahamed
b41ff4b4e3
Add reporter_stats materialized view and endpoint to fetch reporter stats (#3509)
*  Add reporter_stats materialized view and endpoint to fetch reporter stats

* 🚨 Fix linter issues

*  Change reporter stats query from materialized view to on demand select

* Add "createdAt" as part of the index

---------

Co-authored-by: Matthieu Sieben <matthieu.sieben@gmail.com>
Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com>
2025-02-17 22:17:43 +01:00
Foysal Ahamed
709a85b0b6
Add a priority score value for ozone subjects (#3495)
*  Add a priority score value for ozone subjects

* 🚨 Bring back lock file

*  Update snapshot for pds proxied tests

*  Update takedown appeal snapshot

*  Update takedown appeal snapshot

*  Update repo and record snapshots

* :rotating_lights: Fix lint issue

*  Update moderation events snapshot

*  Update moderation statuses snapshot

* 🧹 Cleanup unnecessary durationInHours field

*  Allow filtering by priority score

*  Add test for priorityScore filter

* 🚨 Fix import order

*  Allow 0 priority score filter

* 📝 Add changeset
2025-02-06 20:54:27 +00:00
Foysal Ahamed
d377d1a9be
Allow creating labels with expiry (#3476)
*  Allow creating labels with expiry

* 🧹 Cleanup
2025-01-31 11:48:10 -08:00
Matthieu Sieben
ee9779d074
Add account details to queryStatuses (#3236)
* Moderation subjectStatusView with statistics

* add account stats to queue entries

* fix

* adapt

* review changes

* style

* review comments

* wip

* add indexes

* refresh materialized view

* use the background queue to refresh materialized views

* tidy

* fix verrify

* tidy

* Add filtering based on "minAccountSuspendCount"

* fix tests

* Update test snapshots

* update materialized views when running `processAll`

* tidy

* processAll sequentially

* tidy

* tidy

* fix dead lock
2025-01-20 15:36:02 +01:00
Foysal Ahamed
53621f8e10
Add a policy property to takedown events (#3271)
*  Add a policy property to takedown events

*  Add policy list setting validation

*  Make multiple policies possible for takedown and event search

* 📝 Add changeset

*  Use , as policies separator
2025-01-02 20:46:53 -05:00
Foysal Ahamed
d90d999def
🐛 Fix tags length (#3294)
* 🐛 Allow tag item longer than 25 char

* 📝 Add changeset
2024-12-27 16:48:58 +00:00
Foysal Ahamed
9ea2cce9a4
Apply queue filter on database query when fetching subjects (#3280)
*  Apply queue filter on database query when fetching subjects

*  Add queue seed option

* 📝 Add changeset

* 🐛 Allow 0 value for queueIndex
2024-12-23 13:08:31 +00:00
Foysal Ahamed
6a3e781b98
Add && separator for tags filter param on queryStatuses endpoint (#3261)
*  Add && separator for tags filter param on queryStatuses endpoint

* 🐛 Handle potential empty tag search input

* 🐛 Handle empty condition
2024-12-18 22:46:05 +00:00
Foysal Ahamed
ed22362209
Optionally ack all open subjects from the author with acknowledge event (#3171)
*  Acknowledge all open subjects of an account when acknowledging account level reports

* 📝 Add changeset
2024-12-05 11:45:28 +00:00
Foysal Ahamed
c72145dbeb
Allow querying events by multiple keywords using OR condition (#3070)
*  Allow querying events by multiple keywords using OR condition

* 📝 Update comment

*  Update operator to ||

*  Fix test

* 🐛 Handle edge cases around search query

*  Codgen
2024-11-29 18:00:48 +00:00
Foysal Ahamed
48d08a469f
🐛 Define durationInHours as optional for reporter mute for permanent mutes (#2988)
* 🐛 Define durationInHours as optional for reporter mute for permanent mutes

* 📝 Add changeset
2024-11-13 21:11:16 +01:00
Foysal Ahamed
d6f33b4742
Add events for account and record update/delete/deactivation (#2661)
*  Add events for account and record update/delete/deactivation

*  Add handle change event

*  Reduce account events to 2 types and record events to 1

*  Store metadata from account, identity and record events

*  Add created event for record

*  Add ndd the new events to allowed types in emitEvent

*  Use string value for record op and add tombstone flag to identity event

*  Add active flag on account events

*  Change accountStatus -> status to match with firehose event

*  Make active flag required

* 🚨 fix prettier style issue

*  Track record/account delete and update data in subject status (#2804)

*  Store deleted/updated event data in subject_status

* 🐛 Fix query for recordDeletedAt and recordUpdatedAt

*  Add tombstoned status

*  Move from record to hosting term

*  Add tests for hosting params

*  Update lexicons for hostingStatuses

*  Update snapshots

*  Update snapshots

*  Update snapshots

*  Adjust hosting statuses

* 📝 Add changeset
2024-11-07 22:51:44 +01:00
Foysal Ahamed
c4b5e53957
Ozone instance-wide and user-specific settings (#2905)
*  Settings endpoints are working

* 🧹 Rename file

*  Replace ad-hoc manage roles to match team member roles

* ♻️ Refactor role names

*  Polish up

*  Move to using id for pagination

* 📝 Add changeset

*  Update snapshots

*  Change column order in setting table index and add did in all queries
2024-11-07 22:43:30 +01:00
Daniel Holmgren
73f40e63ab
Add threat signatures to ozone repo views (#2931)
* add threat signatures to ozone repo views

* explicitly add to views
2024-10-30 18:30:41 -05:00
Foysal Ahamed
19e36afb2c
Add collection and subjectType filters to queryEvents and queryStatuses (#2914)
*  Add collection and subjectType filters to queryEvents and queryStatuses

* 📝 Add changeset

* ♻️ Refactor or query builder
2024-10-30 16:20:38 +01:00
Foysal Ahamed
22d039a229
Ozone sets (#2636)
*  Initial implementation of sets api on ozone

*  Introduce sortDirection to querySets

* 🧹 Cleanup and refactor

*  Align setView for response

* ♻️ Rename and add specific error

* 🐛 Cleanup unnecessary check that is covered by lexicon

*  Rename remove to delete and add set suffix

*  Use id and createdAt for values pagination

*  Add index on createdAt for query perf and other cleanups

* 🐛 Set createdAt when inserting values

* 📝 Add changeset

*  Add index on setId and createdAt
2024-10-08 19:16:09 +02:00
Daniel Holmgren
df14df522b
Ozone signature methods (#2855)
* lexicons

* fix typo & add proxy routes

* changeset
2024-10-03 14:00:12 -05:00
Foysal Ahamed
a2bad977a8
Ozone batch repo and record getters (#2836)
*  Add getRepos and getRecords endpoints for bulk fetching

*  Fix issues and add tests for get repos and get records

*  Use the right lxm

* 🐛 Revert changes in lockfile

*  Add getAccountInfos in PDS

* 🐛 Fix type def for repo and record view detail

*  Update snapshots

*  Update snapshots

*  Consolidate error type for com.atproto and tools.ozone getRecord error type

* 🧹 Cleanup

*  Update snapshots

*  Update snapshots

*  Changeset
2024-10-01 19:37:23 +02:00
Foysal Ahamed
62a8225f36
Optionally ack all open subjects from the author with takedown event and get all mod subjects of a user (#2793)
*  Add acknowledgeAllSubjectsOfAccount flag with takedown event

* 📝 better documentation of forAccount and subject params

* 🧹 Cleanup tests

*  Change wording according to review

*  Refactor tests

* ♻️ Rename acknowledge flag
2024-09-11 18:26:53 +02:00
Foysal Ahamed
e4d41d66fa
❇️ Template language (#2780)
*  Throw specific error for duplicate template name

* 🧹 Cleanup console

*  Throw duplicate template name error from update too

*  Add language to templates

* 📝 Add changeset

*  Add missing event type

*  Add language format in lexicon and error checker in util

* 🚨 fix linter issues
2024-09-04 12:42:39 +02:00
bnewbold
aab465deb7
lexicons: add missing ozone Tag event type to unions (#2632)
* lex: add missing tag events to unions

* make codegen
2024-07-08 18:54:27 -07:00
Foysal Ahamed
3ad0519961
Ozone team member manager (#2460)
* 🚧 Proposal for moderator manager lexicons

*  CRUD for moderator management works

*  Add profile view to moderator user list

*  Seed mod users from env var to db

*  Adjust tests

*  Update snapshots

*  Fix type and lexicon token issues

*  Add pagination to listUsers

*  Use sort order in pagination

* 📝 Change error name

*  Update snapshots

*  seed mods in sync to avoid re-order

* 🧹 Remove unnecessary import

* 🐛 Re-run codegen

* 🧹 Some cleanup

* 🧹 Cleanup unnecessary properties on auth-verifier

*  Rename terminologies from moderator to team and member

* 🧹 Cleanup

*  Allow admin tokens to update/add member

*  Delete members in transaction

*  Use db transactions and move profile hydration to the service layer

*  Add test for addMember endpoint

* 🐛 wait on adding admin DID

*  Do not allow updating/deleting service owner and always give service owner admin access

* 🧹 Cleanup

*  Make timestamp columns non null

* 🧹 Cleanup

*  Update mod role definition in getConfig

*  Deletion and update guards

* 🐛 don't prefill service did

* 📝 Add changeset
2024-06-18 18:47:20 -04:00
Foysal Ahamed
8d2d3ac9e0
Add server.getConfig endpoint to ozone (#2494)
*  Add server.getConfig endpoint to ozone

*  Fix tests

*  Cleanup snapshot

* 🧹 Tidy up lexicons

*  Change role values to match with upcoming mod-manager roles

*  Add chat service config

* Update lexicons/tools/ozone/server/getConfig.json

Co-authored-by: devin ivy <devinivy@gmail.com>

*  Update lexicons

---------

Co-authored-by: devin ivy <devinivy@gmail.com>
2024-06-05 11:05:21 -04:00
Daniel Holmgren
255d5ea1f0
Account deactivation (#2531)
* subscribe repos lex: new #account event type

* lex: getAccountStatus endpoint

* lex: add account status errors to sync methods

* tweak type of token union

* fix getAccountStatus parameter name

* codegen

* Account -> Repo

* re-codegen

* update errors in sync methods

* add getRepoStatus route

* add account events to sequencer

* emit account evts

* fix test + small bugfixin

* handle evt on bsky side

* codegen

* loggable message

* schema tweaks

* build errors & tidy

* tidy account deactivation tests

* more subscribe repos tests

* identity evt tests + tidy

* return optional did doc on identity evts

* update identity evt

* update impl for identity evt handles

* add description to handle field

* status on listRepos & notate deprecated firehose events

* return status on listRepos

* pr feedback

* tests

* protos

* add status to session schemas

* codegen

* revamp auth-verifier

* thread through agent

* fix tests

* fix account deletion test

* fix more tests

* fix type error in repo.test

* bsky index account evts

* apply in appview

* add to admin route

* add deactivatedAt to ozone views

* pds tests

* appview tests

* ozone test

* fix bsky test

* fix agent test

* fix indexing test

* tweak session schemas

* update session routes & clean up status handling in pds & agent

* changeset

* patch pds test

* rm active from knownValues

---------

Co-authored-by: bryan newbold <bnewbold@robocracy.org>
2024-05-31 16:39:21 -05:00
Daniel Holmgren
265ce86e15
Ozone chat integration (#2490)
* wip

* schema tweaks

* room -> chat

* missed one

* missed another

* deleted messages + incoming message settings

* add schemas for blocking users

* chat update schemas

* make updateUserSettings more generic

* fix dangling ref

* fix dangling refs

* mute chats & leave chats

* schema consistency, naming

* lexicon for updating chat read state

* dm lexicon updates, add batch send endpoint

* dm sender on deleted message

* Add codegen for temp lex

* lexicon: switch temp.dm to chat.bsky namespace, misc fixes

* lexicon: codegen

* lexicon: fix some chat/convo terminology

* lexicon: codegen

* moderator schemas

* codegen

* lexicon: consistency in chat lexicons

* lexicon: add chat to associated profile info

* add ref to updateActorAccess

* add annotation on convoView for disabled members

* codegen

* ozone lexicons

* scaffold routes

* hook up chat moderation routes to ozone

* add message subject for reports/events

* remove dm references from ozone schemas

* ensure report exists before serving getMessageContext

* 🐛 Fix typo in column name

* adjust before/after instead of throwing

* add dev script

* add dev-env introspection server

* hook up chat mod routes to pds & ozone

*  Add message ref subject in eventView def

* fix typo

* add chat reporting test

* fix test

* update dev-env chat did

* update dms server routes name

* pr feedback

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
Co-authored-by: Eric Bailey <git@esb.lol>
Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-05-15 18:52:47 -05:00
noriaki watanabe
24761c8bfa
Resolve duplicate refs in lexicon of ozone (#2451)
* Resolve duplicate refs

* Fix order of refs of "tools.ozone.moderation.emitEvent"
2024-04-30 11:32:43 -07:00
Foysal Ahamed
58551bbe05
Allow muting reporter (#2390)
*  Allow muting reporter

*  Allow fetching ONLY muted subjects

* 🚨 re-run linter on fixed main

*  Track muted reports

*  Adjust snapshot

*  Adjust snapshot

*  Adjust snapshot

* 📝 Add changesets

* ♻️ Refactor muted reporter check

*  Use new event type for muting/unmuting reporter

* 🧹 Cleanup
2024-04-25 10:43:04 -04:00
Daniel Holmgren
2ea27e340a
Ozone lexicons (#2288)
* lexicons

* clean up old admin schemas

* codegen

* renaming all routes

* fix more

* fix snaps

* fix test

* format

* hook up ozone routes on pds

* publish next version

* build branch

* dont build branch
2024-03-12 18:42:11 -05:00