Commit Graph

19 Commits

Author SHA1 Message Date
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Lorenzo Blasa
43179a7ef4 ConnectionContext to expose client certificate in PKCS #12 format
Summary:
RSocket plays nicely with Folly and OpenSSL.

Flipper WebSocket-client uses SocketRocket which instead relies on Apple's NSInputStream and NSOutputStream types.

SSL options can be set to secure the communication in both.

Unfortunately, Apple APIs are a bit limited on the supported cryptographic formats it can accept as arguments.

SSL options require the client certificate to be set in PKCS #12 format, contrary to the existing PEM format used by RSocket.

This change adds a method to the ConnectionContext which converts and saves the client certificate in PKCS #12 format.

The method is always expected to succeed as it will only be called once a valid client certificate is available. An unlikely failure will raise an exception.

Reviewed By: fabiomassimo

Differential Revision: D30074334

fbshipit-source-id: 91a475d080569cc339b649c7302b1f28793c7de7
2021-08-04 06:34:18 -07:00
Pritesh Nandgaonkar
293de19c2b Add toggle in the settings for cert exchange medium
Summary:
This diff adds a toggle setting in wilde which will enable certificate exchange through www.
Right now it just sends the information about which medium to be used for cert exchange to Flipper JS and its client side. But its implementation is not done yet.

### Flow for Wilde

Whenever user changes the setting(or when user logs out) we set the state of exchange medium and accordingly set/reset authtoken. Note at no given point we remove already existing certificates.

### Context for OSS

With this diff we introduce another way to do certificate exchange. Before this diff, we did certificate exchange by accessing the file system of app. But it turns out it's not possible to do that in applications signed by enterprise certs. Thus with this diff one can write their FlipperKitCertificateProvider and fetch the certificate from WWW.

Reviewed By: jknoxville

Differential Revision: D22896320

fbshipit-source-id: 55aef7028a62e71ba9c02f9f79acaab41d09c0c6
2020-08-12 04:44:18 -07:00
Andres Suarez
c315691b2d Apply clang-format
Differential Revision: D19843069

fbshipit-source-id: af3f3998e2259ca5070b43ffb19933cf9304319d
2020-02-11 19:29:23 -08:00
Roman Rodyakin
cb3b77bc95 Avoid crashing Flipper SDK on request for unsupported plugins
Summary: in FlipperRSocketResponder::handleFireAndForget, a responder object was being conditionally (for requests with an "id" field) created, resulting in a null pointer passed into FlipperClient::onMessageReceived when no id was present. FlipperClient::onMessage received, in the meantime, unconditionally dereferences that pointer, resulting in a segmentation fault.  This change creates the responder object regardless of whether or not the "id" key is present in the request object, thus avoiding passing a null pointer into FlipperClient::onMessageReceived.

Reviewed By: jknoxville

Differential Revision: D18583898

fbshipit-source-id: 2112c45bc0cd639cec908d0039d6bdaed2f61491
2019-11-22 09:07:33 -08:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Pascal Hartig
6dda7d2b63 More headers
Reviewed By: jknoxville

Differential Revision: D15199272

fbshipit-source-id: d46355a284a6e2acdaccd622dfd4419b06e61a61
2019-05-03 12:08:04 -07:00
Pascal Hartig
65d50fe120 Update license headers in xplat
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D15166958

fbshipit-source-id: 26f0a6d7523be3192833fd3995bc9f5e948816a6
2019-05-02 05:08:54 -07:00
Arthur Kushka
861c5077f1 Extended ConnectionMock functionality
Summary: Its helpful to store all history of sent messages for testing purposes.

Reviewed By: jknoxville

Differential Revision: D14797191

fbshipit-source-id: 0e58166cb4ab79852165f2107b2f6bcd259f1096
2019-04-05 05:40:44 -07:00
John Knox
ff076d9dcd FlipperResponder: no response = success
Summary:
If an exception is thrown from the plugin, FlipperClient.cpp will catch it and respond with an error response.
If the object goes out of scope with no response being returned, then return a success response in the destructor.

Reviewed By: passy

Differential Revision: D14024259

fbshipit-source-id: 52e419dd23fc3882e8b92b593e8c1e1ea90e2b26
2019-02-13 05:13:42 -08:00
John Knox
5da8f35ee3 Don't use private access in FlipperRSocketResponder
Summary:
Changing FlipperRSocketResponder to only use public parts of FlipperConnectionManagerImpl.

This means we can test it by injecting a FCM mock, and it can use its public interface.

Reviewed By: passy

Differential Revision: D14000078

fbshipit-source-id: c0431a888b0ca041807631c81b99fb8b947274d6
2019-02-11 14:06:56 -08:00
Pritesh Nandgaonkar
8327e1ff71 Added background plugin tests in flipper client
Summary: Added tests for flipper client which makes sure that didconnect is called in the case of background plugin. It also checks the case of a non background plugin.

Reviewed By: jknoxville

Differential Revision: D13152686

fbshipit-source-id: 7850f66a42d669243f656a1e1c26584869ee919f
2018-11-23 03:48:36 -08:00
John Knox
1a076f1300 Rename C++ fields and internal methods
Summary: From sonar* to flipper*.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9944461

fbshipit-source-id: 870997e3d1d5aaef73dd445e6d94615f93fe6abc
2018-09-25 04:57:48 -07:00
John Knox
c4d12c21d9 Rename Mock classes
Summary: Part of sonar to flipper rename

Reviewed By: priteshrnandgaonkar

Differential Revision: D9929102

fbshipit-source-id: 88cdbd33aa5c76e386449f54f4eb8c6435865ed1
2018-09-24 07:00:45 -07:00
John Knox
1d2793f701 Rename SonarWebSocket
Summary:
Part of Sonar -> Flipper rename.
It's about time this is renamed from *Websocket as well, since it doesn't use websockets anymore.

Reviewed By: passy

Differential Revision: D9919695

fbshipit-source-id: 78a63bfb7d5de19c093b7fb775d1426b4fc58f77
2018-09-24 06:03:51 -07:00
John Knox
5350d3ce7a Rename C++ SonarPlugin class
Summary: Part of sonar -> flipper rename

Reviewed By: passy

Differential Revision: D9917615

fbshipit-source-id: e59f43bf003d30ae6be4d95bc4a21c92ab39f732
2018-09-24 06:03:50 -07:00
John Knox
9889df3f3c Rename SonarConnection to FlipperConnection
Summary: Part of Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9907353

fbshipit-source-id: 01f7bb84da1c27fd68d608151f437a18b6eaaa4e
2018-09-20 17:06:54 -07:00
John Knox
df8763e697 Move xplat/sonar/xplat/Sonar* to Flipper*
Summary:
Part of the Sonar -> Flipper rename
Intentionally left externally visible buck target as Sonar for now to minimize diff size.

Reviewed By: passy

Differential Revision: D9871684

fbshipit-source-id: 6926eb62c578a05cd895745c75ed7da3cfe965b5
2018-09-20 15:39:57 -07:00