Firefox/Kinto: Difference between revisions
< Firefox
Jump to navigation
Jump to search
(Mention Lockbox) |
(Remove decommissioned use-cases) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Kinto Integration in Firefox = | = Kinto Integration in Firefox = | ||
[http://www.kinto-storage.org Kinto] is a simple JSON storage service that was integrated into Firefox, | [http://www.kinto-storage.org Kinto] is a simple JSON storage service that was integrated into Firefox, and currently used for RemoteSettings. | ||
= Key features = | = Key features = | ||
Line 24: | Line 24: | ||
|Mathieu Leplatre — :leplatrem | |Mathieu Leplatre — :leplatrem | ||
|- | |- | ||
|} | |} | ||
See also [https:// | It used be supporting more use-cases in the past. See also [https://github.com/mozilla-services/servicedenuages.fr/blob/master/content/2017.12.kinto-at-mozilla.rst Kinto at Mozilla] | ||
= Usage = | = Usage = | ||
Line 83: | Line 70: | ||
= Resources = | = Resources = | ||
* [https:// | * [https://remote-settings.readthedocs.io Remote Settings docs] | ||
* [https://blog.mathieu-leplatre.info/the-history-of-firefox-remote-settings.html The History of Remote Settings] | |||
* [https://github.com/mozilla-services/servicedenuages.fr/blob/master/content/2017.12.kinto-at-mozilla.rst Kinto at Mozilla] (blog post) -- see also [https://web.archive.org/web/20180111085958/https://www.servicedenuages.fr/en/kinto-at-mozilla the published version, no longer available at its initial location] | |||
= Contribute = | = Contribute = |
Latest revision as of 09:58, 19 February 2021
Kinto Integration in Firefox
Kinto is a simple JSON storage service that was integrated into Firefox, and currently used for RemoteSettings.
Key features
- Diff-based data synchronization
- Offline persistence
- Data integrity/signing
- Peer review to publish data changes
- Admin panel UI
- Built-in Telemetry
- Firefox Accounts Integration
Use Cases
Component | Description | Contact |
---|---|---|
RemoteSettings | Firefox/RemoteSettings allows to ship data and files to Firefox. It is used for blocklists, security state, Activity Stream, Fennec assets and experiments etc. | Mathieu Leplatre — :leplatrem |
It used be supporting more use-cases in the past. See also Kinto at Mozilla
Usage
Two client libraries are vendored in Firefox:
- Kinto HTTP client: for direct interactions with the Kinto HTTP API
- Kinto offline client: for offline persistence in internal SQLite or IndexedDB
HTTP client
const { KintoHttpClient } = Cu.import("resource://services-common/kinto-http-client.js", {}); const remote = "https://kinto.dev.mozaws.net/v1"; const headers = { Authorization: "Basic " + btoa("user:pass") }; const client = new KintoHttpClient(remote, {headers}); const records = await client.bucket("a-bucket") .collection("a-collection") .listRecords();
Offline client
const { Kinto } = Cu.import("resource://services-common/kinto-offline-client.js", {}); const remote = "https://kinto.dev.mozaws.net/v1"; const headers = { Authorization: "Basic " + btoa("user:pass") }; const kinto = new Kinto(); const bucket = "a-bucket"; const collection = kinto.collection("a-collection"); // Fetch/Publish changes. const { ok } = await collection.sync({ bucket, remote, headers }); // Read local collection of records. const records = await collection.list();
Resources
- Remote Settings docs
- The History of Remote Settings
- Kinto at Mozilla (blog post) -- see also the published version, no longer available at its initial location
Contribute
Generate bundles
The Kinto client libraries are developed independently on Github:
- kinto-http is the HTTP client for the Kinto REST API;
- kinto.js is the offline-first client for Kinto.
With the help of Babel and browserify, a bundle is generated for Firefox with the minimum transpilation possible (eg. CommonJS require, ES7 decorators).
kinto.js
From the kinto.js repo, generate the moz-kinto-offline-client.js
file:
$ npm run dist-fx
And overwrite it in the Firefox code base:
$ cp dist/moz-kinto-offline-client.js ../mozilla-central/services/common/kinto-offline-client.js
kinto-http.js
From the kinto-http.js repo, generate the moz-kinto-http-client.js
file:
$ npm run dist-fx
And overwrite it in the Firefox code base:
$ cp dist/moz-kinto-http-client.js ../mozilla-central/services/common/kinto-http-client.js