aeternity / AEXs

Aeternity expansions repository — application layer standards
10 stars 25 forks source link

AEX-4: Can callback url be a template? #77

Closed davidyuk closed 3 years ago

davidyuk commented 5 years ago

In some cases (like usage of vue-router) it is easier to accept parameters in a path instead of a query. We can use URL templates to allow the vendor to set a way how parameters should be inlined into a callback URL. For example, this request:

aeternity:ak_.../125.12/myaeshop?callback=https://myaeshop.com/verify/{txId}/

can redirect the user to

https://myaeshop.com/verify/th_.../

This approach supports the initial proposal as well:

aeternity:ak_.../125.12/myaeshop?callback=https://myaeshop.com/verify?txId={txId}
=> https://myaeshop.com/verify?txId=th_...

Also, this approach can help to get rid of the return param in "Sign and Broadcast" method by passing it in the template.

I'm not sure how placeholders can be encoded into URL, I have to approaches:

In both cases, special chars like %, {, and } should be encoded to %25, %7B, and %7D correspondingly and then be decoded by a wallet.

marc0olo commented 3 years ago

no longer relevant, AEX-4 is withdrawn