Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Step 2.a: Get concordium account nonce #3

Open
jatitoam opened this issue Feb 23, 2023 · 11 comments
Open

Step 2.a: Get concordium account nonce #3

jatitoam opened this issue Feb 23, 2023 · 11 comments
Assignees

Comments

@jatitoam
Copy link
Contributor

jatitoam commented Feb 23, 2023

Similar to the demo, we need an /account/:account/nonce endpoint (GET) to generate a new random nonce, store it under an accounts collection and return it to the frontend with a json structure:

{
   "nonce": "<nonce>"
}

If the account does not exist then it needs to be stored in the collection with its nonce. If it exists, the nonce needs to be updated with a new random nonce.

Additionally, add a regex validation for concordium accounts. If the account does not match the regex it should return a 406 with a json:

{
   "error": "Account is not valid"
}
@CongThuong CongThuong moved this from Todo to In Progress in Web3 pre-registration Feb 23, 2023
@CongThuong CongThuong moved this from In Progress to Awaiting review in Web3 pre-registration Feb 23, 2023
@jatitoam jatitoam moved this from Awaiting review to QA in Web3 pre-registration Feb 23, 2023
@thaoredweb
Copy link

@CongThuong Can you check again with my ip, it works when I create the first time but then it show Error: connect ECONNREFUSED 127.0.0.1:8083

CongThuong pushed a commit to CongThuong/web3-id-preregistration-backend that referenced this issue Feb 24, 2023
@CongThuong CongThuong moved this from Todo to Awaiting review in Web3 pre-registration Feb 24, 2023
@thaoredweb
Copy link

thaoredweb commented Feb 24, 2023

@CongThuong When I create a request GET with the account invalid
However, the response is 404 not found e, please check the message error two
aer

@thaoredweb thaoredweb moved this from Awaiting review to Todo in Web3 pre-registration Feb 24, 2023
jatitoam added a commit that referenced this issue Feb 24, 2023
#3: Step 2.a: Get concordium account nonce
@CongThuong CongThuong moved this from Todo to QA in Web3 pre-registration Feb 24, 2023
@CongThuong CongThuong moved this from QA to Todo in Web3 pre-registration Feb 25, 2023
@CongThuong CongThuong moved this from Todo to QA in Web3 pre-registration Feb 25, 2023
@jatitoam jatitoam added this to the Pre-registration campaign milestone Feb 25, 2023
@thaoredweb
Copy link

{{domain}}/account/{{account}}/nonce
step2a

@thaoredweb
Copy link

When I use another address, it does not as expected:
With invalid address, it show the same message
invalid

@thaoredweb thaoredweb moved this from QA to Todo in Web3 pre-registration Feb 27, 2023
@CongThuong
Copy link
Contributor

it's a wrong API to get nonce chị @thaoredweb : {{domain}}/account/{{account}}/nonce . Please use the collection that I shared you

@thaoredweb
Copy link

@CongThuong There is no problem with the API e. only 1 thing the expected result does not correct

@CongThuong
Copy link
Contributor

CongThuong commented Feb 28, 2023

yeah, of course you cannot pass special characters directly to URL. it must be encoded first Chị @thaoredweb
image

@CongThuong CongThuong moved this from Todo to QA in Web3 pre-registration Feb 28, 2023
@thaoredweb
Copy link

@jatitoam I have put an invalid address= 36FYT269JK4bqVVbwaXXzWBEZ9Q4DvR4GC6BiAwTk4JC7mUFGy#@
but the actual output does not work as noted "error": "Account is not valid"
Is that the issue he have to fix it?

@jatitoam
Copy link
Contributor Author

Not a critical error... you can get a nonce but good luck after that validating the signature

@CongThuong
Copy link
Contributor

We don't need signature to get nonce @jatitoam

@jatitoam
Copy link
Contributor Author

jatitoam commented Mar 1, 2023

No, of course. But what I meant is simply that even if you can forge an account and get a nonce for it, you won't be able to get a valid signature of an invalid account, so it doesn't matter if the validation doesn't "work" here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

No branches or pull requests

3 participants