diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/Dockerfile b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/Dockerfile index 28a25d9fd..9fa8adf24 100644 --- a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/Dockerfile +++ b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/Dockerfile @@ -6,9 +6,9 @@ ENV JAVA_OPTS=$JAVA_OPTS ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} basyxExecutable.jar -COPY src/main/resources/application.yml application.yml -COPY src/main/resources/application-MongoDB.yml application-MongoDB.yml -COPY src/main/resources/application-InMemory.yml application-InMemory.yml +COPY src/main/resources/application.properties application.properties +COPY src/main/resources/application-MongoDB.properties application-MongoDB.properties +COPY src/main/resources/application-InMemory.properties application-InMemory.properties ARG PORT=8081 ENV SERVER_PORT=${PORT} diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/java/org/eclipse/digitaltwin/basyx/digitaltwinregistry/component/DigitalTwinRegistry.java b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/java/org/eclipse/digitaltwin/basyx/digitaltwinregistry/component/DigitalTwinRegistry.java index e36029bb2..04d2e3fa9 100644 --- a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/java/org/eclipse/digitaltwin/basyx/digitaltwinregistry/component/DigitalTwinRegistry.java +++ b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/java/org/eclipse/digitaltwin/basyx/digitaltwinregistry/component/DigitalTwinRegistry.java @@ -98,7 +98,15 @@ @ComponentScan.Filter( type = FilterType.ASSIGNABLE_TYPE, value = org.eclipse.digitaltwin.basyx.aasdiscoveryservice.http.documentation.AasDiscoveryServiceApiDocumentationConfiguration.class - ) + ), + @ComponentScan.Filter( + type = FilterType.ASSIGNABLE_TYPE, + value = org.eclipse.digitaltwin.basyx.authorization.rbac.KeycloakRoleProvider.class + ), + @ComponentScan.Filter( + type = FilterType.ASSIGNABLE_TYPE, + value = org.eclipse.digitaltwin.basyx.authorization.KeycloakSubjectInformationProvider.class + ), } ) public class DigitalTwinRegistry { diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.properties b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.properties new file mode 100644 index 000000000..331556aa2 --- /dev/null +++ b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.properties @@ -0,0 +1,7 @@ +basyx.backend=InMemory +registry.type=InMemory +registry.discovery.enabled=true + +spring.config.activate.on-profile=InMemory + +spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration,org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration \ No newline at end of file diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.yml b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.yml deleted file mode 100644 index b661f2987..000000000 --- a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-InMemory.yml +++ /dev/null @@ -1,17 +0,0 @@ -spring: - config: - activate: - on-profile: InMemory - autoconfigure: - exclude: - - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration - - org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration - - -basyx: - backend: InMemory - -registry: - type: InMemory - discovery: - enabled: true \ No newline at end of file diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.properties b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.properties new file mode 100644 index 000000000..3df8a9ae1 --- /dev/null +++ b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.properties @@ -0,0 +1,11 @@ +basyx.backend=MongoDB +basyx.aasdiscoveryservice.mongodb.collectionName=${AUTHENTICATION_DATABASE:db-name} +registry.type=MongoDB +registry.discovery.enabled=true +spring.config.activate.on-profile=MongoDB +spring.data.mongodb.authentication-database=${AUTHENTICATION_DATABASE:db-name} +spring.data.mongodb.database=${AUTHENTICATION_DATABASE:db-name} +spring.data.mongodb.host=${DATABASE_HOST:localhost} +spring.data.mongodb.port=${DATABASE_PORT:27017} +spring.data.mongodb.username=${DATABASE_USERNAME:db-username} +spring.data.mongodb.password=${DATABASE_PASSWORD:db-password} diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.yml b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.yml deleted file mode 100644 index 2a14ad337..000000000 --- a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application-MongoDB.yml +++ /dev/null @@ -1,25 +0,0 @@ -spring: - config: - activate: - on-profile: MongoDB - data: - mongodb: - authentication-database: ${AUTHENTICATION_DATABASE:db-name} - database: ${AUTHENTICATION_DATABASE:db-name} - host: ${DATABASE_HOST:localhost} - port: ${DATABASE_PORT:27017} - username: ${DATABASE_USERNAME:db-username} - password: ${DATABASE_PASSWORD:db-password} - -basyx: - backend: MongoDB - aasdiscoveryservice: - mongodb: - collectionName: ${AUTHENTICATION_DATABASE:db-name} - - - -registry: - type: MongoDB - discovery: - enabled: true \ No newline at end of file diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.properties b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.properties new file mode 100644 index 000000000..81c4dacde --- /dev/null +++ b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.properties @@ -0,0 +1,21 @@ +spring.application.name=BaSyx Digital Twin Registry +spring.profiles.active=logEvents,${SPRING_PROFILE:InMemory} +spring.main.allow-bean-definition-overriding=true +basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD +basyx.cors.allowed-origins=* +basyx.feature.authorization.enabled=false +basyx.feature.authorization.type=rbac +basyx.feature.authorization.jwtBearerTokenProvider=keycloak +basyx.feature.authorization.rbac.file=file:/file/rbac_rules.json +basyx.aasregistry.feature.discoveryintegration.enabled=true +basyx.aasregistry.feature.discoveryintegration.baseUrl=http://localhost:8081 +basyx.endpoints.web.exposure.include=health,metrics,mappings +description.profiles=https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001, https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002, https://admin-shell.io/aas/API/3/0/DiscoveryServiceSpecification/SSP-001 +logging.level.root=${LOGGING_LEVEL:INFO} +logging.level.org.eclipse.digitaltwin.basyx=${LOGGING_LEVEL:INFO} +server.port=8081 +spring.security.oauth2.resourceserver.jwt.issuer-uri=https://dummy/realms/BaSyx +springdoc.api-docs.enabled=true +springdoc.swagger-ui.enabled=true +springdoc.swagger-ui.path=/swagger-ui.html +springdoc.swagger-ui.csrf.enabled=false diff --git a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.yml b/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.yml deleted file mode 100644 index c84a8fafc..000000000 --- a/basyx.aasdigitaltwinregistry/basyx.digitaltwinregistry.component/src/main/resources/application.yml +++ /dev/null @@ -1,48 +0,0 @@ -basyx: - aasdiscoveryservice: - cors: - allowed-methods: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD - allowed-origins: '*' - - - aasregistry: - feature: - discoveryintegration: - enabled: true - baseUrl: http://localhost:8081 - - endpoints: - web: - exposure: - include: health,metrics,mappings - -server: - port: 8081 - -spring: - profiles: - active: logEvents,${SPRING_PROFILE:InMemory} - main: - allow-bean-definition-overriding: true - application: - name: BaSyx Digital Twin Registry - - -description: - profiles: https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001, - https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002, - https://admin-shell.io/aas/API/3/0/DiscoveryServiceSpecification/SSP-001 - -logging: - level: - root: ${LOGGING_LEVEL:INFO} - org.eclipse.digitaltwin.basyx: ${LOGGING_LEVEL:INFO} - -springdoc: - api-docs: - enabled: true - swagger-ui: - enabled: true - path: /swagger-ui.html - csrf: - enabled: false \ No newline at end of file