Set up additional mod authorities

This commit is contained in:
Eric Bailey
2024-09-04 14:52:12 -05:00
parent cd9c3bf498
commit be1f1e49dd
2 changed files with 19 additions and 0 deletions
@@ -0,0 +1,15 @@
import {BskyAgent} from '@atproto/api'
export const ADDITIONAL_LABELER = 'did:plc:oz5zavafp7szpd2yyko57ccz'
export const ADDITIONAL_LABELERS = {
category: [ADDITIONAL_LABELER],
}
export function configureAdditionalModerationAuthorities() {
BskyAgent.configure({
appLabelers: [
...BskyAgent.appLabelers,
...(ADDITIONAL_LABELERS.category ?? []),
],
})
}
+4
View File
@@ -1,6 +1,7 @@
import {BSKY_LABELER_DID, BskyAgent} from '@atproto/api' import {BSKY_LABELER_DID, BskyAgent} from '@atproto/api'
import {IS_TEST_USER} from '#/lib/constants' import {IS_TEST_USER} from '#/lib/constants'
import {configureAdditionalModerationAuthorities} from './additional-authorities'
import {readLabelers} from './agent-config' import {readLabelers} from './agent-config'
import {SessionAccount} from './types' import {SessionAccount} from './types'
@@ -8,6 +9,7 @@ export function configureModerationForGuest() {
// This global mutation is *only* OK because this code is only relevant for testing. // This global mutation is *only* OK because this code is only relevant for testing.
// Don't add any other global behavior here! // Don't add any other global behavior here!
switchToBskyAppLabeler() switchToBskyAppLabeler()
configureAdditionalModerationAuthorities()
} }
export async function configureModerationForAccount( export async function configureModerationForAccount(
@@ -31,6 +33,8 @@ export async function configureModerationForAccount(
// If there are no headers in the storage, we'll not send them on the initial requests. // If there are no headers in the storage, we'll not send them on the initial requests.
// If we wanted to fix this, we could block on the preferences query here. // If we wanted to fix this, we could block on the preferences query here.
} }
configureAdditionalModerationAuthorities()
} }
function switchToBskyAppLabeler() { function switchToBskyAppLabeler() {