tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

README.md (4054B)


[Android Components](../../../README.md) > Service > Firefox Sync - Logins

A library for integrating with Firefox Sync - Logins.

Before using this component

Products sending telemetry and using this component must request a data-review following this process. This component provides data collection using the Glean SDK. The list of metrics being collected is available in the metrics documentation.

Motivation

The Firefox Sync - Logins Component provides a way for Android applications to do the following:

Usage

Before using this component

The mozilla.appservices.logins component collects telemetry using the Glean SDK. Applications that send telemetry via Glean must ensure they have received appropriate data-review following the Firefox Data Collection process before integrating this component.

Details on the metrics collected by the mozilla.appservices.logins component are available here

Setting up the dependency

Use Gradle to download the library from maven.mozilla.org (Setup repository):

implementation "org.mozilla.components:service-sync-logins:{latest-version}"

You will also need the Firefox Accounts component to be able to obtain the keys to decrypt the Logins data:

implementation "org.mozilla.components:fxa:{latest-version}

Known Issues

API

This implements the login-related interfaces from mozilla.components.concept.storage.

FAQ

Which exceptions do I need to handle?

It depends, but probably only SyncAuthInvalid, but potentially IncorrectKey.

The errors reported as "raw" LoginsApiException are things like Rust panics, errors reported by OpenSSL or SQLcipher, corrupt data on the server (things that are not JSON after decryption), bugs in our code, etc. You don't need to handle these, and it would likely be beneficial (but of course not necessary) to report them via some sort of telemetry, if any is available.

Can I use an in-memory SQLcipher connection with `DatabaseLoginsStorage`?

Just create a DatabaseLoginsStorage with the path :memory:, and it will work. You may also use a SQLite URI filename with the parameter mode=memory. See https://www.sqlite.org/inmemorydb.html for more options and further information.

What's `wipeLocal`?

wipeLocal deletes all local data from the database, bringing us back to the state prior to the first local write (or sync). That is, it returns it to an empty database.

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/