diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/config/CustomJwtAuthenticationConverter.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/config/CustomJwtAuthenticationConverter.kt index d05dd3ea1..d25e76f7a 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/config/CustomJwtAuthenticationConverter.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/config/CustomJwtAuthenticationConverter.kt @@ -52,7 +52,7 @@ import java.util.stream.Collectors * } * */ -class CustomJwtAuthenticationConverter(private val resourceId: String, private val requiredBpn: String? = null) : Converter { +class CustomJwtAuthenticationConverter(private val resourceId: String, private val requiredBpn: String = "") : Converter { private val defaultGrantedAuthoritiesConverter = JwtGrantedAuthoritiesConverter() override fun convert(source: Jwt): AbstractAuthenticationToken { @@ -63,8 +63,8 @@ class CustomJwtAuthenticationConverter(private val resourceId: String, private v @Suppress("UNCHECKED_CAST") companion object { - private fun extractResourceRoles(jwt: Jwt, resourceId: String, requiredBpn: String? = null): Collection { - if (requiredBpn != null && requiredBpn != jwt.claims["bpn"]) { + private fun extractResourceRoles(jwt: Jwt, resourceId: String, requiredBpn: String = ""): Collection { + if (requiredBpn.isNotBlank() && requiredBpn != jwt.claims["bpn"]) { return emptyList() } diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/config/BpnConfigProperties.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/config/BpnConfigProperties.kt index aad99a3c4..4c0a94352 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/config/BpnConfigProperties.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/config/BpnConfigProperties.kt @@ -27,5 +27,5 @@ data class BpnConfigProperties( val agencyName: String = "Catena-X", var name: String = "Business Partner Number", val id: String = "CX_BPN", - val ownerBpnL: String? = null + val ownerBpnL: String = "" ) \ No newline at end of file diff --git a/bpdm-gate/src/main/resources/application.yml b/bpdm-gate/src/main/resources/application.yml index a93dc798b..3107e2e34 100644 --- a/bpdm-gate/src/main/resources/application.yml +++ b/bpdm-gate/src/main/resources/application.yml @@ -31,7 +31,8 @@ bpdm: agency-name: Catena-X id: CX_BPN name: Business Partner Number - owner-bpn-l: '# Insert owner BPNL here' + # Insert owner BPNL here + owner-bpn-l: api: upsert-limit: 100