Tweak schemas for entryway createAccount (#1797)
* tweak scheams * require email & password
This commit is contained in:
parent
a161f815de
commit
cf848e87ab
@ -9,7 +9,7 @@
|
|||||||
"encoding": "application/json",
|
"encoding": "application/json",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["handle", "email", "password"],
|
"required": ["handle"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"email": { "type": "string" },
|
"email": { "type": "string" },
|
||||||
"handle": { "type": "string", "format": "handle" },
|
"handle": { "type": "string", "format": "handle" },
|
||||||
|
@ -5,6 +5,18 @@
|
|||||||
"main": {
|
"main": {
|
||||||
"type": "procedure",
|
"type": "procedure",
|
||||||
"description": "Reserve a repo signing key for account creation.",
|
"description": "Reserve a repo signing key for account creation.",
|
||||||
|
"input": {
|
||||||
|
"encoding": "application/json",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"did": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The did to reserve a new did:key for"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"encoding": "application/json",
|
"encoding": "application/json",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -2489,7 +2489,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['handle', 'email', 'password'],
|
required: ['handle'],
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -3170,6 +3170,18 @@ export const schemaDict = {
|
|||||||
main: {
|
main: {
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
description: 'Reserve a repo signing key for account creation.',
|
description: 'Reserve a repo signing key for account creation.',
|
||||||
|
input: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
did: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'The did to reserve a new did:key for',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
|
@ -10,11 +10,11 @@ import { CID } from 'multiformats/cid'
|
|||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export interface InputSchema {
|
export interface InputSchema {
|
||||||
email: string
|
email?: string
|
||||||
handle: string
|
handle: string
|
||||||
did?: string
|
did?: string
|
||||||
inviteCode?: string
|
inviteCode?: string
|
||||||
password: string
|
password?: string
|
||||||
recoveryKey?: string
|
recoveryKey?: string
|
||||||
plcOp?: {}
|
plcOp?: {}
|
||||||
[k: string]: unknown
|
[k: string]: unknown
|
||||||
|
@ -9,7 +9,11 @@ import { CID } from 'multiformats/cid'
|
|||||||
|
|
||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export type InputSchema = undefined
|
export interface InputSchema {
|
||||||
|
/** The did to reserve a new did:key for */
|
||||||
|
did?: string
|
||||||
|
[k: string]: unknown
|
||||||
|
}
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** Public signing key in the form of a did:key. */
|
/** Public signing key in the form of a did:key. */
|
||||||
@ -20,6 +24,7 @@ export interface OutputSchema {
|
|||||||
export interface CallOptions {
|
export interface CallOptions {
|
||||||
headers?: Headers
|
headers?: Headers
|
||||||
qp?: QueryParams
|
qp?: QueryParams
|
||||||
|
encoding: 'application/json'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Response {
|
export interface Response {
|
||||||
|
@ -2489,7 +2489,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['handle', 'email', 'password'],
|
required: ['handle'],
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -3170,6 +3170,18 @@ export const schemaDict = {
|
|||||||
main: {
|
main: {
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
description: 'Reserve a repo signing key for account creation.',
|
description: 'Reserve a repo signing key for account creation.',
|
||||||
|
input: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
did: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'The did to reserve a new did:key for',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
|
@ -11,11 +11,11 @@ import { HandlerAuth } from '@atproto/xrpc-server'
|
|||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export interface InputSchema {
|
export interface InputSchema {
|
||||||
email: string
|
email?: string
|
||||||
handle: string
|
handle: string
|
||||||
did?: string
|
did?: string
|
||||||
inviteCode?: string
|
inviteCode?: string
|
||||||
password: string
|
password?: string
|
||||||
recoveryKey?: string
|
recoveryKey?: string
|
||||||
plcOp?: {}
|
plcOp?: {}
|
||||||
[k: string]: unknown
|
[k: string]: unknown
|
||||||
|
@ -10,7 +10,11 @@ import { HandlerAuth } from '@atproto/xrpc-server'
|
|||||||
|
|
||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export type InputSchema = undefined
|
export interface InputSchema {
|
||||||
|
/** The did to reserve a new did:key for */
|
||||||
|
did?: string
|
||||||
|
[k: string]: unknown
|
||||||
|
}
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** Public signing key in the form of a did:key. */
|
/** Public signing key in the form of a did:key. */
|
||||||
@ -18,7 +22,10 @@ export interface OutputSchema {
|
|||||||
[k: string]: unknown
|
[k: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export interface HandlerInput {
|
||||||
|
encoding: 'application/json'
|
||||||
|
body: InputSchema
|
||||||
|
}
|
||||||
|
|
||||||
export interface HandlerSuccess {
|
export interface HandlerSuccess {
|
||||||
encoding: 'application/json'
|
encoding: 'application/json'
|
||||||
|
@ -21,7 +21,11 @@ export default function (server: Server, ctx: AppContext) {
|
|||||||
},
|
},
|
||||||
handler: async ({ input, req }) => {
|
handler: async ({ input, req }) => {
|
||||||
const { email, password, inviteCode } = input.body
|
const { email, password, inviteCode } = input.body
|
||||||
if (input.body.plcOp) {
|
if (!email) {
|
||||||
|
throw new InvalidRequestError('Missing input: "email"')
|
||||||
|
} else if (!password) {
|
||||||
|
throw new InvalidRequestError('Missing input: "password"')
|
||||||
|
} else if (input.body.plcOp) {
|
||||||
throw new InvalidRequestError('Unsupported input: "plcOp"')
|
throw new InvalidRequestError('Unsupported input: "plcOp"')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2489,7 +2489,7 @@ export const schemaDict = {
|
|||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['handle', 'email', 'password'],
|
required: ['handle'],
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -3170,6 +3170,18 @@ export const schemaDict = {
|
|||||||
main: {
|
main: {
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
description: 'Reserve a repo signing key for account creation.',
|
description: 'Reserve a repo signing key for account creation.',
|
||||||
|
input: {
|
||||||
|
encoding: 'application/json',
|
||||||
|
schema: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
did: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'The did to reserve a new did:key for',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
encoding: 'application/json',
|
encoding: 'application/json',
|
||||||
schema: {
|
schema: {
|
||||||
|
@ -11,11 +11,11 @@ import { HandlerAuth } from '@atproto/xrpc-server'
|
|||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export interface InputSchema {
|
export interface InputSchema {
|
||||||
email: string
|
email?: string
|
||||||
handle: string
|
handle: string
|
||||||
did?: string
|
did?: string
|
||||||
inviteCode?: string
|
inviteCode?: string
|
||||||
password: string
|
password?: string
|
||||||
recoveryKey?: string
|
recoveryKey?: string
|
||||||
plcOp?: {}
|
plcOp?: {}
|
||||||
[k: string]: unknown
|
[k: string]: unknown
|
||||||
|
@ -10,7 +10,11 @@ import { HandlerAuth } from '@atproto/xrpc-server'
|
|||||||
|
|
||||||
export interface QueryParams {}
|
export interface QueryParams {}
|
||||||
|
|
||||||
export type InputSchema = undefined
|
export interface InputSchema {
|
||||||
|
/** The did to reserve a new did:key for */
|
||||||
|
did?: string
|
||||||
|
[k: string]: unknown
|
||||||
|
}
|
||||||
|
|
||||||
export interface OutputSchema {
|
export interface OutputSchema {
|
||||||
/** Public signing key in the form of a did:key. */
|
/** Public signing key in the form of a did:key. */
|
||||||
@ -18,7 +22,10 @@ export interface OutputSchema {
|
|||||||
[k: string]: unknown
|
[k: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type HandlerInput = undefined
|
export interface HandlerInput {
|
||||||
|
encoding: 'application/json'
|
||||||
|
body: InputSchema
|
||||||
|
}
|
||||||
|
|
||||||
export interface HandlerSuccess {
|
export interface HandlerSuccess {
|
||||||
encoding: 'application/json'
|
encoding: 'application/json'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user