atproto/packages/api/tests/moderation.test.ts

730 lines
20 KiB
TypeScript
Raw Normal View History

import { ModerationOpts } from '../dist'
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
import {
interpretLabelValueDefinition,
mock,
moderatePost,
moderateProfile,
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
} from '../src'
import './util/moderation-behavior'
describe('Moderation', () => {
it('Applies self-labels on profiles according to the global preferences', () => {
// porn (hide)
const res1 = moderateProfile(
mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
labels: [
{
src: 'did:web:bob.test',
uri: 'at://did:web:bob.test/app.bsky.actor.profile/self',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
{
userDid: 'did:web:alice.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
prefs: {
adultContentEnabled: true,
labels: {
porn: 'hide',
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
},
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res1.ui('avatar')).toBeModerationResult(
['blur'],
'post avatar',
JSON.stringify(res1, null, 2),
true,
)
// porn (ignore)
const res2 = moderateProfile(
mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
labels: [
{
src: 'did:web:bob.test',
uri: 'at://did:web:bob.test/app.bsky.actor.profile/self',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
{
userDid: 'did:web:alice.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
prefs: {
adultContentEnabled: true,
labels: {
porn: 'ignore',
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
},
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res2.ui('avatar')).toBeModerationResult(
[],
'post avatar',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
JSON.stringify(res1, null, 2),
true,
)
})
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
it('Ignores labels from unsubscribed moderators or ignored labels for a moderator', () => {
// porn (moderator disabled)
const res1 = moderateProfile(
mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
labels: [
{
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.actor.profile/self',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
{
userDid: 'did:web:alice.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
prefs: {
adultContentEnabled: true,
labels: {
porn: 'hide',
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
},
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
for (const k of [
'profileList',
'profileView',
'avatar',
'banner',
'displayName',
'contentList',
'contentView',
'contentMedia',
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
] as const) {
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res1.ui(k)).toBeModerationResult(
[],
k,
JSON.stringify(res1, null, 2),
)
}
// porn (label group disabled)
const res2 = moderateProfile(
mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.actor.profile/self',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
{
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: true,
labels: {
porn: 'ignore',
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
{
did: 'did:web:labeler.test',
labels: { porn: 'ignore' },
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
},
},
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
for (const k of [
'profileList',
'profileView',
'avatar',
'banner',
'displayName',
'contentList',
'contentView',
'contentMedia',
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
] as const) {
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res2.ui(k)).toBeModerationResult(
[],
k,
JSON.stringify(res2, null, 2),
)
}
})
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
it('Can manually apply hiding', () => {
const res1 = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labels: [],
}),
{
userDid: 'did:web:alice.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
prefs: {
adultContentEnabled: true,
labels: {},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
{
did: 'did:web:labeler.test',
labels: {},
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
},
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
res1.addHidden(true)
expect(res1.ui('contentList')).toBeModerationResult(
['filter', 'blur'],
'contentList',
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res1.ui('contentView')).toBeModerationResult(['blur'], 'contentView')
})
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
it('Prioritizes filters and blurs correctly on merge', () => {
const res1 = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'porn',
cts: new Date().toISOString(),
},
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: '!hide',
cts: new Date().toISOString(),
},
],
}),
{
userDid: 'did:web:alice.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
prefs: {
adultContentEnabled: true,
labels: {
porn: 'hide',
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
{
did: 'did:web:labeler.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labels: {},
},
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
},
},
)
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
expect((res1.ui('contentList').filters[0] as any).label.val).toBe('!hide')
expect((res1.ui('contentList').filters[1] as any).label.val).toBe('porn')
expect((res1.ui('contentList').blurs[0] as any).label.val).toBe('!hide')
expect((res1.ui('contentMedia').blurs[0] as any).label.val).toBe('porn')
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
})
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
it('Prioritizes custom label definitions', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: true,
labels: { porn: 'warn' },
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
{
did: 'did:web:labeler.test',
labels: { porn: 'warn' },
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
},
labelDefs: {
'did:web:labeler.test': [
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
interpretLabelValueDefinition(
{
identifier: 'porn',
blurs: 'none',
severity: 'inform',
locales: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
defaultSetting: 'warn',
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
'did:web:labeler.test',
),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
],
},
}
const res = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
modOpts,
)
expect(res.ui('profileList')).toBeModerationResult([])
expect(res.ui('profileView')).toBeModerationResult([])
expect(res.ui('avatar')).toBeModerationResult([])
expect(res.ui('banner')).toBeModerationResult([])
expect(res.ui('displayName')).toBeModerationResult([])
expect(res.ui('contentList')).toBeModerationResult(['inform'])
expect(res.ui('contentView')).toBeModerationResult(['inform'])
expect(res.ui('contentMedia')).toBeModerationResult([])
})
it('Doesnt allow custom behaviors to override imperative labels', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: true,
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labels: {},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
{
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
did: 'did:web:labeler.test',
labels: {},
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labelDefs: {
'did:web:labeler.test': [
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
interpretLabelValueDefinition(
{
identifier: '!hide',
blurs: 'none',
severity: 'inform',
locales: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
defaultSetting: 'warn',
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
'did:web:labeler.test',
),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
],
},
}
const res = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: '!hide',
cts: new Date().toISOString(),
},
],
}),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
modOpts,
)
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
expect(res.ui('profileList')).toBeModerationResult([])
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res.ui('profileView')).toBeModerationResult([])
expect(res.ui('avatar')).toBeModerationResult([])
expect(res.ui('banner')).toBeModerationResult([])
expect(res.ui('displayName')).toBeModerationResult([])
expect(res.ui('contentList')).toBeModerationResult([
'filter',
'blur',
'noOverride',
])
expect(res.ui('contentView')).toBeModerationResult(['blur', 'noOverride'])
expect(res.ui('contentMedia')).toBeModerationResult([])
})
it('Ignores invalid label value names', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: true,
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labels: {},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: [
{
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
did: 'did:web:labeler.test',
labels: { BadLabel: 'hide', 'bad/label': 'hide' },
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
},
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
labelDefs: {
'did:web:labeler.test': [
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
interpretLabelValueDefinition(
{
identifier: 'BadLabel',
blurs: 'content',
severity: 'inform',
locales: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
defaultSetting: 'warn',
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
'did:web:labeler.test',
),
interpretLabelValueDefinition(
{
identifier: 'bad/label',
blurs: 'content',
severity: 'inform',
locales: [],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
defaultSetting: 'warn',
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
'did:web:labeler.test',
),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
],
},
}
const res = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'BadLabel',
cts: new Date().toISOString(),
},
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'bad/label',
cts: new Date().toISOString(),
},
],
}),
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
modOpts,
)
Feature - 3rd party labelers (#2032) * adding some basic views * feed hydration, add blocks to post hydration * pass over notification hydration * tidy * merge * implement getProfile * hydrate post aggregation and viewer state * fix * fix codegen * get some tests passing! * add takedowns & some like bugfixing * all profile tests passing! * likes test * follow endpoints using data plane * reorg follow block rules * reposts * post views! * implement getList w/ dataplane caveat * adjust dataplane getListMembers to return listitem uris * implement getListMutes and -Blocks w/ dataplane * suggestions * timeline * misc view fixes * view fixes for mutes, self-mute/block * author feed * feed gen routes * tidy * misc block/mute fixes * list feed & actor likes * implement getLists, fix some empty cursors * implement getMutes, empty profile description fix * implement getBlocks, block application fix * implement getSuggestedFollowsByActor, needs some fixes * feed generation * search routes * threads * tidy * fix some snaps * fix getSuggestedFollowsByActor * implement listNotifications * implement getUnreadCount w/ dataplane * implement notifications.updateSeen w/ dataplane * 3rd party blocking tests * blocked profile viewer * add search mocks * refactor getFeed * createPipeline -> createPipelineNew * basic replygating functionality on dataplane w/o filtering violating replies * hack threadgates into dataplane, apply gates * deterministic thread orders in dataplane * misc cleanup around dataplane * upgrade typescript to v5.3 * update typescript linter deps * sync bsky proto, codegen * update dataplane, sync with bsky proto updates * remove indexer, ingester, daemon, moderation services from appview * convert more bsky internals to dataplane, remove custom feedgens, implement mute/unmuting in mock dataplane * remove bsky services. db and indexing logic into mock dataplane. * remove tests not needed by appview v2, misc reorg * add basic in-mem repo subscription to dataplane mock * fix dev-env, bsky tests, bsky build * cull bsky service entrypoint * add bsky service readme * build * tidy * tidy, fix pds proxy tests * fix * fix bsky entrypoint deps * support http2 grpc client * build * fix dataplane bad tls config/default * support multiple dataplane urls, retry when unavailable * build * tidy/fix * move dataplane mock tests into their own dir * cover label hydration through timeline test * bring back labels in appview tests * remove unused db primary/replica/coordinator from bsky dataplane * bsky proto add cids to contracts, buf codegen * sync-up bsky data-plane w/ codegen updates * start using dataplane interaction endpoints * add file * avoid overfetching from dataplane, plumb feed items and cids * pass refs through for post viewer state * Lexicons: Add labeler prefs, labeler declaration, and get labeler routes * Add labelerViewBasic and update embed views * Fix typo * switch list feeds to use feed item in dataplane * handle not found err on get-thread dataplane call * support use of search service rather than dataplane methods * mark some appview v2 todos * tidy * still use dataplane on search endpoints when search service is not configured * fix pds test * Switch to labelerViewDetailed * Move label and report values to refs * Add getActorLabelers * lint * fix up bsky tests & snaps * small diff to open pr * rm new line * codegen schemas * tidy migrations * table + indexing * protos * rename lexicons * views, hydration + rename lexicons * rest of routes * data plane routes * parse labelers from req * fix appview-v2 docker build * Support label issuer tied to appview v2 (#2033) support label issuer tied to appview * hydrate context * tidy header logic * integrating into more routes * more routes * wrap up rest * add mock labeler * rework labelerlexicons * tidy lexs * codegen new lexicons * integrate lexicon rework * add proxy logic * forward labeler headers through pds * tweak label header parsing * remove did from scheams * update indexing for lexs * tests for mod service views * label hydration test * Add 'associated' to profileViewDetailed * Rename labelers to mods in preferences * Change uri to did in mod preferences * couple more * syntax tweaks * integrate updated lexicons * update view snap * handle mod service embeds * tidy * fix mock * lint * base default labels of config var * fix label hydration * Appview v2: handle empty cursor on list notifications (#2017) handle empty cursor on appview listnotifs * Update appview v2 to use author feed enum (#2047) * update bsky protos with author feed enum, misc feed item changes * support new author feed enums in dataplane * fix build * Appview v2: utilize sorted-at field in bsky protos (#2050) utilize new sorted-at field in bsky protos * remove all dataplane usage of GetLikeCounts, switch to GetInteractionCounts * Appview v2, sync w/ changes to protos (#2071) * sync bsky protos * sync-up bsky implementation w/ proto changes * Appview v2 initial implementation for getPopularFeedGenerators (#2072) add an initial implementation for getPopularFeedGenerators on appview v2 * merge * fixes * fix feed tests * fix bsync mock * format * remove unused config * fix lockfile * another lockfile fix * fix duplicate type * fix dupplicate test * Appview v2 handling clearly bad cursors (#2092) * make mock dataplane cursors different from v1 cursors * fail open on clearly bad appview cursors * fix pds appview proxy snaps * Appview v2 no notifs seen behavior (#2096) * alter behavior for presenting notifications w/ no last-seen time * fix pds proxy tests * Appview v2 dataplane retries based on client host (#2098) choose dataplane client for retries based on host when possible/relevant * don't apply negated labels * display suspensions on actor profile in appview v2 * Appview v2 use dataplane for identity lookups (#2095) * update bsky proto w/ identity methods * setup identity endpoints on mock dataplane * move from idresolver to dataplane for identity lookups on appview * tidy * Appview v2: apply safe takedown refs to records, actors (#2107) apply safe takedown refs to records, actors * Fix timing on appview v2 repo rev header (#2113) fix timing on appview repo rev * fix post thread responses * Appview v2 don't apply 3p self blocks (#2112) do not apply 3p self-blocks * Appview v2 search for feed generators (#2118) * add protos for feedgen search * support feed search on getPopularFeedGenerators * Appview v2 config tidy (#2117) * remove mod and triage roles from appview * rename cdn and search config * remove custom feed harness from appview v2 * Appview v2: don't apply missing modlists (#2122) * dont apply missing mod lists * update mock dataplane * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * refactor & document a bit better * fix up other routes --------- Co-authored-by: devin ivy <devinivy@gmail.com> * Appview v2 enforce post thread root boundary (#2120) * enforce post thread root boundary * test thread root boundary * Appview v2 fix admin environment variable (#2137) fix admin env in appview v2 * Remove re-pagination from getSuggestions (#2145) * remove re-pagination from getSuggestions * fix test * Adjust wording for account suspension (#2153) adjust wording for account suspension * Appview v2: fix not-found and blocked uris in threads (#2201) * fix uris of not-found and blocked posts in threads * update snaps * :sparkles: Show author feed of takendown author to admins only (#2197) * fold in cid, auth, tracing, node version changes * remove dead config from bsky service entrypoint * build * remove ozone test codepaths for appview v2 * tidy, docs fix * fix test * add additional user counts * add associated data to profiles * update snaps * update to is_mod_service * format * tidy * 3p labeler sdk updates (#2176) * Update sdk to support 3p labeler preferences * Stick with intolerance instead of hate for the label group id * wip expand labels and label groups * Output moderationOpts (computed) and modsPref (unaltered) * Add tests for enabling/disabling mod services * Add atproto-labelers header config * Expand labels and label groups in definitions * Fix tests * Tweaks to labels * Remove label descriptions and improve output types on labels and label groups * Add mocker to exported API * Improve types of label and label group definitions * Rework moderation prefs to continue using global labelgroup settings and only disable label groups per moderator * Simplify encoding of the label preferences in definitions * Add target constraints to labels * Refactor the moderation sdk to derive more behaviors from the definition files * Small cleanup * Add hiding tool to modsdk * Track filter causes * Make mute state an alert * Fix: dont blur profileview for blocks * Prioritize causes by severity * Add moderateNotification() and drop quote post moderation code * Add mocker functions for notifications * Improve mock data * Lexicon: Add custom label definitions and remove modservice descriptions * Lexicon: Update moderation prefs * SDK updates: remove label groups, reduce builtin labels, update mod-preference apis * Lexicon: Update global labels with new reduced set * Lexicon: Remove moderation.getService and add detailed option to getServices * Lexicons: add severity=none to custom label value defs * Implement custom label-value definition tooling * All custom labels are no-self * Backend impl for labeler lexicon updates (#2258) * codegen * clean up impl * fix up tests * Lexicon: modservice -> labeler * Remove x- prefix behavior; add label value syntax rules; add custom label precedence rules * Lexicon: Remove the ability to choose a defaultSetting from custom labels * Rework test suites * Give behaviors to all labels regardless of target * sync up backend with lex changes * fix labelers in dev-env agent * lint protos * update protos & views * small bugfix & update tests * tweak protos * fix build issue from merge --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Foysal Ahamed <foysal@blueskyweb.xyz>
2024-03-06 17:56:34 -06:00
expect(res.ui('profileList')).toBeModerationResult([])
expect(res.ui('profileView')).toBeModerationResult([])
expect(res.ui('avatar')).toBeModerationResult([])
expect(res.ui('banner')).toBeModerationResult([])
expect(res.ui('displayName')).toBeModerationResult([])
expect(res.ui('contentList')).toBeModerationResult([])
expect(res.ui('contentView')).toBeModerationResult([])
expect(res.ui('contentMedia')).toBeModerationResult([])
})
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
it('Custom labels can set the default setting', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: true,
labels: {},
labelers: [
{
did: 'did:web:labeler.test',
labels: {},
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
labelDefs: {
'did:web:labeler.test': [
interpretLabelValueDefinition(
{
identifier: 'default-hide',
blurs: 'content',
severity: 'inform',
defaultSetting: 'hide',
locales: [],
},
'did:web:labeler.test',
),
interpretLabelValueDefinition(
{
identifier: 'default-warn',
blurs: 'content',
severity: 'inform',
defaultSetting: 'warn',
locales: [],
},
'did:web:labeler.test',
),
interpretLabelValueDefinition(
{
identifier: 'default-ignore',
blurs: 'content',
severity: 'inform',
defaultSetting: 'ignore',
locales: [],
},
'did:web:labeler.test',
),
],
},
}
const res1 = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'default-hide',
cts: new Date().toISOString(),
},
],
}),
modOpts,
)
expect(res1.ui('profileList')).toBeModerationResult([])
expect(res1.ui('profileView')).toBeModerationResult([])
expect(res1.ui('avatar')).toBeModerationResult([])
expect(res1.ui('banner')).toBeModerationResult([])
expect(res1.ui('displayName')).toBeModerationResult([])
expect(res1.ui('contentList')).toBeModerationResult(['filter', 'blur'])
expect(res1.ui('contentView')).toBeModerationResult(['inform'])
expect(res1.ui('contentMedia')).toBeModerationResult([])
const res2 = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'default-warn',
cts: new Date().toISOString(),
},
],
}),
modOpts,
)
expect(res2.ui('profileList')).toBeModerationResult([])
expect(res2.ui('profileView')).toBeModerationResult([])
expect(res2.ui('avatar')).toBeModerationResult([])
expect(res2.ui('banner')).toBeModerationResult([])
expect(res2.ui('displayName')).toBeModerationResult([])
expect(res2.ui('contentList')).toBeModerationResult(['blur'])
expect(res2.ui('contentView')).toBeModerationResult(['inform'])
expect(res2.ui('contentMedia')).toBeModerationResult([])
const res3 = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'default-ignore',
cts: new Date().toISOString(),
},
],
}),
modOpts,
)
expect(res3.ui('profileList')).toBeModerationResult([])
expect(res3.ui('profileView')).toBeModerationResult([])
expect(res3.ui('avatar')).toBeModerationResult([])
expect(res3.ui('banner')).toBeModerationResult([])
expect(res3.ui('displayName')).toBeModerationResult([])
expect(res3.ui('contentList')).toBeModerationResult([])
expect(res3.ui('contentView')).toBeModerationResult([])
expect(res3.ui('contentMedia')).toBeModerationResult([])
})
it('Custom labels can require adult content to be enabled', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: false,
labels: { adult: 'ignore' },
labelers: [
{
did: 'did:web:labeler.test',
labels: {
adult: 'ignore',
},
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
labelDefs: {
'did:web:labeler.test': [
interpretLabelValueDefinition(
{
identifier: 'adult',
blurs: 'content',
severity: 'inform',
defaultSetting: 'hide',
adultOnly: true,
locales: [],
},
'did:web:labeler.test',
),
],
},
}
const res = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'adult',
cts: new Date().toISOString(),
},
],
}),
modOpts,
)
expect(res.ui('profileList')).toBeModerationResult([])
expect(res.ui('profileView')).toBeModerationResult([])
expect(res.ui('avatar')).toBeModerationResult([])
expect(res.ui('banner')).toBeModerationResult([])
expect(res.ui('displayName')).toBeModerationResult([])
expect(res.ui('contentList')).toBeModerationResult([
'filter',
'blur',
'noOverride',
])
expect(res.ui('contentView')).toBeModerationResult(['blur', 'noOverride'])
expect(res.ui('contentMedia')).toBeModerationResult([])
})
it('Adult content disabled forces the preference to hide', () => {
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
const modOpts: ModerationOpts = {
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
userDid: 'did:web:alice.test',
prefs: {
adultContentEnabled: false,
labels: { porn: 'ignore' },
labelers: [
{
did: 'did:web:labeler.test',
labels: {},
},
],
Build system rework (#2169) * refactor(crypto): remove circular dependency * refactor(crypto): expose compress/decompress as part of the DidKeyPlugin interface * fix(crypto): remove import from private file * refactor: isolate tsconfig * fix: remove unused bench file * chore(repo): remove unused deps * fix(ozone): properly list dependencies * fix(services): do lint js files * fix(services/pds): remove unused deps * chore(pds): remove bench * chore(dev-env): remove unused deps * chore(api): remove bench * remove unused babel.config.js files * fix: remove .ts extension from import * fix(pds): remove imports of src files * fix(tsconfig): properly list all projects * fix(dev-env): remove imports of src files * fix(bsky): remove direct import to crypto src * fix(api): remove imports to api internals * chore(build): prevent bundling of built output * chore(dev): add "dev" script to build in watch mode * chore(deps): move ts-node dependency where it is actually used * fix(deps): add dev-env as project dependency * fix(xrpc-server): properly type kexicon * fix(bsky): improve typings * fix(pds): fully type formatRecordEmbedInternal return value * fix(repo): remove imports from @ipld/car/api * feat(dev-env): re-export BskyIngester * fix: properly lint & type jest config & test files * fix(ci): test after build * fix(types): use NodeJS.Timeout instead of NodeJS.Timer * fix(bsky): make types exportable * fix(ozone): make types exportable * fix(xrpc-server): make types exportable * fix(xprc-server): make code compliant with "node" types * fix(xrpc-server): avoid accessing properties of unknown * chore(deps): update @types/node * feat(tsconfig): narrow down available types depending on the package's target environment * fix(pds): remove unused prop * fix(bsync): Database's migrator not always initialized * fix(dev-env): remove unreachable code * fix(xrpc-server): remove unused import * fix(xrpc-server): mark header property as abstract * fix(pds): initialize LeakyTxPlugin's txOver property * fix(bsky): initialize LeakyTxPlugin's txOver property * fix(bsky): remove unused migrator from DatabaseCoordinator * fix(bsky): Properly initialize LabelService's cache property * fix(ozone): Database's migrator not initialized * fix(ozone): initialize LeakyTxPlugin's txOver property * fix(crypto): ignore unused variable error * feat(tsconfig): use stricter rules * feat(tsconfig): enable useDefineForClassFields * feat(xrpc-server): add support for brotli incoming payload * fix(xrpc-server): properly parse & process content-encoding * fix(common:stream): always call cb in _transform * tidy/fix tests and service entrypoints * Revert "fix(xrpc-server): properly parse & process content-encoding" This reverts commit 2b1c66e153820d3e128fc839fcc1834d52a66686. * Revert "feat(xrpc-server): add support for brotli incoming payload" This reverts commit e710c21e6118214ddf215b0515e68cb87299a952. * remove special node env for tests (defaults to jest val of "test") * kill mute sync handler on disconnect * work around connect-es bug w/ request aborts * style(crypto): rename imports from uint8arrays * fix update package-lock * fix lint * force hbs files to be bundled as cjs * fix: use concurrently instead of npm-run-all npm-run-all seems not to be maintained anymore. Additionally, concurrently better forwards signals to child processes. * remove concurrently alltogether * ignore sqlite files in services/pds * fix verify * fix verify * tidy, fix verify * fix blob diversion test * build rework changeset --------- Co-authored-by: Devin Ivy <devinivy@gmail.com>
2024-03-18 22:10:58 +01:00
hiddenPosts: [],
mutedWords: [],
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
},
labelDefs: {},
}
const res = moderatePost(
mock.postView({
record: {
text: 'Hello',
createdAt: new Date().toISOString(),
},
author: mock.profileViewBasic({
handle: 'bob.test',
displayName: 'Bob',
}),
labels: [
{
src: 'did:web:labeler.test',
uri: 'at://did:web:bob.test/app.bsky.post/fake',
val: 'porn',
cts: new Date().toISOString(),
},
],
}),
modOpts,
)
expect(res.ui('profileList')).toBeModerationResult([])
expect(res.ui('profileView')).toBeModerationResult([])
expect(res.ui('avatar')).toBeModerationResult([])
expect(res.ui('banner')).toBeModerationResult([])
expect(res.ui('displayName')).toBeModerationResult([])
expect(res.ui('contentList')).toBeModerationResult(['filter'])
expect(res.ui('contentView')).toBeModerationResult([])
expect(res.ui('contentMedia')).toBeModerationResult(['blur', 'noOverride'])
})
})