Skip to content

Commit

Permalink
Merge pull request #897 from eclipse-tractusx/fix/orchestrator-permis…
Browse files Browse the repository at this point in the history
…sions

fix(Orchestrator): permission names and structure in the configuration
  • Loading branch information
nicoprow authored May 6, 2024
2 parents afd30c7 + 73730fd commit 383452f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties
data class PermissionConfigProperties(
val createTask: String = "create_task",
val readTask: String = "read_task",
val reservations: TaskStepProperties = TaskStepProperties(
val reservation: TaskStepProperties = TaskStepProperties(
clean = "create_reservation_clean",
cleanAndSync = "create_reservation_cleanAndSync",
poolSync = "create_reservation_poolSync"
),
val results: TaskStepProperties = TaskStepProperties(
val result: TaskStepProperties = TaskStepProperties(
clean = "create_result_clean",
cleanAndSync = "create_result_cleanAndSync",
poolSync = "create_result_poolSync"
Expand All @@ -54,12 +54,12 @@ data class PermissionConfigProperties(

@Suppress("unused")
fun createReservation(step: TaskStep): String{
return fetchStepPermission(step, reservations)
return fetchStepPermission(step, reservation)
}

@Suppress("unused")
fun createResult(step: TaskStep): String{
return fetchStepPermission(step, results)
return fetchStepPermission(step, result)
}


Expand Down
27 changes: 10 additions & 17 deletions bpdm-orchestrator/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,24 @@ bpdm:
# URL to the token validation endpoint of the Keycloak server
token-url: ${bpdm.security.auth-server-url}/realms/${bpdm.security.realm}/protocol/openid-connect/token
permissions:
task:
# Name of permission to create golden record tasks
create: create_task
# Name of permission to read task status and overall results
read: read_task
# Name of permission to create golden record tasks
createTask: create_task
# Name of permission to read task status and overall results
readTask: read_task
reservation:
clean:
# Name of permission to create reservations for tasks in step 'Clean'
create: create_reservation_clean
cleanAndSync:
clean: create_reservation_clean
# Name of permission to create reservations for tasks in step 'CleanAndSync'
create: create_reservation_cleanAndSync
poolSync:
cleanAndSync: create_reservation_cleanAndSync
# Name of permission to create reservations for tasks in step 'PoolSync'
create: create_reservation_poolSync
poolSync: create_reservation_poolSync
result:
clean:
# Name of permission to post results for tasks in step 'Clean'
create: create_result_clean
cleanAndSync:
clean: create_result_clean
# Name of permission to post results for tasks in step 'CleanAndSync'
create: create_result_cleanAndSync
poolSync:
cleanAndSync: create_result_cleanAndSync
# Name of permission to post results for tasks in step 'PoolSync'
create: create_result_poolSync
poolSync: create_result_poolSync

server:
# Change default port to avoid clash with other BPDM applications
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<kotlinlogging.version>3.0.5</kotlinlogging.version>
<wiremock.version>2.35.2</wiremock.version>
<springmockk.version>4.0.2</springmockk.version>
<assertj.version>3.25.3</assertj.version>
<assertj.version>3.24.2</assertj.version>
<spring-boot.version>3.0.4</spring-boot.version>
<sonar.organization>catenax-ng</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down

0 comments on commit 383452f

Please sign in to comment.