Skip to content

Commit

Permalink
Fjerner oppbønning av UnleashService i FeatureToggleConfig for å kunn…
Browse files Browse the repository at this point in the history
…e bruke Unleash enabled switch til å disable
  • Loading branch information
throndi committed Sep 28, 2023
1 parent 55c361a commit 2e55e59
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,14 @@ package no.nav.familie.klage.infrastruktur.config
import io.getunleash.strategy.Strategy
import no.nav.familie.klage.infrastruktur.featuretoggle.ByEnvironmentStrategy
import no.nav.familie.klage.infrastruktur.featuretoggle.ByUserIdStrategy
import no.nav.familie.unleash.DefaultUnleashService
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class FeatureToggleConfig(
@Value("\${UNLEASH_SERVER_API_URL}") private val apiUrl: String,
@Value("\${UNLEASH_SERVER_API_TOKEN}") private val apiToken: String,
@Value("\${NAIS_APP_NAME}") private val appName: String,
) {
class FeatureToggleConfig {

@Bean
fun strategies(): List<Strategy> {
return listOf(ByUserIdStrategy(), ByEnvironmentStrategy())
}

@Bean
fun defaultUnleashService(strategies: List<Strategy>): DefaultUnleashService {
return DefaultUnleashService(apiUrl, apiToken, appName, strategies)
}
}

0 comments on commit 2e55e59

Please sign in to comment.