Updated on 2026-08-14
This commit is contained in:
parent
982bd4130e
commit
122d654f29
5 changed files with 5 additions and 44 deletions
|
|
@ -9,8 +9,8 @@ import com.tangem.datasource.utils.RequestHeader.*
|
|||
import com.tangem.datasource.utils.addHeaders
|
||||
import com.tangem.datasource.utils.addLazyHeaders
|
||||
import com.tangem.datasource.utils.allowLogging
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.lib.auth.BuildConfig
|
||||
import com.tangem.lib.auth.LazyAuthProvider
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
|
|
@ -63,7 +63,7 @@ class NetworkModule {
|
|||
@Provides
|
||||
@Singleton
|
||||
@PromotionOneInch
|
||||
fun providePromotionOneInchApi(authProvider: LazyAuthProvider, @NetworkMoshi moshi: Moshi): PromotionApi {
|
||||
fun providePromotionOneInchApi(authProvider: AuthProvider, @NetworkMoshi moshi: Moshi): PromotionApi {
|
||||
val okClient = OkHttpClient.Builder()
|
||||
.addLazyHeaders(
|
||||
LazyRequestHeader.LazyAuthenticationHeader(authProvider),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.tangem.datasource.utils
|
||||
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.lib.auth.LazyAuthProvider
|
||||
|
||||
/**
|
||||
* Presentation of request header
|
||||
|
|
@ -25,8 +24,8 @@ sealed class LazyRequestHeader(vararg pairs: Pair<String, () -> String>) {
|
|||
|
||||
val values: List<Pair<String, () -> String>> = pairs.toList()
|
||||
|
||||
class LazyAuthenticationHeader(authProvider: LazyAuthProvider) : LazyRequestHeader(
|
||||
"card_id" to authProvider.getCardIdProvider(),
|
||||
"card_public_key" to authProvider.getCardPublicKeyProvider(),
|
||||
class LazyAuthenticationHeader(authProvider: AuthProvider) : LazyRequestHeader(
|
||||
"card_id" to { authProvider.getCardId() },
|
||||
"card_public_key" to { authProvider.getCardPublicKey() },
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue