@atproto/pds 0.4.29 → 0.4.31
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/dist/account-manager/helpers/account.d.ts +13 -1
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js +24 -7
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/account-manager/index.d.ts +4 -1
- package/dist/account-manager/index.d.ts.map +1 -1
- package/dist/account-manager/index.js +2 -2
- package/dist/account-manager/index.js.map +1 -1
- package/dist/api/app/bsky/actor/getPreferences.js +1 -1
- package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfile.js +1 -1
- package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
- package/dist/api/app/bsky/actor/putPreferences.js +1 -1
- package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.js +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +1 -1
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
- package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/registerPush.js +4 -1
- package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
- package/dist/api/chat/index.js +14 -14
- package/dist/api/chat/index.js.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfo.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfo.js +1 -0
- package/dist/api/com/atproto/admin/getAccountInfo.js.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.js +4 -3
- package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.js +11 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js +1 -1
- package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js.map +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.js +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.js +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.js +4 -1
- package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.js +4 -1
- package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js +4 -1
- package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/importRepo.js +3 -1
- package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
- package/dist/api/com/atproto/repo/listMissingBlobs.js +1 -1
- package/dist/api/com/atproto/repo/listMissingBlobs.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js +4 -1
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/uploadBlob.js +3 -1
- package/dist/api/com/atproto/repo/uploadBlob.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js +1 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/checkAccountStatus.js +1 -1
- package/dist/api/com/atproto/server/checkAccountStatus.js.map +1 -1
- package/dist/api/com/atproto/server/confirmEmail.js +1 -1
- package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.js +3 -1
- package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createSession.js +2 -0
- package/dist/api/com/atproto/server/createSession.js.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.js +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.js +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
- package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getSession.js +7 -2
- package/dist/api/com/atproto/server/getSession.js.map +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.js +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.js +2 -0
- package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.js +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.js +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.js +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.js +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/updateEmail.js +1 -1
- package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.js +2 -2
- package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/api/com/atproto/sync/util.d.ts +1 -8
- package/dist/api/com/atproto/sync/util.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/util.js +1 -17
- package/dist/api/com/atproto/sync/util.js.map +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.d.ts.map +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.js +4 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
- package/dist/auth-verifier.d.ts +13 -7
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +29 -46
- package/dist/auth-verifier.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +44 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +44 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/defs.js.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +3 -0
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js +17 -14
- package/dist/pipethrough.js.map +1 -1
- package/package.json +4 -4
- package/src/account-manager/helpers/account.ts +30 -6
- package/src/account-manager/index.ts +2 -2
- package/src/api/app/bsky/actor/getPreferences.ts +1 -1
- package/src/api/app/bsky/actor/getProfile.ts +1 -1
- package/src/api/app/bsky/actor/getProfiles.ts +1 -1
- package/src/api/app/bsky/actor/putPreferences.ts +1 -1
- package/src/api/app/bsky/feed/getActorLikes.ts +1 -1
- package/src/api/app/bsky/feed/getAuthorFeed.ts +1 -1
- package/src/api/app/bsky/feed/getFeed.ts +1 -1
- package/src/api/app/bsky/feed/getPostThread.ts +1 -1
- package/src/api/app/bsky/feed/getTimeline.ts +1 -1
- package/src/api/app/bsky/notification/registerPush.ts +4 -1
- package/src/api/chat/index.ts +14 -14
- package/src/api/com/atproto/admin/getAccountInfo.ts +1 -0
- package/src/api/com/atproto/admin/getSubjectStatus.ts +4 -3
- package/src/api/com/atproto/admin/updateSubjectStatus.ts +11 -1
- package/src/api/com/atproto/identity/getRecommendedDidCredentials.ts +1 -1
- package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +1 -1
- package/src/api/com/atproto/identity/signPlcOperation.ts +1 -1
- package/src/api/com/atproto/identity/submitPlcOperation.ts +1 -1
- package/src/api/com/atproto/identity/updateHandle.ts +1 -1
- package/src/api/com/atproto/repo/applyWrites.ts +4 -1
- package/src/api/com/atproto/repo/createRecord.ts +4 -1
- package/src/api/com/atproto/repo/deleteRecord.ts +4 -1
- package/src/api/com/atproto/repo/importRepo.ts +3 -1
- package/src/api/com/atproto/repo/listMissingBlobs.ts +1 -1
- package/src/api/com/atproto/repo/putRecord.ts +4 -1
- package/src/api/com/atproto/repo/uploadBlob.ts +3 -1
- package/src/api/com/atproto/server/activateAccount.ts +1 -1
- package/src/api/com/atproto/server/checkAccountStatus.ts +1 -1
- package/src/api/com/atproto/server/confirmEmail.ts +1 -1
- package/src/api/com/atproto/server/createAppPassword.ts +3 -1
- package/src/api/com/atproto/server/createSession.ts +2 -0
- package/src/api/com/atproto/server/deactivateAccount.ts +1 -1
- package/src/api/com/atproto/server/getAccountInviteCodes.ts +1 -1
- package/src/api/com/atproto/server/getServiceAuth.ts +1 -1
- package/src/api/com/atproto/server/getSession.ts +7 -2
- package/src/api/com/atproto/server/listAppPasswords.ts +1 -1
- package/src/api/com/atproto/server/refreshSession.ts +2 -0
- package/src/api/com/atproto/server/requestAccountDelete.ts +1 -1
- package/src/api/com/atproto/server/requestEmailConfirmation.ts +1 -1
- package/src/api/com/atproto/server/requestEmailUpdate.ts +1 -1
- package/src/api/com/atproto/server/revokeAppPassword.ts +1 -1
- package/src/api/com/atproto/server/updateEmail.ts +1 -1
- package/src/api/com/atproto/sync/getRepoStatus.ts +2 -2
- package/src/api/com/atproto/sync/listRepos.ts +1 -1
- package/src/api/com/atproto/sync/util.ts +1 -24
- package/src/api/com/atproto/temp/checkSignupQueue.ts +4 -1
- package/src/auth-verifier.ts +62 -47
- package/src/lexicon/lexicons.ts +47 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +1 -0
- package/src/lexicon/types/com/atproto/server/createSession.ts +3 -0
- package/src/lexicon/types/com/atproto/server/getSession.ts +3 -0
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +3 -0
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
- package/src/pipethrough.ts +5 -4
- package/tests/account-deactivation.test.ts +31 -2
- package/tests/auth.test.ts +3 -0
package/src/api/chat/index.ts
CHANGED
@@ -4,85 +4,85 @@ import { pipethrough, pipethroughProcedure } from '../../pipethrough'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.chat.bsky.actor.deleteAccount({
|
7
|
-
auth: ctx.authVerifier.
|
7
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
8
8
|
handler: async ({ req, auth }) => {
|
9
9
|
return pipethroughProcedure(ctx, req, auth.credentials.did)
|
10
10
|
},
|
11
11
|
})
|
12
12
|
server.chat.bsky.actor.exportAccountData({
|
13
|
-
auth: ctx.authVerifier.
|
13
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
14
14
|
handler: ({ req, auth }) => {
|
15
15
|
return pipethrough(ctx, req, auth.credentials.did)
|
16
16
|
},
|
17
17
|
})
|
18
18
|
server.chat.bsky.convo.deleteMessageForSelf({
|
19
|
-
auth: ctx.authVerifier.
|
19
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
20
20
|
handler: ({ req, auth, input }) => {
|
21
21
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
22
22
|
},
|
23
23
|
})
|
24
24
|
server.chat.bsky.convo.getConvo({
|
25
|
-
auth: ctx.authVerifier.
|
25
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
26
26
|
handler: ({ req, auth }) => {
|
27
27
|
return pipethrough(ctx, req, auth.credentials.did)
|
28
28
|
},
|
29
29
|
})
|
30
30
|
server.chat.bsky.convo.getConvoForMembers({
|
31
|
-
auth: ctx.authVerifier.
|
31
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
32
32
|
handler: ({ req, auth }) => {
|
33
33
|
return pipethrough(ctx, req, auth.credentials.did)
|
34
34
|
},
|
35
35
|
})
|
36
36
|
server.chat.bsky.convo.getLog({
|
37
|
-
auth: ctx.authVerifier.
|
37
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
38
38
|
handler: ({ req, auth }) => {
|
39
39
|
return pipethrough(ctx, req, auth.credentials.did)
|
40
40
|
},
|
41
41
|
})
|
42
42
|
server.chat.bsky.convo.getMessages({
|
43
|
-
auth: ctx.authVerifier.
|
43
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
44
44
|
handler: ({ req, auth }) => {
|
45
45
|
return pipethrough(ctx, req, auth.credentials.did)
|
46
46
|
},
|
47
47
|
})
|
48
48
|
server.chat.bsky.convo.leaveConvo({
|
49
|
-
auth: ctx.authVerifier.
|
49
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
50
50
|
handler: ({ req, auth, input }) => {
|
51
51
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
52
52
|
},
|
53
53
|
})
|
54
54
|
server.chat.bsky.convo.listConvos({
|
55
|
-
auth: ctx.authVerifier.
|
55
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
56
56
|
handler: ({ req, auth }) => {
|
57
57
|
return pipethrough(ctx, req, auth.credentials.did)
|
58
58
|
},
|
59
59
|
})
|
60
60
|
server.chat.bsky.convo.muteConvo({
|
61
|
-
auth: ctx.authVerifier.
|
61
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
62
62
|
handler: ({ req, auth, input }) => {
|
63
63
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
64
64
|
},
|
65
65
|
})
|
66
66
|
server.chat.bsky.convo.sendMessage({
|
67
|
-
auth: ctx.authVerifier.
|
67
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
68
68
|
handler: ({ req, auth, input }) => {
|
69
69
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
70
70
|
},
|
71
71
|
})
|
72
72
|
server.chat.bsky.convo.sendMessageBatch({
|
73
|
-
auth: ctx.authVerifier.
|
73
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
74
74
|
handler: ({ req, auth, input }) => {
|
75
75
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
76
76
|
},
|
77
77
|
})
|
78
78
|
server.chat.bsky.convo.unmuteConvo({
|
79
|
-
auth: ctx.authVerifier.
|
79
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
80
80
|
handler: ({ req, auth, input }) => {
|
81
81
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
82
82
|
},
|
83
83
|
})
|
84
84
|
server.chat.bsky.convo.updateRead({
|
85
|
-
auth: ctx.authVerifier.
|
85
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
86
86
|
handler: ({ req, auth, input }) => {
|
87
87
|
return pipethroughProcedure(ctx, req, auth.credentials.did, input.body)
|
88
88
|
},
|
@@ -51,14 +51,15 @@ export default function (server: Server, ctx: AppContext) {
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
} else if (did) {
|
54
|
-
const
|
55
|
-
if (
|
54
|
+
const status = await ctx.accountManager.getAccountAdminStatus(did)
|
55
|
+
if (status) {
|
56
56
|
body = {
|
57
57
|
subject: {
|
58
58
|
$type: 'com.atproto.admin.defs#repoRef',
|
59
59
|
did: did,
|
60
60
|
},
|
61
|
-
takedown,
|
61
|
+
takedown: status.takedown,
|
62
|
+
deactivated: status.deactivated,
|
62
63
|
}
|
63
64
|
}
|
64
65
|
} else {
|
@@ -13,7 +13,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
13
13
|
server.com.atproto.admin.updateSubjectStatus({
|
14
14
|
auth: ctx.authVerifier.moderator,
|
15
15
|
handler: async ({ input }) => {
|
16
|
-
const { subject, takedown } = input.body
|
16
|
+
const { subject, takedown, deactivated } = input.body
|
17
17
|
if (takedown) {
|
18
18
|
if (isRepoRef(subject)) {
|
19
19
|
await ctx.accountManager.takedownAccount(subject.did, takedown)
|
@@ -36,6 +36,16 @@ export default function (server: Server, ctx: AppContext) {
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
+
if (deactivated) {
|
40
|
+
if (isRepoRef(subject)) {
|
41
|
+
if (deactivated.applied) {
|
42
|
+
await ctx.accountManager.deactivateAccount(subject.did, null)
|
43
|
+
} else {
|
44
|
+
await ctx.accountManager.activateAccount(subject.did)
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
39
49
|
return {
|
40
50
|
encoding: 'application/json',
|
41
51
|
body: {
|
@@ -3,7 +3,7 @@ import AppContext from '../../../../context'
|
|
3
3
|
|
4
4
|
export default function (server: Server, ctx: AppContext) {
|
5
5
|
server.com.atproto.identity.getRecommendedDidCredentials({
|
6
|
-
auth: ctx.authVerifier.
|
6
|
+
auth: ctx.authVerifier.accessStandard(),
|
7
7
|
handler: async ({ auth }) => {
|
8
8
|
const requester = auth.credentials.did
|
9
9
|
const signingKey = await ctx.actorStore.keypair(requester)
|
@@ -5,7 +5,7 @@ import { authPassthru } from '../../../proxy'
|
|
5
5
|
|
6
6
|
export default function (server: Server, ctx: AppContext) {
|
7
7
|
server.com.atproto.identity.requestPlcOperationSignature({
|
8
|
-
auth: ctx.authVerifier.accessFull,
|
8
|
+
auth: ctx.authVerifier.accessFull(),
|
9
9
|
handler: async ({ auth, req }) => {
|
10
10
|
if (ctx.entrywayAgent) {
|
11
11
|
await ctx.entrywayAgent.com.atproto.identity.requestPlcOperationSignature(
|
@@ -7,7 +7,7 @@ import { authPassthru, resultPassthru } from '../../../proxy'
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.identity.signPlcOperation({
|
10
|
-
auth: ctx.authVerifier.accessFull,
|
10
|
+
auth: ctx.authVerifier.accessFull(),
|
11
11
|
handler: async ({ auth, input, req }) => {
|
12
12
|
if (ctx.entrywayAgent) {
|
13
13
|
return resultPassthru(
|
@@ -7,7 +7,7 @@ import { httpLogger as log } from '../../../../logger'
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.identity.submitPlcOperation({
|
10
|
-
auth: ctx.authVerifier.
|
10
|
+
auth: ctx.authVerifier.accessStandard(),
|
11
11
|
handler: async ({ auth, input }) => {
|
12
12
|
const requester = auth.credentials.did
|
13
13
|
const op = input.body.operation
|
@@ -8,7 +8,7 @@ import { authPassthru } from '../../../proxy'
|
|
8
8
|
|
9
9
|
export default function (server: Server, ctx: AppContext) {
|
10
10
|
server.com.atproto.identity.updateHandle({
|
11
|
-
auth: ctx.authVerifier.
|
11
|
+
auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
|
12
12
|
rateLimit: [
|
13
13
|
{
|
14
14
|
durationMs: 5 * MINUTE,
|
@@ -31,7 +31,10 @@ const ratelimitPoints = ({ input }: { input: HandlerInput }) => {
|
|
31
31
|
|
32
32
|
export default function (server: Server, ctx: AppContext) {
|
33
33
|
server.com.atproto.repo.applyWrites({
|
34
|
-
auth: ctx.authVerifier.
|
34
|
+
auth: ctx.authVerifier.accessStandard({
|
35
|
+
checkTakedown: true,
|
36
|
+
checkDeactivated: true,
|
37
|
+
}),
|
35
38
|
rateLimit: [
|
36
39
|
{
|
37
40
|
name: 'repo-write-hour',
|
@@ -12,7 +12,10 @@ import AppContext from '../../../../context'
|
|
12
12
|
|
13
13
|
export default function (server: Server, ctx: AppContext) {
|
14
14
|
server.com.atproto.repo.createRecord({
|
15
|
-
auth: ctx.authVerifier.
|
15
|
+
auth: ctx.authVerifier.accessStandard({
|
16
|
+
checkTakedown: true,
|
17
|
+
checkDeactivated: true,
|
18
|
+
}),
|
16
19
|
rateLimit: [
|
17
20
|
{
|
18
21
|
name: 'repo-write-hour',
|
@@ -7,7 +7,10 @@ import { CID } from 'multiformats/cid'
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.repo.deleteRecord({
|
10
|
-
auth: ctx.authVerifier.
|
10
|
+
auth: ctx.authVerifier.accessStandard({
|
11
|
+
checkTakedown: true,
|
12
|
+
checkDeactivated: true,
|
13
|
+
}),
|
11
14
|
rateLimit: [
|
12
15
|
{
|
13
16
|
name: 'repo-write-hour',
|
@@ -17,7 +17,9 @@ import { BlobRef, LexValue, RepoRecord } from '@atproto/lexicon'
|
|
17
17
|
|
18
18
|
export default function (server: Server, ctx: AppContext) {
|
19
19
|
server.com.atproto.repo.importRepo({
|
20
|
-
auth: ctx.authVerifier.accessFull
|
20
|
+
auth: ctx.authVerifier.accessFull({
|
21
|
+
checkTakedown: true,
|
22
|
+
}),
|
21
23
|
handler: async ({ input, auth }) => {
|
22
24
|
const did = auth.credentials.did
|
23
25
|
if (!ctx.cfg.service.acceptingImports) {
|
@@ -3,7 +3,7 @@ import AppContext from '../../../../context'
|
|
3
3
|
|
4
4
|
export default function (server: Server, ctx: AppContext) {
|
5
5
|
server.com.atproto.repo.listMissingBlobs({
|
6
|
-
auth: ctx.authVerifier.
|
6
|
+
auth: ctx.authVerifier.accessStandard(),
|
7
7
|
handler: async ({ auth, params }) => {
|
8
8
|
const did = auth.credentials.did
|
9
9
|
const { limit, cursor } = params
|
@@ -19,7 +19,10 @@ import { ActorStoreTransactor } from '../../../../actor-store'
|
|
19
19
|
|
20
20
|
export default function (server: Server, ctx: AppContext) {
|
21
21
|
server.com.atproto.repo.putRecord({
|
22
|
-
auth: ctx.authVerifier.
|
22
|
+
auth: ctx.authVerifier.accessStandard({
|
23
|
+
checkTakedown: true,
|
24
|
+
checkDeactivated: true,
|
25
|
+
}),
|
23
26
|
rateLimit: [
|
24
27
|
{
|
25
28
|
name: 'repo-write-hour',
|
@@ -6,7 +6,9 @@ import { BlobMetadata } from '../../../../actor-store/blob/transactor'
|
|
6
6
|
|
7
7
|
export default function (server: Server, ctx: AppContext) {
|
8
8
|
server.com.atproto.repo.uploadBlob({
|
9
|
-
auth: ctx.authVerifier.
|
9
|
+
auth: ctx.authVerifier.accessStandard({
|
10
|
+
checkTakedown: true,
|
11
|
+
}),
|
10
12
|
rateLimit: {
|
11
13
|
durationMs: DAY,
|
12
14
|
points: 1000,
|
@@ -7,7 +7,7 @@ import { assertValidDidDocumentForService } from './util'
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.server.activateAccount({
|
10
|
-
auth: ctx.authVerifier.accessFull,
|
10
|
+
auth: ctx.authVerifier.accessFull(),
|
11
11
|
handler: async ({ auth }) => {
|
12
12
|
const requester = auth.credentials.did
|
13
13
|
|
@@ -4,7 +4,7 @@ import { isValidDidDocForService } from './util'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.server.checkAccountStatus({
|
7
|
-
auth: ctx.authVerifier.
|
7
|
+
auth: ctx.authVerifier.accessStandard(),
|
8
8
|
handler: async ({ auth }) => {
|
9
9
|
const requester = auth.credentials.did
|
10
10
|
const [
|
@@ -5,7 +5,7 @@ import { authPassthru } from '../../../proxy'
|
|
5
5
|
|
6
6
|
export default function (server: Server, ctx: AppContext) {
|
7
7
|
server.com.atproto.server.confirmEmail({
|
8
|
-
auth: ctx.authVerifier.
|
8
|
+
auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
|
9
9
|
handler: async ({ auth, input, req }) => {
|
10
10
|
const did = auth.credentials.did
|
11
11
|
|
@@ -4,7 +4,9 @@ import { authPassthru, resultPassthru } from '../../../proxy'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.server.createAppPassword({
|
7
|
-
auth: ctx.authVerifier.accessFull
|
7
|
+
auth: ctx.authVerifier.accessFull({
|
8
|
+
checkTakedown: true,
|
9
|
+
}),
|
8
10
|
handler: async ({ auth, input, req }) => {
|
9
11
|
if (ctx.entrywayAgent) {
|
10
12
|
return resultPassthru(
|
@@ -3,7 +3,7 @@ import AppContext from '../../../../context'
|
|
3
3
|
|
4
4
|
export default function (server: Server, ctx: AppContext) {
|
5
5
|
server.com.atproto.server.deactivateAccount({
|
6
|
-
auth: ctx.authVerifier.accessFull,
|
6
|
+
auth: ctx.authVerifier.accessFull(),
|
7
7
|
handler: async ({ auth, input }) => {
|
8
8
|
const requester = auth.credentials.did
|
9
9
|
await ctx.accountManager.deactivateAccount(
|
@@ -7,7 +7,7 @@ import { authPassthru, resultPassthru } from '../../../proxy'
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.server.getAccountInviteCodes({
|
10
|
-
auth: ctx.authVerifier.accessFull,
|
10
|
+
auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
|
11
11
|
handler: async ({ params, auth, req }) => {
|
12
12
|
if (ctx.entrywayAgent) {
|
13
13
|
return resultPassthru(
|
@@ -4,7 +4,7 @@ import { Server } from '../../../../lexicon'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.server.getServiceAuth({
|
7
|
-
auth: ctx.authVerifier.
|
7
|
+
auth: ctx.authVerifier.accessPrivileged(),
|
8
8
|
handler: async ({ params, auth }) => {
|
9
9
|
const did = auth.credentials.did
|
10
10
|
const keypair = await ctx.actorStore.keypair(did)
|
@@ -4,10 +4,13 @@ import AppContext from '../../../../context'
|
|
4
4
|
import { Server } from '../../../../lexicon'
|
5
5
|
import { authPassthru, resultPassthru } from '../../../proxy'
|
6
6
|
import { didDocForSession } from './util'
|
7
|
+
import { AuthScope } from '../../../../auth-verifier'
|
7
8
|
|
8
9
|
export default function (server: Server, ctx: AppContext) {
|
9
10
|
server.com.atproto.server.getSession({
|
10
|
-
auth: ctx.authVerifier.
|
11
|
+
auth: ctx.authVerifier.accessStandard({
|
12
|
+
additional: [AuthScope.SignupQueued],
|
13
|
+
}),
|
11
14
|
handler: async ({ auth, req }) => {
|
12
15
|
if (ctx.entrywayAgent) {
|
13
16
|
return resultPassthru(
|
@@ -20,7 +23,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
20
23
|
|
21
24
|
const did = auth.credentials.did
|
22
25
|
const [user, didDoc] = await Promise.all([
|
23
|
-
ctx.accountManager.getAccount(did),
|
26
|
+
ctx.accountManager.getAccount(did, { includeDeactivated: true }),
|
24
27
|
didDocForSession(ctx, did),
|
25
28
|
])
|
26
29
|
if (!user) {
|
@@ -36,6 +39,8 @@ export default function (server: Server, ctx: AppContext) {
|
|
36
39
|
email: user.email ?? undefined,
|
37
40
|
didDoc,
|
38
41
|
emailConfirmed: !!user.emailConfirmedAt,
|
42
|
+
active: user.active,
|
43
|
+
status: user.status,
|
39
44
|
},
|
40
45
|
}
|
41
46
|
},
|
@@ -4,7 +4,7 @@ import { authPassthru, resultPassthru } from '../../../proxy'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.server.listAppPasswords({
|
7
|
-
auth: ctx.authVerifier.
|
7
|
+
auth: ctx.authVerifier.accessStandard(),
|
8
8
|
handler: async ({ auth, req }) => {
|
9
9
|
if (ctx.entrywayAgent) {
|
10
10
|
return resultPassthru(
|
@@ -18,7 +18,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
18
18
|
calcKey: ({ auth }) => auth.credentials.did,
|
19
19
|
},
|
20
20
|
],
|
21
|
-
auth: ctx.authVerifier.
|
21
|
+
auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
|
22
22
|
handler: async ({ auth, req }) => {
|
23
23
|
const did = auth.credentials.did
|
24
24
|
const account = await ctx.accountManager.getAccount(did, {
|
@@ -18,7 +18,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
18
18
|
calcKey: ({ auth }) => auth.credentials.did,
|
19
19
|
},
|
20
20
|
],
|
21
|
-
auth: ctx.authVerifier.
|
21
|
+
auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
|
22
22
|
handler: async ({ auth, req }) => {
|
23
23
|
const did = auth.credentials.did
|
24
24
|
const account = await ctx.accountManager.getAccount(did, {
|
@@ -18,7 +18,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
18
18
|
calcKey: ({ auth }) => auth.credentials.did,
|
19
19
|
},
|
20
20
|
],
|
21
|
-
auth: ctx.authVerifier.
|
21
|
+
auth: ctx.authVerifier.accessStandard({ checkTakedown: true }),
|
22
22
|
handler: async ({ auth, req }) => {
|
23
23
|
const did = auth.credentials.did
|
24
24
|
const account = await ctx.accountManager.getAccount(did, {
|
@@ -4,7 +4,7 @@ import { authPassthru } from '../../../proxy'
|
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.server.revokeAppPassword({
|
7
|
-
auth: ctx.authVerifier.
|
7
|
+
auth: ctx.authVerifier.accessStandard(),
|
8
8
|
handler: async ({ auth, input, req }) => {
|
9
9
|
if (ctx.entrywayAgent) {
|
10
10
|
await ctx.entrywayAgent.com.atproto.server.revokeAppPassword(
|
@@ -7,7 +7,7 @@ import { UserAlreadyExistsError } from '../../../../account-manager/helpers/acco
|
|
7
7
|
|
8
8
|
export default function (server: Server, ctx: AppContext) {
|
9
9
|
server.com.atproto.server.updateEmail({
|
10
|
-
auth: ctx.authVerifier.accessFull,
|
10
|
+
auth: ctx.authVerifier.accessFull({ checkTakedown: true }),
|
11
11
|
handler: async ({ auth, input, req }) => {
|
12
12
|
const did = auth.credentials.did
|
13
13
|
const { token, email } = input.body
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { Server } from '../../../../lexicon'
|
2
2
|
import AppContext from '../../../../context'
|
3
|
-
import { assertRepoAvailability
|
3
|
+
import { assertRepoAvailability } from './util'
|
4
4
|
|
5
5
|
export default function (server: Server, ctx: AppContext) {
|
6
6
|
server.com.atproto.sync.getRepoStatus({
|
7
7
|
handler: async ({ params }) => {
|
8
8
|
const { did } = params
|
9
9
|
const account = await assertRepoAvailability(ctx, did, true)
|
10
|
-
const { active, status } =
|
10
|
+
const { active, status } = account
|
11
11
|
|
12
12
|
let rev: string | undefined = undefined
|
13
13
|
if (active) {
|
@@ -2,7 +2,7 @@ import { InvalidRequestError } from '@atproto/xrpc-server'
|
|
2
2
|
import { Server } from '../../../../lexicon'
|
3
3
|
import AppContext from '../../../../context'
|
4
4
|
import { Cursor, GenericKeyset, paginate } from '../../../../db/pagination'
|
5
|
-
import { formatAccountStatus } from '
|
5
|
+
import { formatAccountStatus } from '../../../../account-manager/helpers/account'
|
6
6
|
|
7
7
|
export default function (server: Server, ctx: AppContext) {
|
8
8
|
server.com.atproto.sync.listRepos(async ({ params }) => {
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import { InvalidRequestError } from '@atproto/xrpc-server'
|
2
|
-
import {
|
3
|
-
AccountStatus,
|
4
|
-
ActorAccount,
|
5
|
-
} from '../../../../account-manager/helpers/account'
|
2
|
+
import { ActorAccount } from '../../../../account-manager/helpers/account'
|
6
3
|
import AppContext from '../../../../context'
|
7
4
|
|
8
5
|
export const assertRepoAvailability = async (
|
@@ -37,23 +34,3 @@ export const assertRepoAvailability = async (
|
|
37
34
|
}
|
38
35
|
return account
|
39
36
|
}
|
40
|
-
|
41
|
-
export const formatAccountStatus = (account: {
|
42
|
-
takedownRef: string | null
|
43
|
-
deactivatedAt: string | null
|
44
|
-
}): {
|
45
|
-
active: boolean
|
46
|
-
status?: AccountStatus
|
47
|
-
} => {
|
48
|
-
let status: AccountStatus | undefined = undefined
|
49
|
-
if (account.takedownRef) {
|
50
|
-
status = AccountStatus.Takendown
|
51
|
-
} else if (account.deactivatedAt) {
|
52
|
-
status = AccountStatus.Deactivated
|
53
|
-
}
|
54
|
-
const active = !status
|
55
|
-
return {
|
56
|
-
active,
|
57
|
-
status,
|
58
|
-
}
|
59
|
-
}
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import { Server } from '../../../../lexicon'
|
2
2
|
import AppContext from '../../../../context'
|
3
3
|
import { authPassthru, resultPassthru } from '../../../proxy'
|
4
|
+
import { AuthScope } from '../../../../auth-verifier'
|
4
5
|
|
5
6
|
// THIS IS A TEMPORARY UNSPECCED ROUTE
|
6
7
|
export default function (server: Server, ctx: AppContext) {
|
7
8
|
server.com.atproto.temp.checkSignupQueue({
|
8
|
-
auth: ctx.authVerifier.
|
9
|
+
auth: ctx.authVerifier.accessStandard({
|
10
|
+
additional: [AuthScope.SignupQueued],
|
11
|
+
}),
|
9
12
|
handler: async ({ req }) => {
|
10
13
|
if (!ctx.entrywayAgent) {
|
11
14
|
return {
|