Skip to content

Commit

Permalink
Chao/multip nodes enhancement (#45)
Browse files Browse the repository at this point in the history
* wip

* nonce rename to ticket

* doc

* WIP

* update DDL for airaccount_chains

* precisely reg by email; for supporting other ways

* refactor passkey

* sigin refactor

* bugfix: restore wallet to user

* support customer challenge

* bugfix: txdata empty

* bugfix: duplicated response

* support discoverable login

* demo support discoverable login

* support discoverable signin

* update swagger

* update swagger

* support one user multiple passkeys

* update passkey

* WIP

* bugfix: txSigRlt address

* WIP

* one chain support multip aa by alias

* update pkg

* bugfix: signup in different PASSKEY for each User

* bugfix: creat_aa with alias

* WIP: more hd wallets for one email

* support more hdwallets for one account

* update unit tests

* WIP: 1:N wallets and account

* Fix wallet usage check for specific network

* bugfix: re-use wallet if network is different

* bugfix and code clean

* changelog add

* update demo

* specify -7 and -257 only in registration session

* Update dependencies in go.mod file; fix critical vul

* extract signature2 verify util

* bugfix: missing parameter

* bugfix

* chore: code clean

* implement bls

* support BLS

* update swagger

* 增加bls出参

* doc about bls

* replace http 404 to biz code 404 but http code 200

* use hexstr for BLS pubkey and signature

* Update next-env.d.ts with correct TypeScript documentation link

* change bls to bn254

* integrate dvt-node

* WIP: bls

* WIP: calling dvt

* support bls

* support on-chain bls verification

* Update dvt-node

* Update dvt-node

* Update dvt-node

* fix error in test

* fix unit test

* Fix skipping test in short mode

* Fix test coverage command in codecov.yml

* Fix skipping test in short mode

* Fix skipping test in short mode

---------

Co-authored-by: STW <[email protected]>
  • Loading branch information
fanhousanbu and stoptheworld-java authored Oct 27, 2024
1 parent 9d26949 commit 9d0ecbd
Show file tree
Hide file tree
Showing 24 changed files with 658 additions and 9,328 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- name: Go Module Downloads
run: go mod download
- name: Run coverage
run: go test -test.short -race -coverprofile=coverage.txt -covermode=atomic ./...
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{secrets.CODECOV_TOKEN}}
# slug: AAStarCommunity/AnotherAirAccountCommunityNode
run: go test -v -short -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
slug: AAStarCommunity/AnotherAirAccountCommunityNode
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "plugins/dvt-node"]
path = plugins/dvt-node
url = https://github.com/AAStarCommunity/dvt.git
21 changes: 21 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2. body参数中增加network,表示链名称,必填
3. body参数中增加network_alias,表示链别名,非必填参数


### POST /api/passkey/v1/tx/sign/verify

1. query参数中nonce改名为ticket
2. query参数中增加network,表示链名称,必填
3. query参数中增加network_alias,表示链别名,非必填参数
4. 响应结果增加BLS信息,包括bls_sign,bls_pubkey和bls_schema,其中bls_sign和bls_pubkey使用`base64url`编码,分别表示bls的签名和公钥,bls_schema表示bls算法信息

响应结果示例

```json
{
"code": 200,
"message": "",
"data": {
"code": 200,
"txdata": "48656c6c6f2c20576f726c6421",
"sign": "0xce6e001af297172aa5176b2a50200148002e9a9ece9293694fe5374b453f62c30e445a94a4b6ebab0c05631614c934b4eb318ffd4dd5ff159807430aeaff32e51c",
"bls_sign": "jclHo_HBKZUzYKMgJsCqpjXxGkIrJZZXx2npXHFHHdgNA4fu0VD5wsrLlVUB04OKCFNfiKw7XzGOT4Ob7qhkYkFjXDXxg3l0mG9VYct7KI7EtYd6H3jgGE93j6lYfwaM",
"bls_pubkey": "rzpZJX8PiAXgsf4BQZJ6hbJkhQUWyM0lrch_YmrqzZ34Z_YeqXa4nKc-lnkm7vqR",
"address": "0xf75291198A0c549962Db2D4816321e95a0e48fc3",
"bls_schemal": "BLS12_381:EthModeDraft07"
},
"cost": "2562047h47m16.854775807s"
}
```

## [新增接口]

Expand Down
9 changes: 9 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,15 @@ const docTemplate = `{
"address": {
"type": "string"
},
"bls_pubkey": {
"type": "string"
},
"bls_schema": {
"type": "string"
},
"bls_sign": {
"type": "string"
},
"code": {
"type": "integer"
},
Expand Down
9 changes: 9 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,15 @@
"address": {
"type": "string"
},
"bls_pubkey": {
"type": "string"
},
"bls_schema": {
"type": "string"
},
"bls_sign": {
"type": "string"
},
"code": {
"type": "integer"
},
Expand Down
6 changes: 6 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ definitions:
properties:
address:
type: string
bls_pubkey:
type: string
bls_schema:
type: string
bls_sign:
type: string
code:
type: integer
sign:
Expand Down
2 changes: 1 addition & 1 deletion example/webauthn-relay-test/app/register/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function RegisterForm() {
return (
<div>
{browserSupportsWebAuthn() ? (
<Form action={PasskeyRegister}>
<Form action={PasskeyRegister} isDiscoverable={false}>
<SubmitButton>Sign Up</SubmitButton>
<p className="text-center text-sm text-gray-600">
{"Already have an account? "}
Expand Down
2 changes: 1 addition & 1 deletion example/webauthn-relay-test/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Loading

0 comments on commit 9d0ecbd

Please sign in to comment.