Summary:
Use an URLProvider paired with a token provider for attempts to establish a websocket connection.
This gives extra flexibility whenever a token is not available or changes as the ReconnectingWebSocket will call the URLProvider after each unsuccessful connection.
Reviewed By: antonk52
Differential Revision: D50220329
fbshipit-source-id: f53993a90c9c0f64bf213019b6b8af5fa818048d
Summary: These are quite verbose even when debugging, so remove.
Reviewed By: ivanmisuno
Differential Revision: D49538582
fbshipit-source-id: 089027390a825dde3d3d53b67e3f920f2f1f75f2
Summary: There are reports in which kill as is doesn't kill the process. Using the '-9' flag does, so update troubleshoot message.
Reviewed By: LukeDefeo
Differential Revision: D49537427
fbshipit-source-id: a062c92528589cecf0f41e1c344c5d0ae1c3345d
Summary: Updating the remaining tsconfigs to build for an ES2021 target.
Reviewed By: antonk52
Differential Revision: D48687661
fbshipit-source-id: 2761704d251f701594ca5d362a17731f287088ed
Summary: Combine the two used commands as will make things easier for our users.
Reviewed By: passy
Differential Revision: D48266474
fbshipit-source-id: 1ee5c568ff001dc5ba3f11e21b09a2a6ab430ac7
Summary:
The previous recommendation doesn't always holds true. There are reported cases in which a process is listening to the specified port yet is not being listed by the lsof command as advised.
The command below seems to work better.
sudo lsof -i :52342
Reviewed By: antonk52
Differential Revision: D47989269
fbshipit-source-id: ea216de00ef6edc90de58e9d3fe3a0579a171fea
Summary:
The existing error message was not in the centre and didn't give any possible remediation steps.
{F1015240268}
Reviewed By: passy
Differential Revision: D46394149
fbshipit-source-id: 09d450bef9df83c5b3af3ba49c7e0fafb81bfdce
Summary:
Until now, launching flipper-server with TCP would accept any incoming connection as long as it comes from the same origin (localhost) using web socket host origin verification.
This is not entirely secure as origin can be spoofed with tools like curl.
Our team created a security review and a proposal was written:
https://docs.google.com/document/d/16iXypCQibPiner061SoaQUFUY9tLVAEpkKfV_hUXI7c/
Effectively, Flipper can generate a token which is then used by the client to authenticate.
This diff contains the changes required to generate, obtain, and validate authentication tokens from clients connecting to flipper over TCP connections.
The token itself is a JWT token. JWT was chosen because it is a simple industry standard which offers three features which can immediately benefit us:
- Expiration handling. No need for Flipper to store this information anywhere.
- Payload. Payload can be used to push any data we deem relevant i.e. unix username.
- Signing. Signed and verified using the same server key pair which is already in place for certificate exchange.
Additionally, the token is stored in the Flipper static folder. This ensures that the browser and PWA clients have access to it.
Reviewed By: mweststrate
Differential Revision: D45179654
fbshipit-source-id: 6761bcb24f4ba30b67d1511cde8fe875158d78af
Summary:
Logging data for this event turnslogs into unreadable mess
{F789339377}
Reviewed By: lblasa
Differential Revision: D40978819
fbshipit-source-id: ac0894b2a490aa902180c50e7712b168211c7013
Summary: FlipperServerClient can use any socket to transfer the data. Since we do not control the socket, we cannot guarantee what comes out of it (hello, Jest E2E tunnel!). We need to handle unexpected messages gracefully.
Reviewed By: passy
Differential Revision: D40891384
fbshipit-source-id: 6f873037aa49bac3fc4c09fa49483cdec537ae40
Summary: Remove `window` reference to use flipper-server-client in NodeJS context (windows is not defined there)
Reviewed By: passy
Differential Revision: D40859805
fbshipit-source-id: 23415f9d504e4dbba4035b942c73add86edf02de
Summary:
FlipperServerClient is a useful abstraction for any JS-based client of headless Flipper. No need to bundle it with flipper-frontend-core, as the rest is not useful for external clients.
Currently, I am planning to add it to jest-e2e to send commands to Flipper
Reviewed By: lblasa
Differential Revision: D40765668
fbshipit-source-id: af48710bb15444ac1ecd649fe9a2ab252f3088f3