Skip to content

Commit

Permalink
PDS: allow admins to update to any valid handle (#3603)
Browse files Browse the repository at this point in the history
on admin.updateAccountHandle, permit any valid handle as break glass measure
  • Loading branch information
devinivy authored Mar 3, 2025
1 parent 6bcbb6d commit 442fcce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function (server: Server, ctx: AppContext) {
ctx,
handle: input.body.handle,
did,
allowReserved: true,
allowAnyValid: true,
})

// Pessimistic check to handle spam: also enforced by updateHandle() and the db.
Expand Down
8 changes: 4 additions & 4 deletions packages/pds/src/handle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export const normalizeAndValidateHandle = async (opts: {
ctx: AppContext
handle: string
did?: string
allowReserved?: boolean
allowAnyValid?: boolean
}): Promise<string> => {
const { ctx, did, allowReserved } = opts
const { ctx, did, allowAnyValid } = opts
// base formatting validation
const handle = baseNormalizeAndValidate(opts.handle)
// tld validation
Expand All @@ -21,7 +21,7 @@ export const normalizeAndValidateHandle = async (opts: {
)
}
// slur check
if (hasExplicitSlur(handle)) {
if (!allowAnyValid && hasExplicitSlur(handle)) {
throw new InvalidRequestError(
'Inappropriate language in handle',
'InvalidHandle',
Expand All @@ -32,7 +32,7 @@ export const normalizeAndValidateHandle = async (opts: {
ensureHandleServiceConstraints(
handle,
ctx.cfg.identity.serviceHandleDomains,
allowReserved,
allowAnyValid,
)
} else {
if (opts.did === undefined) {
Expand Down

0 comments on commit 442fcce

Please sign in to comment.