Skip to content

Commit

Permalink
Account migration (#2179)
Browse files Browse the repository at this point in the history
* draft of account migration lexicons

* format

* clean up schemas

* codegen

* second pass on schemas

* small fix

* move around checkImportStatus

* re-codegen

* getServiceAuth

* getServiceAuth impl

* importRepo impl

* handle uploadBlob for import

* allow bringing your own did on createAccount

* working on test flow

* fleshing out flow

* fix up sendPlcOP

* small fixes

* activate/deactivate account

* full flow working!

* schema tweaks

* format

* update schemas

* moar codegen

* match impl to new schemas

* email flow for signed plc operation

* add email flow for plc operations

* impl plc op request email

* proxy to entryway

* tidy activate account

* integrating account deactivated state

* fix up tests

* friendly parse on optional did auth

* admin activate/deactivate routes

* proxy relevant requests to entryway

* remove admin activation routes

* do not proxy acitvaition to entryway

* cfg for disallowing imports

* buff up test

* refactor listMissingBlobs a bit

* add validDid & activated to accoutn status

* emit event on account activation

* test creating a post after migrating

* account deactivation tests

* test name

* tests on plc operations

* fix recommended did creds

* codegen

* turn off accepting imports on createAccount

* undo prev change

* increment version

* build branch

* pr feedback

* handle errs in p-queue

* handle blob upload outside of txn

* Clean old temp account migration lexicons (#2187)

* clean old temp lexicons

* rm old test

* fix agent session test

* fix bsky test

* dont build branch
  • Loading branch information
dholms authored Feb 21, 2024
1 parent 4c511b3 commit 30b05a7
Show file tree
Hide file tree
Showing 94 changed files with 2,048 additions and 2,119 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-and-push-pds-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- pds-sanity-check
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
Expand Down
27 changes: 0 additions & 27 deletions lexicons/com/atproto/temp/importRepo.json

This file was deleted.

24 changes: 0 additions & 24 deletions lexicons/com/atproto/temp/pushBlob.json

This file was deleted.

44 changes: 0 additions & 44 deletions lexicons/com/atproto/temp/transferAccount.json

This file was deleted.

39 changes: 0 additions & 39 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCra
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue'
import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels'
import * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo'
import * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob'
import * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification'
import * as ComAtprotoTempTransferAccount from './types/com/atproto/temp/transferAccount'
import * as AppBskyActorDefs from './types/app/bsky/actor/defs'
import * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
Expand Down Expand Up @@ -249,10 +246,7 @@ export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCra
export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue'
export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels'
export * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo'
export * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob'
export * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification'
export * as ComAtprotoTempTransferAccount from './types/com/atproto/temp/transferAccount'
export * as AppBskyActorDefs from './types/app/bsky/actor/defs'
export * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
Expand Down Expand Up @@ -1369,28 +1363,6 @@ export class ComAtprotoTempNS {
})
}

importRepo(
data?: ComAtprotoTempImportRepo.InputSchema,
opts?: ComAtprotoTempImportRepo.CallOptions,
): Promise<ComAtprotoTempImportRepo.Response> {
return this._service.xrpc
.call('com.atproto.temp.importRepo', opts?.qp, data, opts)
.catch((e) => {
throw ComAtprotoTempImportRepo.toKnownErr(e)
})
}

pushBlob(
data?: ComAtprotoTempPushBlob.InputSchema,
opts?: ComAtprotoTempPushBlob.CallOptions,
): Promise<ComAtprotoTempPushBlob.Response> {
return this._service.xrpc
.call('com.atproto.temp.pushBlob', opts?.qp, data, opts)
.catch((e) => {
throw ComAtprotoTempPushBlob.toKnownErr(e)
})
}

requestPhoneVerification(
data?: ComAtprotoTempRequestPhoneVerification.InputSchema,
opts?: ComAtprotoTempRequestPhoneVerification.CallOptions,
Expand All @@ -1401,17 +1373,6 @@ export class ComAtprotoTempNS {
throw ComAtprotoTempRequestPhoneVerification.toKnownErr(e)
})
}

transferAccount(
data?: ComAtprotoTempTransferAccount.InputSchema,
opts?: ComAtprotoTempTransferAccount.CallOptions,
): Promise<ComAtprotoTempTransferAccount.Response> {
return this._service.xrpc
.call('com.atproto.temp.transferAccount', opts?.qp, data, opts)
.catch((e) => {
throw ComAtprotoTempTransferAccount.toKnownErr(e)
})
}
}

export class AppNS {
Expand Down
133 changes: 0 additions & 133 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4853,59 +4853,6 @@ export const schemaDict = {
},
},
},
ComAtprotoTempImportRepo: {
lexicon: 1,
id: 'com.atproto.temp.importRepo',
defs: {
main: {
type: 'procedure',
description:
"Gets the did's repo, optionally catching up from a specific revision.",
parameters: {
type: 'params',
required: ['did'],
properties: {
did: {
type: 'string',
format: 'did',
description: 'The DID of the repo.',
},
},
},
input: {
encoding: 'application/vnd.ipld.car',
},
output: {
encoding: 'text/plain',
},
},
},
},
ComAtprotoTempPushBlob: {
lexicon: 1,
id: 'com.atproto.temp.pushBlob',
defs: {
main: {
type: 'procedure',
description:
"Gets the did's repo, optionally catching up from a specific revision.",
parameters: {
type: 'params',
required: ['did'],
properties: {
did: {
type: 'string',
format: 'did',
description: 'The DID of the repo.',
},
},
},
input: {
encoding: '*/*',
},
},
},
},
ComAtprotoTempRequestPhoneVerification: {
lexicon: 1,
id: 'com.atproto.temp.requestPhoneVerification',
Expand All @@ -4929,83 +4876,6 @@ export const schemaDict = {
},
},
},
ComAtprotoTempTransferAccount: {
lexicon: 1,
id: 'com.atproto.temp.transferAccount',
defs: {
main: {
type: 'procedure',
description:
'Transfer an account. NOTE: temporary method, necessarily how account migration will be implemented.',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['handle', 'did', 'plcOp'],
properties: {
handle: {
type: 'string',
format: 'handle',
},
did: {
type: 'string',
format: 'did',
},
plcOp: {
type: 'unknown',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['accessJwt', 'refreshJwt', 'handle', 'did'],
properties: {
accessJwt: {
type: 'string',
},
refreshJwt: {
type: 'string',
},
handle: {
type: 'string',
format: 'handle',
},
did: {
type: 'string',
format: 'did',
},
},
},
},
errors: [
{
name: 'InvalidHandle',
},
{
name: 'InvalidPassword',
},
{
name: 'InvalidInviteCode',
},
{
name: 'HandleNotAvailable',
},
{
name: 'UnsupportedDomain',
},
{
name: 'UnresolvableDid',
},
{
name: 'IncompatibleDidDoc',
},
],
},
},
},
AppBskyActorDefs: {
lexicon: 1,
id: 'app.bsky.actor.defs',
Expand Down Expand Up @@ -8984,11 +8854,8 @@ export const ids = {
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
ComAtprotoTempCheckSignupQueue: 'com.atproto.temp.checkSignupQueue',
ComAtprotoTempFetchLabels: 'com.atproto.temp.fetchLabels',
ComAtprotoTempImportRepo: 'com.atproto.temp.importRepo',
ComAtprotoTempPushBlob: 'com.atproto.temp.pushBlob',
ComAtprotoTempRequestPhoneVerification:
'com.atproto.temp.requestPhoneVerification',
ComAtprotoTempTransferAccount: 'com.atproto.temp.transferAccount',
AppBskyActorDefs: 'app.bsky.actor.defs',
AppBskyActorGetPreferences: 'app.bsky.actor.getPreferences',
AppBskyActorGetProfile: 'app.bsky.actor.getProfile',
Expand Down
33 changes: 0 additions & 33 deletions packages/api/src/client/types/com/atproto/temp/importRepo.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/api/src/client/types/com/atproto/temp/pushBlob.ts

This file was deleted.

Loading

0 comments on commit 30b05a7

Please sign in to comment.