Skip to content

Commit

Permalink
Feat/support zuzalu city (#68)
Browse files Browse the repository at this point in the history
* chore: rename "email" to "account"

* WIP: support PASSKEY verify in DVT

* update swagger

* submodule update

* support zuzalu city id

* support zuzalu city id

---------

Co-authored-by: STW <[email protected]>
  • Loading branch information
fanhousanbu and stoptheworld-java authored Dec 10, 2024
1 parent 29b46fe commit eb791d1
Show file tree
Hide file tree
Showing 20 changed files with 620 additions and 52 deletions.
116 changes: 116 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,99 @@ const docTemplate = `{
}
}
},
"/api/passkey/v1/reg-account": {
"post": {
"consumes": [
"application/json"
],
"tags": [
"Plugins Passkey"
],
"summary": "Begin SignUp By EOA/UnionID/etc.,",
"parameters": [
{
"description": "Begin Registration",
"name": "registrationBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/seedworks.RegistrationByAccount"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/protocol.PublicKeyCredentialCreationOptions"
}
}
}
}
},
"/api/passkey/v1/reg-account/verify": {
"post": {
"description": "Verify attestations, register user and return JWT",
"consumes": [
"application/json"
],
"tags": [
"Plugins Passkey"
],
"summary": "Finish SignUp By Account",
"parameters": [
{
"type": "string",
"description": "user account",
"name": "account",
"in": "query",
"required": true
},
{
"type": "string",
"description": "origin",
"name": "origin",
"in": "query",
"required": true
},
{
"type": "string",
"description": "account type, default: EOA",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "network",
"name": "network",
"in": "query"
},
{
"type": "string",
"description": "network",
"name": "alias",
"in": "query"
},
{
"description": "Verify Registration",
"name": "registrationBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/protocol.CredentialCreationResponse"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/plugin_passkey_relay_party.SiginInResponse"
}
}
}
}
},
"/api/passkey/v1/reg/prepare": {
"post": {
"description": "Send captcha to email for confirming ownership",
Expand Down Expand Up @@ -1164,6 +1257,15 @@ const docTemplate = `{
}
}
},
"seedworks.AccountType": {
"type": "string",
"enum": [
"EOA"
],
"x-enum-varnames": [
"EOA"
]
},
"seedworks.Chain": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1208,6 +1310,20 @@ const docTemplate = `{
}
}
},
"seedworks.RegistrationByAccount": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"origin": {
"type": "string"
},
"type": {
"$ref": "#/definitions/seedworks.AccountType"
}
}
},
"seedworks.RegistrationByEmail": {
"type": "object",
"properties": {
Expand Down
116 changes: 116 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,99 @@
}
}
},
"/api/passkey/v1/reg-account": {
"post": {
"consumes": [
"application/json"
],
"tags": [
"Plugins Passkey"
],
"summary": "Begin SignUp By EOA/UnionID/etc.,",
"parameters": [
{
"description": "Begin Registration",
"name": "registrationBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/seedworks.RegistrationByAccount"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/protocol.PublicKeyCredentialCreationOptions"
}
}
}
}
},
"/api/passkey/v1/reg-account/verify": {
"post": {
"description": "Verify attestations, register user and return JWT",
"consumes": [
"application/json"
],
"tags": [
"Plugins Passkey"
],
"summary": "Finish SignUp By Account",
"parameters": [
{
"type": "string",
"description": "user account",
"name": "account",
"in": "query",
"required": true
},
{
"type": "string",
"description": "origin",
"name": "origin",
"in": "query",
"required": true
},
{
"type": "string",
"description": "account type, default: EOA",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "network",
"name": "network",
"in": "query"
},
{
"type": "string",
"description": "network",
"name": "alias",
"in": "query"
},
{
"description": "Verify Registration",
"name": "registrationBody",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/protocol.CredentialCreationResponse"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/plugin_passkey_relay_party.SiginInResponse"
}
}
}
}
},
"/api/passkey/v1/reg/prepare": {
"post": {
"description": "Send captcha to email for confirming ownership",
Expand Down Expand Up @@ -1153,6 +1246,15 @@
}
}
},
"seedworks.AccountType": {
"type": "string",
"enum": [
"EOA"
],
"x-enum-varnames": [
"EOA"
]
},
"seedworks.Chain": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1197,6 +1299,20 @@
}
}
},
"seedworks.RegistrationByAccount": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"origin": {
"type": "string"
},
"type": {
"$ref": "#/definitions/seedworks.AccountType"
}
}
},
"seedworks.RegistrationByEmail": {
"type": "object",
"properties": {
Expand Down
76 changes: 76 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ definitions:
init_code:
type: string
type: object
seedworks.AccountType:
enum:
- EOA
type: string
x-enum-varnames:
- EOA
seedworks.Chain:
enum:
- ethereum-mainnet
Expand Down Expand Up @@ -457,6 +463,15 @@ definitions:
network:
$ref: '#/definitions/seedworks.Chain'
type: object
seedworks.RegistrationByAccount:
properties:
account:
type: string
origin:
type: string
type:
$ref: '#/definitions/seedworks.AccountType'
type: object
seedworks.RegistrationByEmail:
properties:
captcha:
Expand Down Expand Up @@ -716,6 +731,67 @@ paths:
summary: Begin SignUp
tags:
- Plugins Passkey
/api/passkey/v1/reg-account:
post:
consumes:
- application/json
parameters:
- description: Begin Registration
in: body
name: registrationBody
required: true
schema:
$ref: '#/definitions/seedworks.RegistrationByAccount'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/protocol.PublicKeyCredentialCreationOptions'
summary: Begin SignUp By EOA/UnionID/etc.,
tags:
- Plugins Passkey
/api/passkey/v1/reg-account/verify:
post:
consumes:
- application/json
description: Verify attestations, register user and return JWT
parameters:
- description: user account
in: query
name: account
required: true
type: string
- description: origin
in: query
name: origin
required: true
type: string
- description: 'account type, default: EOA'
in: query
name: type
type: string
- description: network
in: query
name: network
type: string
- description: network
in: query
name: alias
type: string
- description: Verify Registration
in: body
name: registrationBody
required: true
schema:
$ref: '#/definitions/protocol.CredentialCreationResponse'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/plugin_passkey_relay_party.SiginInResponse'
summary: Finish SignUp By Account
tags:
- Plugins Passkey
/api/passkey/v1/reg/prepare:
post:
consumes:
Expand Down
Loading

0 comments on commit eb791d1

Please sign in to comment.