Skip to content

Commit

Permalink
Merge branch 'ozone-acls-take2' into pds-proxy-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Mar 5, 2024
2 parents 5f3c91b + fc1c40d commit 483b71f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/bsky/src/auth-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class AuthVerifier {
}
const [did, serviceId] = iss.split('#')
const keyId =
serviceId === 'atproto-labeler' ? 'atproto-label' : 'atproto'
serviceId === 'atproto_labeler' ? 'atproto_label' : 'atproto'
let identity: GetIdentityByDidResponse
try {
identity = await this.dataplane.getIdentityByDid({ did })
Expand Down
24 changes: 15 additions & 9 deletions packages/ozone/src/mod-service/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { REASONOTHER } from '../lexicon/types/com/atproto/moderation/defs'
import { subjectFromEventRow, subjectFromStatusRow } from './subject'
import { formatLabel } from './util'
import { httpLogger as log } from '../logger'

export type AuthHeaders = {
headers: {
Expand All @@ -43,15 +44,20 @@ export class ModerationViews {
if (dids.length === 0) return new Map()
const auth = await this.appviewAuth()
if (!auth) return new Map()
const res = await this.appviewAgent.api.com.atproto.admin.getAccountInfos(
{
dids: dedupeStrs(dids),
},
auth,
)
return res.data.infos.reduce((acc, cur) => {
return acc.set(cur.did, cur)
}, new Map<string, AccountView>())
try {
const res = await this.appviewAgent.api.com.atproto.admin.getAccountInfos(
{
dids: dedupeStrs(dids),
},
auth,
)
return res.data.infos.reduce((acc, cur) => {
return acc.set(cur.did, cur)
}, new Map<string, AccountView>())
} catch (err) {
log.error({ err, dids }, 'failed to resolve account infos from appview')
return new Map()
}
}

async repos(dids: string[]): Promise<Map<string, RepoView>> {
Expand Down

0 comments on commit 483b71f

Please sign in to comment.