-
Notifications
You must be signed in to change notification settings - Fork 1.7k
UI server refactoring #5580
UI server refactoring #5580
Conversation
|
||
let token = null; | ||
|
||
if (window.location.hash && window.location.hash.indexOf(AUTH_HASH) === 0) { | ||
token = qs.parse(window.location.hash.substr(AUTH_HASH.length)).token; | ||
} | ||
|
||
const api = new SecureApi(`${urlScheme}${parityUrl}`, token); | ||
const api = new SecureApi(parityUrl, token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not convinced we want to lose the scheme here, it was done due to users running over HTTPS on the network. Seems like we only support localhost now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scheme is resolved inside SecureApi
, note that currently parityUrl
will be just <host>:<port>
Here:
https://github.com/paritytech/parity/pull/5580/files#diff-d37814c31923681deae2e379c0c5b193R33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I missed a step although I did see the stuff below. However with line 57 above now, we only do localhost and cannot connect to anything that is on the network?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, right you mean connectecting to https
remote server from http
site?. So it's possible to override (in constructor) protocol
returned by SecureApi
in case server protocol should be different than the one the UI is running. I can refactor it and detect if protocol was specified in the URL and in such case always use that one if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just worried since the connection to http was logged by a user. (Previously we did ignore protocol here as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now the protocol is handled correctly for all possible cases (including dapps server that had protocol hardcoded).
The only uncovered case is when someone is using SecretApi
as a library and wants to connect to https
server on a website hosted on http
.
Still LGTM. |
needs a rebase |
... and needs rebase again |
ethcore-signer
crate/api
and RPC)/api/apps
removed in favour of RPC callWhy?
Closes #4389
Closes #2080
Closes #5448
Related #4474