Update deactivation through updateSubjectStatus (#2539)
* attach hosting status to entryway session responses * integrate account deactivation in with entryway * tidy * tidy * chnageset * update changeset
This commit is contained in:
parent
c5d36d5ba2
commit
9495af23bd
.changeset
lexicons/com/atproto/admin
packages
api/src/client
bsky/src/lexicon
ozone/src/lexicon
pds/src
api/com/atproto/admin
lexicon
7
.changeset/thirty-dolls-try.md
Normal file
7
.changeset/thirty-dolls-try.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"@atproto/api": patch
|
||||
"@atproto/pds": patch
|
||||
"@atproto/dev-env": patch
|
||||
---
|
||||
|
||||
Allow updating deactivation state through admin.updateSubjectStatus
|
@ -22,6 +22,10 @@
|
||||
"takedown": {
|
||||
"type": "ref",
|
||||
"ref": "com.atproto.admin.defs#statusAttr"
|
||||
},
|
||||
"deactivated": {
|
||||
"type": "ref",
|
||||
"ref": "com.atproto.admin.defs#statusAttr"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -535,6 +535,10 @@ export const schemaDict = {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
deactivated: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -18,6 +18,7 @@ export interface InputSchema {
|
||||
| ComAtprotoAdminDefs.RepoBlobRef
|
||||
| { $type: string; [k: string]: unknown }
|
||||
takedown?: ComAtprotoAdminDefs.StatusAttr
|
||||
deactivated?: ComAtprotoAdminDefs.StatusAttr
|
||||
[k: string]: unknown
|
||||
}
|
||||
|
||||
|
@ -535,6 +535,10 @@ export const schemaDict = {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
deactivated: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -19,6 +19,7 @@ export interface InputSchema {
|
||||
| ComAtprotoAdminDefs.RepoBlobRef
|
||||
| { $type: string; [k: string]: unknown }
|
||||
takedown?: ComAtprotoAdminDefs.StatusAttr
|
||||
deactivated?: ComAtprotoAdminDefs.StatusAttr
|
||||
[k: string]: unknown
|
||||
}
|
||||
|
||||
|
@ -535,6 +535,10 @@ export const schemaDict = {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
deactivated: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -19,6 +19,7 @@ export interface InputSchema {
|
||||
| ComAtprotoAdminDefs.RepoBlobRef
|
||||
| { $type: string; [k: string]: unknown }
|
||||
takedown?: ComAtprotoAdminDefs.StatusAttr
|
||||
deactivated?: ComAtprotoAdminDefs.StatusAttr
|
||||
[k: string]: unknown
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ export default function (server: Server, ctx: AppContext) {
|
||||
server.com.atproto.admin.updateSubjectStatus({
|
||||
auth: ctx.authVerifier.moderator,
|
||||
handler: async ({ input }) => {
|
||||
const { subject, takedown } = input.body
|
||||
const { subject, takedown, deactivated } = input.body
|
||||
if (takedown) {
|
||||
if (isRepoRef(subject)) {
|
||||
await ctx.accountManager.takedownAccount(subject.did, takedown)
|
||||
@ -36,6 +36,16 @@ export default function (server: Server, ctx: AppContext) {
|
||||
}
|
||||
}
|
||||
|
||||
if (deactivated) {
|
||||
if (isRepoRef(subject)) {
|
||||
if (deactivated.applied) {
|
||||
await ctx.accountManager.deactivateAccount(subject.did, null)
|
||||
} else {
|
||||
await ctx.accountManager.activateAccount(subject.did)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
encoding: 'application/json',
|
||||
body: {
|
||||
|
@ -535,6 +535,10 @@ export const schemaDict = {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
deactivated: {
|
||||
type: 'ref',
|
||||
ref: 'lex:com.atproto.admin.defs#statusAttr',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -19,6 +19,7 @@ export interface InputSchema {
|
||||
| ComAtprotoAdminDefs.RepoBlobRef
|
||||
| { $type: string; [k: string]: unknown }
|
||||
takedown?: ComAtprotoAdminDefs.StatusAttr
|
||||
deactivated?: ComAtprotoAdminDefs.StatusAttr
|
||||
[k: string]: unknown
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user