ledgerconnect / hivesigner

Signer app for Hive
MIT License
17 stars 5 forks source link

Signing ops with custom json needing active auth (required_auths: [...]) uses posting #27

Closed eonwarped closed 3 years ago

eonwarped commented 3 years ago

Expected behavior

For ops that have custom jsons needing active auth, the generated hive signer url is not detecting the need to use posting it seems:

https://hivesigner.com/sign/ops/W1siY3VzdG9tX2pzb24iLHsiaWQiOiJzc2MtbWFpbm5ldC1oaXZlIiwicmVxdWlyZWRfYXV0aHMiOlsiZW9ud2FycCJdLCJqc29uIjoie1wiY29udHJhY3ROYW1lXCI6XCJ0b2tlbnNcIixcImNvbnRyYWN0QWN0aW9uXCI6XCJ0cmFuc2ZlclwiLFwiY29udHJhY3RQYXlsb2FkXCI6e1wic3ltYm9sXCI6XCJQQUxcIixcInRvXCI6XCJlb253YXJwZWRcIixcInF1YW50aXR5XCI6XCIwLjAwMVwiLFwibWVtb1wiOlwiXCJ9fSJ9XV0.?cb=aHR0cDovL2xvY2FsaG9zdDo4MDgwL0Blb253YXJwL3RyYW5zZmVycw

Actual behavior

Registers as needing posting:

Screenshot 2020-09-30 at 5 06 26 PM

Steps to reproduce the behavior

Go to url:

https://hivesigner.com/sign/ops/W1siY3VzdG9tX2pzb24iLHsiaWQiOiJzc2MtbWFpbm5ldC1oaXZlIiwicmVxdWlyZWRfYXV0aHMiOlsiZW9ud2FycCJdLCJqc29uIjoie1wiY29udHJhY3ROYW1lXCI6XCJ0b2tlbnNcIixcImNvbnRyYWN0QWN0aW9uXCI6XCJ0cmFuc2ZlclwiLFwiY29udHJhY3RQYXlsb2FkXCI6e1wic3ltYm9sXCI6XCJQQUxcIixcInRvXCI6XCJlb253YXJwZWRcIixcInF1YW50aXR5XCI6XCIwLjAwMVwiLFwibWVtb1wiOlwiXCJ9fSJ9XV0.?cb=aHR0cDovL2xvY2FsaG9zdDo4MDgwL0Blb253YXJwL3RyYW5zZmVycw

feruzm commented 3 years ago

Just to note what I mentioned in our chat, it can be done like this for now and you can use redirect_uri at the end as callback parameter as well. We will add auto detection for authority requirement for custom json in upcoming updates.

http://hivesigner.com/sign/custom_json?authority=active&required_auths=demo&id=ssc-mainnet-hive&json={%22contractName:%22tokens%22,%22contractAction%22:%22transfer%22...}

feruzm commented 3 years ago

For future reference: Here is working example, note that required_posting_auths should have empty array and required_auths should have array of account whose active key is requested to sign the transaction.

https://hivesigner.com/sign/custom_json?authority=active&required_auths=["demo123"]&required_posting_auths=[]&id=ssc-mainnet-hive&json={"contractName":"tokens","contractAction":"transfer","contractPayload":{"symbol":"LEO","to":"eonwarped","quantity":"0.001","memo":""}}