Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
XSWD permission changes and further enhancements to the XSWD protocol.
dApps can submit permissions to perform requests with their
ApplicationData
when they initially connect to the wallet. If these permissions are unknowingly accepted by the wallet user when connection is made the wallet may not receive any further prompts for this dApps requests due to requestPermission() returning any stored permission.derohe/walletapi/xswd/xswd.go
Line 604 in bd300c0
Proposed solutions to address this:
forceAsk
param added to the server and hard coded true in NewXSWDServer() so that no permission requests upon initial connection will be accepted from dApp to wallet. (defaults all wallet requests to Ask behavior)Package logger updated to display further permission info.
CLI wallet inherits the above changes making incoming and current permissions clearer. It continues to use NewXSWDServer() so it will not accept any initial permission requests.
If using NewXSWDServerWithPort()
forceAsk
may be false allowing initial permissions to be requested. Changes made to addApplication() for filtering permission requests before attempting to add a application. On the initial connection all of the following will be rejected (behaves as Ask):Further enhancements
The app signature was further integrated into requesting permissions. Signature is now a DERO signed message and for XSWD to consider it valid (dApp can request permissions) the message of the signature must match the applications ID. If signature is submitted and does not match ID, the connection will be automatically rejected. Signature is not required if no permission are to be requested.
More client side info on connection acceptance/rejection.
Enable interrupt signal during CLI prompts.
Prevented custom method crossover to rpcserver.
Completed XSWD SignData method and added CheckSignature, GetDaemon methods.
Synchronized daemon pass through calls to return RPCResponse same as wallet calls are.
ctx, cancel for the server so there is no orphaned handler_loops.
Added package tests at 90% coverage.
Type of change
Which part is impacted ?
Checklist:
License
Im am contributing & releasing the code under DERO Research License (which can be found here).