{"action":"created","issue":{"url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/110","repository_url":"https://api.github.com/repos/windingtree/wt-nodejs-api","labels_url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/110/comments","events_url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/110/events","html_url":"https://github.com/windingtree/wt-nodejs-api/pull/110","id":319435230,"number":110,"title":"[WIP] Multiple wallet support","user":{"login":"JirkaChadima","id":375483,"avatar_url":"https://avatars3.githubusercontent.com/u/375483?v=4","gravatar_id":"","url":"https://api.github.com/users/JirkaChadima","html_url":"https://github.com/JirkaChadima","followers_url":"https://api.github.com/users/JirkaChadima/followers","following_url":"https://api.github.com/users/JirkaChadima/following{/other_user}","gists_url":"https://api.github.com/users/JirkaChadima/gists{/gist_id}","starred_url":"https://api.github.com/users/JirkaChadima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JirkaChadima/subscriptions","organizations_url":"https://api.github.com/users/JirkaChadima/orgs","repos_url":"https://api.github.com/users/JirkaChadima/repos","events_url":"https://api.github.com/users/JirkaChadima/events{/privacy}","received_events_url":"https://api.github.com/users/JirkaChadima/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-02T07:14:57Z","updated_at":"2018-05-02T09:10:05Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/windingtree/wt-nodejs-api/pulls/110","html_url":"https://github.com/windingtree/wt-nodejs-api/pull/110","diff_url":"https://github.com/windingtree/wt-nodejs-api/pull/110.diff","patch_url":"https://github.com/windingtree/wt-nodejs-api/pull/110.patch"},"body":"This PR should add a support for multiple wallets handled by a single API instance.\r\n\r\n**TODO list**\r\n\r\n- [ ] Handling IO errors\r\n- [ ] Picking a proper wallet for each request (probably based on a header?)\r\n- [ ] Make sure every wallet is locked (or maybe destroyed) again ASAP to reduce the unlocked wallet lifespan to a total minimum\r\n- [ ] Encrypting JSON keyfiles on disk with a configuration-provided and instance-specific secret\r\n- [ ] Any wallet-related operation requires a wallet password. Wallet can never be manipulated with without successful decryption\r\n- [ ] Get rid of the configuration's `privateKeyFile`\r\n- [x] Use `res.locals` instead of `req.wt` to pass wallets and other WT related stuff around a single request (http://expressjs.com/en/api.html#res.locals). Also we should check when/how this gets destroyed during the request lifecycle."},"comment":{"url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/comments/385913702","html_url":"https://github.com/windingtree/wt-nodejs-api/pull/110#issuecomment-385913702","issue_url":"https://api.github.com/repos/windingtree/wt-nodejs-api/issues/110","id":385913702,"user":{"login":"AugustoL","id":7763867,"avatar_url":"https://avatars2.githubusercontent.com/u/7763867?v=4","gravatar_id":"","url":"https://api.github.com/users/AugustoL","html_url":"https://github.com/AugustoL","followers_url":"https://api.github.com/users/AugustoL/followers","following_url":"https://api.github.com/users/AugustoL/following{/other_user}","gists_url":"https://api.github.com/users/AugustoL/gists{/gist_id}","starred_url":"https://api.github.com/users/AugustoL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugustoL/subscriptions","organizations_url":"https://api.github.com/users/AugustoL/orgs","repos_url":"https://api.github.com/users/AugustoL/repos","events_url":"https://api.github.com/users/AugustoL/events{/privacy}","received_events_url":"https://api.github.com/users/AugustoL/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T09:10:05Z","updated_at":"2018-05-02T09:10:05Z","author_association":"OWNER","body":"Cool, as far as for the endpoints to be used I think we would only need /add, /remove and /list for wallet management.\r\n\r\nThe `/add` endpoint can receive the account and a signed message by this account. We check the signature is right in the API and we add it to the API wallets.\r\nThe `/remove` endpoint will receive the address of the wallet to remove and a signed message by the account owner, if the message is signed by the account it gets remove form the API.\r\nThe `/list` endpoint will just return a list of the addresses of the accounts registered in the API.\r\n\r\nEvery endpoint that needs a wallet to be decrypted should receive `address` and `password` in header, will get the right account from the API and decrypt it with the password provided.\r\n\r\nWDYT @JirkaChadima ?"}}
{"actor":{"display_login":"AugustoL"}}