Skip to content

Commit

Permalink
Fix whitelist config read
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchosiax committed Dec 5, 2023
1 parent 602efad commit 3c58f37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ class UserManagementResource(private val session: KeycloakSession) : RealmResour
private val forgotUrl by lazy {
ApplicationContextHolder.getCurrentContext()!!.environment.resolvePlaceholders("\${forgot-redirect-url}")
}
private val registerWhitelistIsEnable by lazy {
ApplicationContextHolder.getCurrentContext()!!.environment.resolvePlaceholders("\${app.whitelist.register.enabled}")
}
private val kafkaTemplate by lazy {
ApplicationContextHolder.getCurrentContext()!!.getBean("authKafkaTemplate") as KafkaTemplate<String, AuthEvent>
}

@Value("\${app.whitelist.register.enable}")
private var registerWhitelistIsEnable: Boolean? = true

@POST
@Path("user")
@Consumes(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package co.nilin.opex.auth.gateway.providers

import co.nilin.opex.auth.gateway.ApplicationContextHolder
import co.nilin.opex.auth.gateway.model.WhiteListModel
import co.nilin.opex.utility.error.data.OpexError
import co.nilin.opex.utility.error.data.OpexException
Expand All @@ -22,16 +23,16 @@ import java.util.stream.Collectors
import javax.persistence.EntityManager
import javax.ws.rs.core.Response

class CustomOIDCProtocolMapper() : AbstractOIDCProtocolMapper(), OIDCAccessTokenMapper, OIDCIDTokenMapper,
class CustomOIDCProtocolMapper : AbstractOIDCProtocolMapper(), OIDCAccessTokenMapper, OIDCIDTokenMapper,
UserInfoTokenMapper {
private val logger = LoggerFactory.getLogger(CustomOIDCProtocolMapper::class.java)

private val PROVIDER_ID = "oidc-customprotocolmapper"
private val configProperties: List<ProviderConfigProperty> = ArrayList()

@Value("\${app.whitelist.login.enable}")
private var loginWhitelistIsEnable: Boolean? = true

private val loginWhitelistIsEnable by lazy {
ApplicationContextHolder.getCurrentContext()!!.environment.resolvePlaceholders("\${app.whitelist.login.enabled}")
}

override fun getConfigProperties(): List<ProviderConfigProperty>? {
return configProperties
Expand Down

0 comments on commit 3c58f37

Please sign in to comment.