Граф коммитов

499 Коммитов

Автор SHA1 Сообщение Дата
Ben Dean-Kawamura 8f4ffd8d10 Switch FxALog to an enum
I think this fixes the error I just saw in CI:

```
/Users/distiller/project/components/fxa-client/ios/FxAClient/FxAccountLogging.swift:8:1: warning: (enumNamespaces) Convert types used for hosting only static members into enums (an empty enum is the canonical way to create a namespace in Swift as it can't be instantiated).
```
2023-11-14 17:59:26 +00:00
nox1134 804f3abc9b Switch fxa_client from using mockiato to using mockall
Signed-off-by: nox1134 <noxdot1134@gmail.com>

fix formatting errors and add comment in http_client.rs

Signed-off-by: nox1134 <noxdot1134@gmail.com>

fix the dependency summaries failures

Signed-off-by: nox1134 <noxdot1134@gmail.com>

Update Cargo.lock again

Signed-off-by: nox1134 <noxdot1134@gmail.com>

Update Cargo.lock

Signed-off-by: nox1134 <noxdot1134@gmail.com>
2023-11-08 21:27:49 +00:00
Ben Dean-Kawamura 315850d519 FxA updates in preparation of the android-components rework
Added the `get_auth_state()` method which gives a high-level view of the
auth state.  Start tracking if a user is experiencing auth issues. This
represents a different state than either `Connected` or `Disconnected`.
As noted, the Rust code doesn't track all the data that we want yet, and
will need some help from the Kotlin wrapper. Added functions for
simulating auth errors

Added check for missing scoped keys in auth tokens. This will replace a
bunch of android-components code to workaround
https://github.com/mozilla-mobile/android-components/issues/8527.

Reworked the device API:

* Defined the `LocalDevice` struct, which contains the info about the
  client's device.
* Many device methods now return a LocalDevice value constructed from
  the server response.
* Use the last `LocalDevice` returned from the server to cache the
  capabilities.  This improves on the previous system, since it
  differentiates between no known info and the empty list.
* One drawback is that this will always be unset when users migrate, so
  they may hit the server an extra time when `ensure_capabilities` is
  first called.
* This replaces `device_capabilities` in many cases, but
  `device_capabilities` is still used for the
  `reregister_current_capabilities`.  In general, I think it's good to
  track the two things separately: the last device info we've sent and
  the last device info we got back from the server.

Reworked the Kotlin fxa-client wrapper:

* Stop wrapping `FxaConfig` and `FxaServer`, we can just export those
  classes directly now.
* Renamed `PersistedFirefoxAccount` -> `FxaClient`.  We're working
  towards having this class handle more than just persistence.
* Make the token_server_override field optional
2023-11-02 15:27:01 +00:00
Ben Dean-Kawamura cb3fb5634a Adding Fxa operation metrics (#5871) 2023-10-18 15:09:07 +00:00
David Durst 8a7493212e Update README.md to fix dead link
The "Integration with FxA" page in the ecosystem docs moved, resulting in a dead link here. Updated with the current URL.
2023-10-12 15:20:04 +00:00
James Hugman 5ff7298f6c Fixup swiftformat 2023-10-12 15:11:38 +00:00
Ben Dean-Kawamura 1c4caac3b1 Merge the DeviceCapabilities enums
We had two identical enums with different names, let's just use one.
2023-09-15 17:28:41 +00:00
Mike Hommey 8c0c0a60c5 Upgrade base64 to 0.21 2023-09-07 23:47:23 +00:00
Sammy Khamis 65fd9c981d run swiftformat locally 2023-08-17 13:48:16 +00:00
Ben Dean-Kawamura 99d15207a0 Adding the `StateManager` struct
This acts as a container for the FirefoxAccount's state. All fields are
private, which means any state mutations need to go through one of its
methods.  This makes it easier to follow the mutations.

As part of this refactor, I tried to make the names be more precise.
For example `last_sent_device_capabilities` instead of
`device_capabilites`.

Renamed `State` to `PersistedState` and the current "PersistedState"
enum to "PersistedStateTagged".  My hope is that these names make it
clear what each type is doing.

Removed the `RefCell` around `FxaTelemetry`.  It doesn't seem useful
when the entire struct is wrapped in a Mutex.

Removed some dead code
2023-07-26 15:26:36 +00:00
Ben Dean-Kawamura 185491fb94 Reworked handle_oauth_response()
Moved all the code that updates `self.state` to the bottom of the
function.  This makes the changes atomic, which is easier to understand.
Either we successfully handle the response and update our state, or we
fail to handle the response and the state stays the same.

I don't think this will affect the functionality.  If we fail to handle
the oauth response, then we will be in a disconnected state and any of
the changes that would have previously been made won't matter. Please
double-check my reasoning here though.
2023-07-26 15:26:36 +00:00
Ben Dean-Kawamura 14fae5c7f0 Upgrading to UniFFI 0.24 and Glean to 53.1.0 2023-07-05 20:48:54 +00:00
Mark Hammond e2598e30b3 Remove support for migrating from pre-app-services fxaccount implementations 2023-07-01 02:06:56 +00:00
Ben Dean-Kawamura 6f74754b7a Refactored fxa-client
This was part of my work for the auth PR, but I think it's useful
separatedly.

- Updated `fxa-client` to be a single binary.
- Added a cargo alias so it can be run with `cargo fxa [args]`.

I think this makes it easier to use and also will make it easier to
expand the functionality.  It's easier to add another clap subcommand
than to add a new binary.
2023-06-27 13:17:30 +00:00
Ben Dean-Kawamura 2bf9814edd Added compatability methods to `FxaConfig` and related types
The latest Fenix nightly is failing because it was using the
Rust versions of FxaConfig and FxaServer.  Adding some methods to
prevent the breakage
2023-06-23 18:06:11 +00:00
Mark Hammond 2051fa9e37 Kill the integration test feature 2023-06-20 18:46:28 +00:00
Ben Dean-Kawamura 2d1d6cc793 Renamed content_url -> url 2023-06-20 18:46:28 +00:00
Ben Dean-Kawamura f8c9ce2e78 Added a note about token_server_override 2023-06-20 18:46:28 +00:00
Ben Dean-Kawamura 6f67d93b7b Updating the Kotlin/Swift code to avoid breaking changes (for now)
Made the wrapper code work with the new FxaConfig and FxaServer classes.
As noted, we should probably just expose those classes directly to the
consumer application, since they're almost identical to the
server/config classes that we do expose.  However, let's wait just a bit
and fix a couple smaller breaking changes at once.
2023-06-20 18:46:28 +00:00
Ben Dean-Kawamura 657e6114ba Normalize the token server URL override when converting 2023-06-20 18:46:28 +00:00
Ben Dean-Kawamura 383333b93f Reworked FirefoxAccount construction
Made `FirefoxAccount` input a single `FxaConfig` instance for all of
it's configuration.  I want to add more constructor arguments but don't
want to end up with a huge argument count.

Made the example code use the public API, not the internal module.
`FxaConfig` helps ease this transition.  The motivation for this is that
I want to move FxaClent and some other fields to the public
`FirefoxAccount` instance, which means the example code needs to start
using it.  This also results in some nice code cleanups.

Deleted the `fxa-client/migration` example, we're not really
using the migration code anymore.

Now that we're not exposing the `internal` module as pub, Rust is
noticing a lot of dead code.  For the serde JSON structs, I kept the
dead fields and added an annotation.  For the unused functions, I just
deleted them.

Created an `FxaServer` enum.  This matches how the android wrapper
handles it and I don't think we need to input arbitrary URLs here.
2023-06-20 18:46:28 +00:00
Mark Hammond 6c4c65e8ce Move sync-test to the fxa cli helper. 2023-06-14 20:27:20 +00:00
Ben Dean-Kawamura d4fec1ae42 Switch to parking_lot for fxa-client Mutexes
This makes it match the other components
2023-06-12 18:39:52 +00:00
Ben Dean-Kawamura 41bc13ae53 Fixing the token server URL docs 2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 311b4343f4 Get the integration_test feature working again 2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura fe156a74fd Clippy fixes
Also made the `clip-support` example work again
2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 4f3cefecea Cargo fmt 2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 0882d1a3b1 Factor out `push` from `device` 2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura f548f941a2 Spelling and comment improvements 2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 43aa03a3c0 Refactored fxa-client to use the new error system
- Define both the internal and external errors in `errors.rs`
- Use the new `error_support` code to handle conversions between the two
- Wrap API calls in `handle_error()`
- Defined the `ApiResult` typealias
- Reworked some of the imports a bit.  The internal code doesn't need to
  re-export pub items.
2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 81df6124ae Split up the `fxa-client/lib.rs` code
This is prep for the upcoming FxA client work.  I think the smaller
modules are easier to understand and will make it easier to communicate
changes.  Also, it's useful to know which structs go together with which
methods.
2023-05-26 14:34:03 +00:00
Tarik Eshaq 1c87ebdd3c Changes handle_push_message to return one event 2023-05-24 15:39:02 +00:00
Tarik Eshaq a2930f2bc1 Exposes retrieving an event for a push message 2023-05-24 15:39:02 +00:00
Sammy Khamis 588eef1bf4 ran ktlintFormat for the auto-fixable ones 2023-05-23 19:47:53 +00:00
Tarik Eshaq 0316e73568 Fixes keychain infinite recursion 2023-05-03 21:20:22 +00:00
Mark Hammond 5802165598
Remove duplicate DeviceType enums. (#5316) 2023-04-28 05:35:26 +10:00
jhugman 214f0f65d8
Fixup swiftlint breakages from upgrading swiftlint (#5454) 2023-03-29 20:28:45 +01:00
Tarik Eshaq 2172b921b8
Fixes swiftformat due to new version (#5419) 2023-03-06 15:27:44 -05:00
Ben Dean-Kawamura 6ecde0b247 Don't use workspace dependencies for UniFFI.
This was really nice, but it breaks when we get vendored in to
moz-central.  So we have to go back to the dark ages.
2023-01-30 12:26:58 -05:00
Ben Dean-Kawamura b3a573164e Clippy and check-dependency fixes 2023-01-27 15:32:17 -05:00
Ben Dean-Kawamura a79f23574f Updating UniFFI to version 0.23
- Switched to using workspace dependencies, this will make future
  updates much simpler
- Updated code to work with the new UniFFI crate structure
- Updated the error-support integration tests to work with the workspace
  dependencies, following this advice: https://stackoverflow.com/a/71461114.
2023-01-27 12:38:55 -05:00
Mark Hammond 47fd90041a
Avoid Option<DeviceType> in all structs (#4861) 2023-01-12 12:18:08 +11:00
Mark Hammond 24098bcafd
Update rust version to 1.65.0, MSR to 1.61 (#5299) 2022-12-16 14:02:22 +11:00
Mark Hammond eb804faf80
Update sync15 BSO concept to use envelopes and kill sync15::Payload. (#5139)
Reworks how BSOs work in all syncable components.

This adopts some of the BridgedEngine model - specifically, there's now
an IncomingBso and OutgoingBso, each with a corresponding IncomingEnvelope
and OutgoingEnvelope. There's also a new formalized "content" mechanism
for serializing and deserializing payloads to and from some T, with a
sane and consistent procedure for handling tomebstones and malformed
records.

BridgedEngine and SyncEngine now work using these new types, getting us
closer to fully integrating these engines into a single trait.

This kills sync15::Payload entirely in favor of the new system.
2022-12-02 11:31:06 +11:00
Tarik Eshaq a2f6d96ef2
Exposes reset function swift (#5260)
* Adds funciton to reset persisted accounts state

* Allows iOS to pick up persisted changes in Account Manager
2022-11-28 18:09:00 -05:00
lmarceau 0ce488ec37
Fix deprecation warnings in iOS Swift Keychain Wrapper code (#5259)
* Fix deprecation warnings

And various minor code fixes

* Fix build after being able to run it

* Fix swiftlint
2022-11-25 17:00:29 -05:00
Tarik Eshaq c4368dbda6
Fixes swift lint (#5257) 2022-11-21 15:15:37 -05:00
Tarik Eshaq 02a41a2dcb
Polls all commands and not just one in iOS (#5236)
* Polls all commands and not just one in iOS

* Fix changelog
2022-11-20 13:13:02 -05:00
Tarik Eshaq e8d9e90107
Filters devices in device list by 21 days (#4984) 2022-11-17 17:16:36 -05:00
Ben Dean-Kawamura f50d60cbb3 Replaced `log::error!` calls with `error_support::report_error!`
Went through all the main app-services components and replaced the
old-style `log::error!` calls with `error_support::report_error!`.

Removed the `reporting` feature of `error-support` and made it
always-enabled.

Renamed the `report_error` function so that it's name doesn't clash with
the `report_error` macro
2022-10-27 18:37:46 -04:00
Ben Dean-Kawamura 7155bbb4a9 Updating UniFFI to 0.21.0 2022-10-19 11:37:03 -04:00
Mark Hammond d8503475f4
Merge sync15-traits back into sync15 via features. (#5125) 2022-09-15 11:09:04 +10:00
Ben Dean-Kawamura b82517cde3 Updating Rust versions to 1.61/1.63
This matches the nightly versions for FF desktop.
2022-09-13 19:13:44 -04:00
Tarik Eshaq ad9dd96c60
Adds error-support to the iOS megazords (#5094)
* Adds error-support to the iOS megazords

* Updates UniFFI to 0.19

* Adds changelog

* fixup dependency summaries

* Fixup changelog
2022-08-29 13:01:30 -07:00
Mark Hammond 5c63cc5c40
Move the bso_record and key_bundle into the sync15_traits crate. (#5083)
(Which further reinforces that the name of that crate should be something like
`sync15-types`)

This is preparatory work for a much larger patch that will get us further down
the path to #2841 and also fix #2712. It should not change any behaviour.

As part of this, the sync15_traits errors needs to be addressed. It's not
reasonable to just create another enum that we expect clients to add to
their error types because many of the errors overlap which makes handling
them very difficult (eg, if we want to catch a serde error, you don't want
to know which crate it originated in) - so sync15 duplicates the sync15_traits
errors and can convert between them - so consumers can continue to catch
sync15::Error and still get errors which originated in sync15-traits.

sync15-traits now has a `crypto` feature - sync15 enables that feature, but
crates which just use a `bridged_engine` do not. This means that when
vendoring into Desktop Firefox, this feature isn't enabled, so we don't
pull in any of the crypto libs there.
2022-08-22 13:43:10 +10:00
Mark Hammond faba1ab63e
Update to base64 0.13 (#4985) 2022-06-06 10:57:17 +10:00
Tarik Eshaq a6af58fac6
Bumps uniffi to 0.18 [ci full] (#4949)
* Bumps uniffi to 0.18

* Fixes dependency summaries

* Fixes uniffi duplicate type definitions

* Adds changelog

* Renames Timestamp to PlacesTimestamp

* Adds focus dependency changes from rebase

* Fix typo in dependency summaries comment
2022-05-16 10:26:20 -07:00
Tarik Eshaq f7c5588b1e
Update rand and parking lot (#4937)
* Update rand and parking_lot.

I need this to update other Gecko dependencies.

* Update dependency_summary to account for various windows-rs crates.

I'm not sure why it wasn't failing to find the relevant licenses before,
it was likely a pre-existing issue.

* Update dependency summaries.

* Runs dependency summaries on a mac

Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
2022-05-02 17:18:12 -07:00
Mark Hammond 862e30d43f
Remove duplicate DeviceType enum implementations. (#4397) 2022-02-23 10:09:59 +11:00
jhugman 98e611c51d
Prepare components for using uniffi Custom types (#4829) r=bdk
* Prepare Nimbus for using uniffi Custom types

* Update places to use renamed Custom types

* Increment uniffi version number

* Update Cargo.lock

* Fixup ktlint
2022-02-08 16:52:37 +00:00
Tarik Eshaq 68c10e0673
upgrades to rust 2021 [ci full] (#4822)
* upgrades to rust 2021

* Push rust minimum version to 1.57
2022-02-07 09:38:05 -08:00
Sammy Khamis a086905f3d
Remove all Carthage and switch to xcframeworks (#4619)
* removing carthage and using xcframeworks
* update xcode to 13.2.1
* update resource class
2022-02-03 15:05:05 -10:00
Sammy Khamis 891d944b09
rust/xcframework changes to allow firefox-ios to build using spm (#4797)
* spm changes to allow firefox-ios to build using spm
2022-01-31 10:50:26 -10:00
Sammy Khamis 73427f79a6
Places uniffication (#4770)
* initial conversion of errors for places uniffication

* Converted history metadata functions for places uniffication

* Converted kotlin history metadata functions

* Converted iOS history metadata functions

* [Places uniffication] Fix places error issues (#4687)

* remove uniffi-specific wrapper and updated error test

* Uniffi VisitObservation and apply_observation (#4689)

* uniffied VisitObservation, HistoryVisitInfo and methods using those structs

* Uniffi top frecent site info (#4711)

* Uniffi top frecent site info

* Uniffis FrecencyThresholdOption

* Uniffi Places Sync (#4714)

* uniffi places sync and sync15 functions

* Uniffi Search result and match url (#4720)

* Uniffi query autocomplete

* uniffi places_accept_result

* uniffi places_match_url

* cargo fmt

* cargo clippy

* remove accept_result from ffi crate

* Adds comment on the uniffi bug with varaint shadowing type

* Uniffi Places Interrupt methods (#4726)

* uniffi places interrupt functions

* Consolidate types (#4736)

* Updates the visit observation to use URL

* Uses VisitTransition for HistoryVisitInfo

* updates uniffi to 0.16

* Uniffied bookmarks

* switch to use uint in the apis for adding bookmarks (#4747)

* Remove the manual places FFI entirely.

* folders and separators now have non-nullable parents

* Always insert via Insertable items, and clarify separation between node types.

* Add json_tree module with all json-based types and implementation.

* Fix swift warnings re non-null parentGuid

* bookmarks: Remove public_node and introduce a fetch module

* Update swift code to make breaking changes fixes cleaner (#4766)

* rebased and added changelog entry

Co-authored-by: lougeniac64 <lougeniaC64@users.noreply.github.com>
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
2022-01-20 15:00:00 -05:00
Tarik Eshaq 36ae51e12e
Upgrade rust to 1.57 (#4723)
* upgrades rust to 1.57

* fixes clippy

* Document where to find the latest version moz-central uses

* an attempt to fix broken cargo bench

* Uses _ instead of dead_code where possible

* runs cargo update
2021-12-20 10:48:14 -07:00
Tarik Eshaq 451bcc2fe8
Fix swiftformat (#4710)
* Fixes swiftformat

* upgrades the ci to use swiftversion 5
2021-12-06 13:40:57 -08:00
Tommaso Piazza 89a250c5e2
style: fix Xcode capitalization (#4699)
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
2021-12-02 11:09:47 -08:00
Mark Hammond 59c049af40
Update to uniffi 0.15.2 (#4677) 2021-11-25 12:00:46 +11:00
Ben Dean-Kawamura 7ca9b3f851 Log fxa responses with missing scoped keys (#4678) 2021-11-23 12:54:59 -05:00
Janet Dragojevic afa15c5a8c
fix indentation (#4350)
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
2021-11-02 17:41:27 -04:00
Sammy Khamis a068750830
Migrating Components to Swift Packages Pt.1 (#4461)
* added fxa, logins, push, tabs, and autofill as swift packages
2021-09-30 09:34:30 -10:00
Sammy Khamis 41575c3502
Update rust according to moz-central updates [ci full] (#4486)
* update rust to 1.55 according to moz-central updates
2021-09-22 15:24:00 -10:00
Mark Hammond ff6156416b
We rely on url version 2.2 and just got lucky that we had it (#4489) 2021-09-22 07:56:29 +10:00
Tarik Eshaq 6f7d0d71ae
Removes unused dependencies (#4426)
* Removes ffi-support from tabs, fxa-client and logins

* Removes rand_rccrypto and thiserror unused dependencies
2021-09-02 16:30:54 -07:00
Sammy Khamis 6c839a3ade
Update uniffi 0.14.0 (#4389)
* Update UniFFI dependency to v0.14.0

Co-authored-by: Ryan Kelly <ryan@rfk.id.au>
2021-08-19 16:31:02 -10:00
Ryan Kelly ae22569f9e Move KeychainWrapper extensions into FxAClient module.
The FxAClient Swift module is the only thing that uses
the KeychainWrapper extensions, so let's make them live
inline in that codebase. This will simplify eventual
migration to publishing as separate Swift modules.
2021-08-03 00:32:40 +00:00
Ryan Kelly c12b286312 Extract the bulk of shared gradle logic into script plugins.
Prior to this commit, the `build.gradle` for each individual
project contained copy-pasted logic for configuring Android
and protobuf. Some of them were even using slightly different
versions of the same dependencies.

With this commit, there are two new gradle scripts that encapsulate
this shared logic:

* ./build-scripts/component-common.gradle, for basic Android
  and Kotlin setup.
* ./build-scripts/protobuf-common.gradle, for configuration specific
  to the protobuf plugin.

Hopefully this will make the logic easier to maintain going forward.
2021-07-20 13:56:15 +10:00
Ryan Kelly 28e4982cd2
Consolidate megazord-related gradle logic into a shared helper. (#4187)
Prior to this commit, each of our individual components had its
own copy of gradle logic for depending on the megazord, including
a couple of lengthy comments about fiddling around with JNA for
the Android Studio test runner.

I've moved all that logic into a helper function in `publish.gradle`
so that we can maintain it in a single location from here out.
There may be a cleaner or more idiomatic way to achieve this kind
of code-sharing in gradle, but I figure this *has* to be better
than our current copy-paste-based approach.

I've manually confirmed that a local `./gradlew test` completes
successfully, as well as testing via Android Studio.
2021-07-19 13:14:08 +10:00
Tarik Eshaq 3f125205fc Removes old StateV1 schema from fxa-client 2021-06-17 01:15:34 +00:00
Ryan Kelly 7e73e00439 Update UniFFI to v0.12.0 [ci full]
The latest release of UniFFI includes a significant change to the
way Object instances are managed, switching from handlemaps to
raw Arc<T> pointers. We should get this into consumers for testing
at some point early in a Nightly cycle.
2021-06-15 10:39:43 +10:00
Mark Hammond 367280a8ce
Remove incorrect serde implementation for one copy of the DeviceType enum (#4193) 2021-06-10 09:15:59 +10:00
Ryan Kelly aa4de78e35 Update UniFFI to v0.11.0.
This is a nice testcase for the "bindings are automatically regenerated
on UniFFI version changes" theory about the previous commit, which does
indeed seem to be working out for me in practice.
2021-06-07 08:51:46 +10:00
Ryan Kelly 9183da2264 Use a shared helper for gradle uniffi-bindgen tasks.
We currently have four copies of the logic for calling UniFFI
from gradle, several with their own little tweaks. Let's take
the best lessons from each and consolidate them into a single
shared helper.

This version is, I think, an improvement over all the existing
ones:

* Like the nimbus version, it registers the task as generating
  java source files, which should help things integrate cleanly
  into the broader build.
* Like the fxa-client version, it declares explicit inputs so
  that we can avoid re-running the task when nothing has changed.
* New in this version, it declares an input dependency on anything
  that would affect the version of `uniffi-bindgen` that is in use,
  since that too will change the generated outputs.

That last change should really help with smooth updates to the
version of UniFFI in use. Previously, if you changed the UniFFI
version it would not trigger a cleanup of old generated bindings,
and you'd get `java.lang.UnsatisfiedLinkError` errors like in #4054.
(This is UniFFI's last-line-of-defence measure to prevent you from
using bindings generated with one version of UniFFI on a library
compiled with another, which is very useful, but an extremely
confusing failure mode).

With this change, an updated version of UniFFI will invalidate
the gradle task that generates the bindings, causing them to
be regenerated with the new version.
2021-06-07 08:51:46 +10:00
Mark Hammond 05fe3975fd
fix nightly clippy nits (#4161) 2021-06-01 15:43:11 +10:00
Mark Hammond df889dd898
Update uniffi to version 0.10 (#4144) 2021-05-26 18:04:01 +10:00
Ryan Kelly 8c889d829f Update uniffi dependency to v0.9.0 2021-05-25 11:43:27 +10:00
Mark Hammond 982292603f url:Url has deprecated `into_string()`
Was deprecated in https://github.com/servo/rust-url/pull/686
2021-05-19 15:24:11 +10:00
Ryan Kelly ffa7a0693c
Compatibility with rust-ece breaking API changes. (#3941)
The rust-ece crate has had its interface simplified to remove footguns,
let's update to that release and get a few cleanups of our own while
we're at it.
2021-03-23 09:04:53 +11:00
Mark Hammond 9b7347ac60
Add Direct Encryption with a Shared Symmetric Key support to jwcrypto. (#3922) 2021-03-17 12:01:42 +11:00
Ryan Kelly 010cec54b8
Adding Nimbus to the iOS Megazord (#3901) (#3913)
Co-authored-by: jhugman <jhugman@users.noreply.github.com>
2021-03-10 12:17:42 +11:00
Ryan Kelly d77600e32c
Restructure, UniFFI, and document the fxa-client crate. (#3876)
This is a substantial refactor of the fxa-client crate, intended to bring it
up to speed with our latest best-practices around developing cross-platform
Rust components, in order to ease ongoing maintenance.

THe core change here is that I've deleted the hand-written Kotlin and Swift
bindings, replacing them with autogenerated bindings thanks to UniFFI.

There is still a little bit of hand-written Kotlin, since we have a layer that
automatically manages persistence via a callback. There is still a nontrivial
amount of hand-written Swift, since we have a higher-level state machine built
atop the lower-level fxa-client functionality (such state-machine also exists
for Kotlin, but lives in the android-components repo). If UniFFI works out then
we should look into moving more of that logic into shared Rust code over time.

To support the introduction of UniFFI, I have restructured to Rust crate so
that its public interface deliberately parallels the interface offered to
Kotlin and Swift, and have moved the implementation details into a submodule
named `internal`. It's my opinionated belief that structuring the crate this
way will help us focus on producing a nice consumer API, which is not always
the same thing as producing a nice Rust crate.

On top of that, I've also revamped the documentation in the crate, leaning
in to the use of `cargo doc` as the source of truth for both developer-
and consumer-facing documentation. Let's consider that an experiment and
see how we like it in practice.

Unfortunately, this is a big PR, but I don't think I could have made it
too much smaller. Hopefully it will be easier to review than its size
suggests since it's mostly additions and deletions rather than complex
changes.
2021-03-09 22:34:58 +11:00
Dan Mosedale 6c5e4dabb4 Staple application-services to rust 1.50 (fixes SYNC-2077) 2021-03-09 16:26:27 +11:00
Dan Mosedale 0487f46f1f Fixes remaining Rust 1.50 clippy issues (SDK-220) 2021-03-03 15:53:05 -08:00
Dan Mosedale d61194a4a6 Experimental automated fixes to clippy issues from 1.52 nightly 2021-03-01 18:07:54 -08:00
Mark Hammond 9cc308e200
Remove ecosystem_user_id and related functionality. (#3782) 2020-12-18 10:41:56 +11:00
Ryan Kelly dcdd4d8916
Fix swift formatting in FxA component. 2020-11-10 13:23:19 +11:00
Edouard Oger aa5dcccb2c
Move rate-limiter to its own support crate 2020-11-09 16:50:28 -05:00
Mark Hammond 8a576fbe79
Pin stable rust version to 1.43 (#3700) 2020-11-09 12:10:11 +11:00
Edouard Oger 4cdbeee9d5
Make swiftformat happy 2020-10-19 13:29:17 -04:00
Ryan Kelly 6e9da333a9
Merge pull request #3636 from mozilla/document-ffi-zero-ttl-means-default
Document how to use default ttl in get_access_token FFI call.
2020-10-15 15:52:14 +11:00