Rename OIDC components and variables to OAuth (#6686)

* Rename `OIDC` components and variables to `OAuth`. This matches the new behavior in the SDK.
This commit is contained in:
Jorge Martin Espinosa 2026-04-29 11:41:47 +02:00 committed by GitHub
parent 414da30d33
commit 1ef74f0cde
96 changed files with 479 additions and 482 deletions

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2025 Element Creations Ltd.
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.libraries.oauth.test"
}
dependencies {
implementation(libs.coroutines.core)
api(projects.libraries.oauth.api)
implementation(projects.tests.testutils)
}

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2025 Element Creations Ltd.
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.oauth.test
import android.content.Intent
import io.element.android.libraries.oauth.api.OAuthAction
import io.element.android.libraries.oauth.api.OAuthIntentResolver
import io.element.android.tests.testutils.lambda.lambdaError
class FakeOAuthIntentResolver(
private val resolveResult: (Intent) -> OAuthAction? = { lambdaError() }
) : OAuthIntentResolver {
override fun resolve(intent: Intent): OAuthAction? {
return resolveResult(intent)
}
}

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2025 Element Creations Ltd.
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.oauth.test.customtab
import io.element.android.libraries.oauth.api.OAuthAction
import io.element.android.libraries.oauth.api.OAuthActionFlow
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.MutableStateFlow
/**
* This is actually a copy of DefaultOAuthActionFlow.
*/
class FakeOAuthActionFlow : OAuthActionFlow {
private val mutableStateFlow = MutableStateFlow<OAuthAction?>(null)
override fun post(oAuthAction: OAuthAction) {
mutableStateFlow.value = oAuthAction
}
override suspend fun collect(collector: FlowCollector<OAuthAction?>) {
mutableStateFlow.collect(collector)
}
override fun reset() {
mutableStateFlow.value = null
}
}