Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entryway account migration #2185

Merged
merged 10 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lexicons/com/atproto/identity/requestPlcOperationSignature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"lexicon": 1,
"id": "com.atproto.identity.requestPlcOperationSignature",
"defs": {
"main": {
"type": "procedure",
"description": "Request an email with a code to in order to request a signed PLC operation. Requires Auth."
}
}
}
45 changes: 45 additions & 0 deletions lexicons/com/atproto/identity/signPlcOperation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"lexicon": 1,
"id": "com.atproto.identity.signPlcOperation",
"defs": {
"main": {
"type": "procedure",
"description": "Signs a PLC operation to update some value(s) in the requesting DID's document.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"token": {
"description": "A token received through com.atproto.identity.requestPlcOperationSignature",
"type": "string"
},
"rotationKeys": {
"type": "array",
"items": { "type": "string" }
},
"alsoKnownAs": {
"type": "array",
"items": { "type": "string" }
},
"verificationMethods": { "type": "unknown" },
"services": { "type": "unknown" }
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["operation"],
"properties": {
"operation": {
"type": "unknown",
"description": "A signed DID PLC operation."
}
}
}
}
}
}
}
10 changes: 10 additions & 0 deletions lexicons/com/atproto/server/activateAccount.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"lexicon": 1,
"id": "com.atproto.server.activateAccount",
"defs": {
"main": {
"type": "procedure",
"description": "Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup."
}
}
}
23 changes: 23 additions & 0 deletions lexicons/com/atproto/server/deactivateAccount.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"lexicon": 1,
"id": "com.atproto.server.deactivateAccount",
"defs": {
"main": {
"type": "procedure",
"description": "Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"deleteAfter": {
"type": "string",
"format": "datetime",
"description": "A recommendation to server as to how long they should hold onto the deactivated account before deleting."
}
}
}
}
}
}
}
6 changes: 5 additions & 1 deletion lexicons/com/atproto/server/describeServer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["availableUserDomains"],
"required": ["did", "availableUserDomains"],
"properties": {
"inviteCodeRequired": {
"type": "boolean",
Expand All @@ -28,6 +28,10 @@
"type": "ref",
"description": "URLs of service policy documents.",
"ref": "#links"
},
"did": {
"type": "string",
"format": "did"
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions lexicons/com/atproto/server/getServiceAuth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"lexicon": 1,
"id": "com.atproto.server.getServiceAuth",
"defs": {
"main": {
"type": "query",
"description": "Get a signed token on behalf of the requesting DID for the requested service.",
"parameters": {
"type": "params",
"required": ["aud"],
"properties": {
"aud": {
"type": "string",
"format": "did",
"description": "The DID of the service that the token will be used to authenticate with"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["token"],
"properties": {
"token": {
"type": "string"
}
}
}
}
}
}
}
70 changes: 70 additions & 0 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/up
import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle'
import * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate'
import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus'
import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature'
import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle'
import * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation'
import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle'
import * as ComAtprotoLabelDefs from './types/com/atproto/label/defs'
import * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels'
Expand All @@ -47,17 +49,20 @@ import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords
import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
import * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount'
import * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail'
import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword'
import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'
import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes'
import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession'
import * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount'
import * as ComAtprotoServerDefs from './types/com/atproto/server/defs'
import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount'
import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession'
import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer'
import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes'
import * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth'
import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'
import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords'
import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'
Expand Down Expand Up @@ -179,7 +184,9 @@ export * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/up
export * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle'
export * as ComAtprotoAdminUpdateCommunicationTemplate from './types/com/atproto/admin/updateCommunicationTemplate'
export * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus'
export * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature'
export * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle'
export * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation'
export * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle'
export * as ComAtprotoLabelDefs from './types/com/atproto/label/defs'
export * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels'
Expand All @@ -195,17 +202,20 @@ export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords
export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
export * as ComAtprotoServerActivateAccount from './types/com/atproto/server/activateAccount'
export * as ComAtprotoServerConfirmEmail from './types/com/atproto/server/confirmEmail'
export * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
export * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword'
export * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'
export * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes'
export * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession'
export * as ComAtprotoServerDeactivateAccount from './types/com/atproto/server/deactivateAccount'
export * as ComAtprotoServerDefs from './types/com/atproto/server/defs'
export * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount'
export * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession'
export * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer'
export * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes'
export * as ComAtprotoServerGetServiceAuth from './types/com/atproto/server/getServiceAuth'
export * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'
export * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords'
export * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'
Expand Down Expand Up @@ -679,6 +689,22 @@ export class ComAtprotoIdentityNS {
this._service = service
}

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

resolveHandle(
params?: ComAtprotoIdentityResolveHandle.QueryParams,
opts?: ComAtprotoIdentityResolveHandle.CallOptions,
Expand All @@ -690,6 +716,17 @@ export class ComAtprotoIdentityNS {
})
}

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

updateHandle(
data?: ComAtprotoIdentityUpdateHandle.InputSchema,
opts?: ComAtprotoIdentityUpdateHandle.CallOptions,
Expand Down Expand Up @@ -843,6 +880,17 @@ export class ComAtprotoServerNS {
this._service = service
}

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

confirmEmail(
data?: ComAtprotoServerConfirmEmail.InputSchema,
opts?: ComAtprotoServerConfirmEmail.CallOptions,
Expand Down Expand Up @@ -909,6 +957,17 @@ export class ComAtprotoServerNS {
})
}

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

deleteAccount(
data?: ComAtprotoServerDeleteAccount.InputSchema,
opts?: ComAtprotoServerDeleteAccount.CallOptions,
Expand Down Expand Up @@ -953,6 +1012,17 @@ export class ComAtprotoServerNS {
})
}

getServiceAuth(
params?: ComAtprotoServerGetServiceAuth.QueryParams,
opts?: ComAtprotoServerGetServiceAuth.CallOptions,
): Promise<ComAtprotoServerGetServiceAuth.Response> {
return this._service.xrpc
.call('com.atproto.server.getServiceAuth', params, undefined, opts)
.catch((e) => {
throw ComAtprotoServerGetServiceAuth.toKnownErr(e)
})
}

getSession(
params?: ComAtprotoServerGetSession.QueryParams,
opts?: ComAtprotoServerGetSession.CallOptions,
Expand Down
Loading
Loading