Skip to content

Commit

Permalink
Adds integrity shared dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmuvi-stripe committed Dec 23, 2024
1 parent f49fde3 commit a153a66
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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

/**
Expand Down Expand Up @@ -32,6 +38,7 @@ internal object FinancialConnectionsSingletonSharedComponentHolder {
@Component(modules = [FinancialConnectionsSingletonSharedModule::class])
internal interface FinancialConnectionsSingletonSharedComponent {

fun providesIntegrityRequestManager(): IntegrityRequestManager

@Component.Builder
interface Builder {
Expand All @@ -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)
)
}

0 comments on commit a153a66

Please sign in to comment.