Skip to content

Commit

Permalink
Merge pull request #655 from catenax-ng/refactor/properties_structure
Browse files Browse the repository at this point in the history
Refactor (bpdm) - Creation of Auth YML's and Path changes
  • Loading branch information
nicoprow authored Jan 11, 2024
2 parents c81d08b + 0fc7fa9 commit 3d5a9c6
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Configuration

@Configuration
@ConfigurationProperties(prefix = "bpdm.bridge")
@ConfigurationProperties(prefix = "bpdm.bridge.permissions")
class BridgeAuthProperties {
var syncAuthorities: List<String> = listOf()

Expand Down
35 changes: 23 additions & 12 deletions bpdm-bridge-dummy/src/main/resources/application-auth.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
bpdm:
# Security config (defined in common) for restricting access to the bridge dummy resource server
bridge:
syncAuthorities: sync_company_data
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

# OAuth2 authorized connection to Pool and Gate client
client:
gate:
oauth2-client-registration: bridge-client
security-enabled: true
pool:
oauth2-client-registration: bridge-client
security-enabled: true
bpdm:
permissions:
# Security config (defined in common) for restricting access to the bridge dummy resource server
bridge:
syncAuthorities: sync_company_data

security:
# Security config (defined in common) for restricting access to the bridge dummy resource server
Expand Down
41 changes: 41 additions & 0 deletions bpdm-bridge-dummy/src/main/resources/application-gate-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################


bpdm:
client:
gate:
oauth2-client-registration: gate-client
security-enabled: true

spring:
security:
oauth2:
client:
provider:
gate-oauth2-provider:
issuer-uri: ${bpdm.security.auth-server-url:http://localhost:8180}/realms/${bpdm.security.realm:master}
registration:
gate-client:
authorization-grant-type: client_credentials
client-id: ${bpdm.security.client-id}
client-secret: ${bpdm.security.credentials.secret}
provider: gate-oauth2-provider


38 changes: 38 additions & 0 deletions bpdm-bridge-dummy/src/main/resources/application-pool-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

bpdm:
client:
pool:
oauth2-client-registration: pool-client
security-enabled: true

spring:
security:
oauth2:
client:
provider:
pool-oauth2-provider:
issuer-uri: ${bpdm.security.auth-server-url:http://localhost:8180}/realms/${bpdm.security.realm:master}
registration:
pool-client:
authorization-grant-type: client_credentials
client-id: ${bpdm.security.client-id}
client-secret: ${bpdm.security.credentials.secret}
provider: pool-oauth2-provider
19 changes: 19 additions & 0 deletions bpdm-bridge-dummy/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

# Change default port
server:
port: 8081
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

bpdm:
client:
orchestrator:
base-url: http://localhost:8085/
security:
enabled: true

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class OrchestratorMappings(
postalCode = entity.postalCode,
city = entity.city,
district = entity.district,
street = entity.street?.let(this::toStreetDto),
street = entity.street?.let(::toStreetDto),
companyPostalCode = entity.companyPostalCode,
industrialZone = entity.industrialZone,
building = entity.building,
Expand Down
39 changes: 39 additions & 0 deletions bpdm-gate/src/main/resources/application-orchestrator-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

bpdm:
client:
orchestrator:
security-enabled: true
orchestrator-security:
oauth2-client-registration: orchestrator-client

spring:
security:
oauth2:
client:
provider:
orchestrator-oauth2-provider:
issuer-uri: ${bpdm.security.auth-server-url:http://localhost:8180}/realms/${bpdm.security.realm:master}
registration: # Note that the oauth2-client-registration property is NOT the client id of the gate in keycloak
orchestrator-client:
authorization-grant-type: client_credentials
client-id: ${bpdm.security.client-id}
client-secret: ${bpdm.security.credentials.secret}
provider: orchestrator-oauth2-provider
8 changes: 4 additions & 4 deletions bpdm-gate/src/main/resources/application-pool-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ bpdm:
pool:
security-enabled: true
gate-security:
oauth2-client-registration: gate-client
oauth2-client-registration: pool-client

spring:
security:
oauth2:
client:
provider:
catena-keycloak-provider:
pool-oauth2-provider:
issuer-uri: ${bpdm.security.auth-server-url:http://localhost:8180}/realms/${bpdm.security.realm:master}
registration: # Note that the oauth2-client-registration property is NOT the client id of the gate in keycloak
gate-client:
pool-client:
authorization-grant-type: client_credentials
client-id: ${bpdm.security.client-id}
client-secret: ${bpdm.security.credentials.secret}
provider: catena-keycloak-provider
provider: pool-oauth2-provider
19 changes: 19 additions & 0 deletions bpdm-orchestrator/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

# Default port
server:
port: 8085
Expand Down
1 change: 1 addition & 0 deletions bpdm-pool/src/main/resources/application-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bpdm:
changePoolPartnerData: change_pool_partner_data
readMetaData: read_meta_data
readPoolPartnerData: read_pool_partner_data

security:
auth-server-url: http://localhost:8180
auth-url: ${bpdm.security.auth-server-url}/realms/${bpdm.security.realm}/protocol/openid-connect/auth
Expand Down
37 changes: 37 additions & 0 deletions bpdm-pool/src/main/resources/application-orchestrator-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

bpdm:
client:
orchestrator:
security-enabled: true

spring:
security:
oauth2:
client:
provider:
orchestrator-oauth2-provider:
issuer-uri: ${bpdm.security.auth-server-url:http://localhost:8180}/realms/${bpdm.security.realm:master}
registration: # Note that the oauth2-client-registration property is NOT the client id of the gate in keycloak
gate-client:
authorization-grant-type: client_credentials
client-id: ${bpdm.security.client-id}
client-secret: ${bpdm.security.credentials.secret}
provider: orchestrator-oauth2-provider

0 comments on commit 3d5a9c6

Please sign in to comment.