Commit 76d178ed authored by Grisha Kruglov's avatar Grisha Kruglov Committed by Grisha Kruglov
Browse files

No issue: bump a-s to 0.37.0

Some nice improvements:
- 0.37.0 fixes behaviour of `FirefoxAccount.disconnect` - device records will now be removed on logout.
- 'wantsKeys' is no longer necessary, so we get a simpler API
- new device type for upcoming integrations
parent 0a19046e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ object Versions {
    const val disklrucache = "2.0.2"
    const val leakcanary = "1.6.3"

    const val mozilla_appservices = "0.36.0"
    const val mozilla_appservices = "0.37.0"
    const val servo = "0.0.1.20181017.aa95911"

    const val material = "1.0.0"
+3 −0
Original line number Diff line number Diff line
@@ -127,6 +127,9 @@ interface DeviceConstellationObserver {
enum class DeviceType {
    DESKTOP,
    MOBILE,
    TABLET,
    TV,
    VR,
    UNKNOWN
}

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class AuthException(type: AuthExceptionType, cause: Exception? = null) : Throwab
 */
@SuppressWarnings("TooManyFunctions")
interface OAuthAccount : AutoCloseable {
    fun beginOAuthFlowAsync(scopes: Set<String>, wantsKeys: Boolean): Deferred<String?>
    fun beginOAuthFlowAsync(scopes: Set<String>): Deferred<String?>
    fun beginPairingFlowAsync(pairingUrl: String, scopes: Set<String>): Deferred<String?>
    fun getProfileAsync(ignoreCache: Boolean): Deferred<Profile?>
    fun getProfileAsync(): Deferred<Profile?>
+2 −2
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ class FirefoxAccountsAuthFeatureTest {
        val profile = Profile(uid = "testUID", avatar = null, email = "test@example.com", displayName = "test profile")

        `when`(mockAccount.getProfileAsync(anyBoolean())).thenReturn(CompletableDeferred(profile))
        `when`(mockAccount.beginOAuthFlowAsync(any(), anyBoolean())).thenReturn(CompletableDeferred("auth://url"))
        `when`(mockAccount.beginOAuthFlowAsync(any())).thenReturn(CompletableDeferred("auth://url"))
        `when`(mockAccount.beginPairingFlowAsync(anyString(), any())).thenReturn(CompletableDeferred("auth://url"))
        `when`(mockAccount.completeOAuthFlowAsync(anyString(), anyString())).thenReturn(CompletableDeferred(true))

@@ -154,7 +154,7 @@ class FirefoxAccountsAuthFeatureTest {

        `when`(mockAccount.getProfileAsync(anyBoolean())).thenReturn(CompletableDeferred(profile))

        `when`(mockAccount.beginOAuthFlowAsync(any(), anyBoolean())).thenReturn(CompletableDeferred(value = null))
        `when`(mockAccount.beginOAuthFlowAsync(any())).thenReturn(CompletableDeferred(value = null))
        `when`(mockAccount.beginPairingFlowAsync(anyString(), any())).thenReturn(CompletableDeferred(value = null))
        `when`(mockAccount.completeOAuthFlowAsync(anyString(), anyString())).thenReturn(CompletableDeferred(true))

+2 −3
Original line number Diff line number Diff line
@@ -103,13 +103,12 @@ class FirefoxAccount internal constructor(
     * Constructs a URL used to begin the OAuth flow for the requested scopes and keys.
     *
     * @param scopes List of OAuth scopes for which the client wants access
     * @param wantsKeys Fetch keys for end-to-end encryption of data from Mozilla-hosted services
     * @return Deferred<String> that resolves to the flow URL when complete
     */
    override fun beginOAuthFlowAsync(scopes: Set<String>, wantsKeys: Boolean): Deferred<String?> {
    override fun beginOAuthFlowAsync(scopes: Set<String>): Deferred<String?> {
        return scope.async {
            handleFxaExceptions(logger, "begin oauth flow", { null }) {
                inner.beginOAuthFlow(scopes.toTypedArray(), wantsKeys)
                inner.beginOAuthFlow(scopes.toTypedArray())
            }
        }
    }
Loading