From a153a66719a49c5b077dcda8359cb4e16c724f70 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Date: Mon, 23 Dec 2024 13:21:04 +0100 Subject: [PATCH] Adds integrity shared dependency. --- ...nnectionsSingletonSharedComponentHolder.kt | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSingletonSharedComponentHolder.kt b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSingletonSharedComponentHolder.kt index 80dbcaed9b1..0a151dd3d75 100644 --- a/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSingletonSharedComponentHolder.kt +++ b/financial-connections/src/main/java/com/stripe/android/financialconnections/di/FinancialConnectionsSingletonSharedComponentHolder.kt @@ -1,9 +1,15 @@ package com.stripe.android.financialconnections.di import android.app.Application +import com.stripe.android.core.Logger +import com.stripe.attestation.BuildConfig +import com.stripe.attestation.IntegrityRequestManager +import com.stripe.attestation.IntegrityStandardRequestManager +import com.stripe.attestation.RealStandardIntegrityManagerFactory import dagger.BindsInstance import dagger.Component import dagger.Module +import dagger.Provides import javax.inject.Singleton /** @@ -32,6 +38,7 @@ internal object FinancialConnectionsSingletonSharedComponentHolder { @Component(modules = [FinancialConnectionsSingletonSharedModule::class]) internal interface FinancialConnectionsSingletonSharedComponent { + fun providesIntegrityRequestManager(): IntegrityRequestManager @Component.Builder interface Builder { @@ -43,4 +50,15 @@ internal interface FinancialConnectionsSingletonSharedComponent { } @Module -internal class FinancialConnectionsSingletonSharedModule +internal class FinancialConnectionsSingletonSharedModule { + + @Provides + @Singleton + fun providesIntegrityStandardRequestManager( + context: Application + ): IntegrityRequestManager = IntegrityStandardRequestManager( + cloudProjectNumber = 527113280969, // stripe-financial-connections + logError = { message, error -> Logger.getInstance(BuildConfig.DEBUG).error(message, error) }, + factory = RealStandardIntegrityManagerFactory(context) + ) +}