Updated on 2026-08-14
This commit is contained in:
parent
1e0c7e02ff
commit
8439b5a6a6
6 changed files with 24 additions and 9 deletions
|
|
@ -1,24 +1,20 @@
|
|||
package com.tangem.tap.network.auth
|
||||
|
||||
import com.tangem.common.extensions.toHexString
|
||||
import com.tangem.datasource.config.ConfigManager
|
||||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.domain.wallets.legacy.WalletsStateHolder
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.lib.auth.ExpressAuthProvider
|
||||
import com.tangem.lib.auth.ExpressSessionIdGenerator
|
||||
import com.tangem.tap.proxy.AppStateHolder
|
||||
import com.tangem.lib.auth.sessionId.ExpressSessionIdGenerator
|
||||
import java.util.UUID
|
||||
|
||||
class ExpressAuthProviderImpl(
|
||||
private val walletStateHolder: WalletsStateHolder,
|
||||
private val userWalletsStore: UserWalletsStore,
|
||||
private val appStateHolder: AppStateHolder
|
||||
private val configManager: ConfigManager
|
||||
) : ExpressAuthProvider, ExpressSessionIdGenerator {
|
||||
|
||||
private var uuid = UUID.randomUUID()
|
||||
|
||||
override fun getApiKey(): String {
|
||||
TODO()
|
||||
return configManager.config.tangemExpressApiKey
|
||||
}
|
||||
|
||||
override fun getUserId(): String {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.tangem.tap.network.auth.di
|
||||
|
||||
import com.tangem.datasource.config.ConfigManager
|
||||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.lib.auth.ExpressAuthProvider
|
||||
import com.tangem.tap.network.auth.AuthProviderImpl
|
||||
import com.tangem.tap.network.auth.ExpressAuthProviderImpl
|
||||
import com.tangem.tap.proxy.AppStateHolder
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
|
|
@ -18,4 +22,16 @@ class AuthModule {
|
|||
fun provideAuthProvider(appStateHolder: AppStateHolder): AuthProvider {
|
||||
return AuthProviderImpl(appStateHolder)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideExpressAuthProvider(
|
||||
userWalletsStore: UserWalletsStore,
|
||||
configManager: ConfigManager,
|
||||
): ExpressAuthProvider {
|
||||
return ExpressAuthProviderImpl(
|
||||
userWalletsStore = userWalletsStore,
|
||||
configManager = configManager
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -106,6 +106,7 @@ internal class ConfigManagerImpl @Inject constructor() : ConfigManager {
|
|||
swapReferrerAccount = configValues.swapReferrerAccount,
|
||||
walletConnectProjectId = configValues.walletConnectProjectId,
|
||||
tangemComAuthorization = configValues.tangemComAuthorization,
|
||||
tangemExpressApiKey = configValues.tangemExpressApiKey
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -19,4 +19,5 @@ data class Config(
|
|||
val swapReferrerAccount: SwapReferrerAccount? = null,
|
||||
val walletConnectProjectId: String = "",
|
||||
val tangemComAuthorization: String? = null,
|
||||
val tangemExpressApiKey: String = ""
|
||||
)
|
||||
|
|
@ -40,6 +40,7 @@ class ConfigValueModel(
|
|||
val tangemComAuthorization: String?,
|
||||
val chiaFireAcademyApiKey: String?,
|
||||
val chiaTangemApiKey: String?,
|
||||
val tangemExpressApiKey: String,
|
||||
)
|
||||
|
||||
data class AppsFlyer(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.tangem.lib.auth
|
||||
package com.tangem.lib.auth.sessionId
|
||||
|
||||
interface ExpressSessionIdGenerator {
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue