### Run Docker Compose Example Setup Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md Navigate to the example directory and run this script to start the code-generator-jar and submodel-service using Docker Compose. ```bash cd example ./run-compose.sh ``` -------------------------------- ### Start BaSyx Containers Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxCADFiles/README.md Run this command to start the BaSyx containers for the CAD file integration example. Docker must be installed. ```bash docker-compose up -d ``` -------------------------------- ### Install Maven Jars Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/README.md Run this command to clean the project and install the generated JARs. ```shell mvn clean install ``` -------------------------------- ### Example Configuration with Authorization Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice-feature-registry-integration/Readme.md A comprehensive example demonstrating the configuration for registry integration with authorization enabled, including OAuth2 password grant details. ```properties basyx.submodelservice.feature.registryintegration=http://localhost:8060 basyx.externalurl=http://localhost:8081 basyx.submodelservice.feature.registryintegration.authorization.enabled=true basyx.submodelservice.feature.registryintegration.authorization.token-endpoint=http://auth-server/token basyx.submodelservice.feature.registryintegration.authorization.client-id=myClientId basyx.submodelservice.feature.registryintegration.authorization.client-secret=mySecret basyx.submodelservice.feature.registryintegration.authorization.username=user basyx.submodelservice.feature.registryintegration.authorization.password=pass ``` -------------------------------- ### Example Preconfiguration for Authorization Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasenvironment/basyx.aasenvironment-feature-authorization/Readme.md Example properties for preconfiguring the authorization environment, specifically for the CLIENT_CREDENTIALS grant type with Keycloak. ```properties basyx.aasenvironment.authorization.preconfiguration.token-endpoint = http://localhost:9096/realms/BaSyx/protocol/openid-connect/token basyx.aasenvironment.authorization.preconfiguration.grant-type = CLIENT_CREDENTIALS basyx.aasenvironment.authorization.preconfiguration.client-id = workstation-1 basyx.aasenvironment.authorization.preconfiguration.client-secret = nY0mjyECF60DGzNmQUjL81XurSl8etom ``` -------------------------------- ### Example Configuration for Registry Integration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/Readme.md An example of valid property values for enabling registry integration. ```properties basyx.aasrepository.feature.registryintegration = http://localhost:8050 basyx.externalurl = http://localhost:8081 ``` -------------------------------- ### Example Operation Implementation Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md An example Java class demonstrating how to implement the simplified invoke method. This specific example adds two properties and returns the result. ```java package org.basic; import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public class AddOperation { public OperationVariable[] invoke(OperationVariable[] in) { Property first = (Property) in[0].getValue(); Property second = (Property) in[1].getValue(); int result = Integer.parseInt(first.getValue()) + Integer.parseInt(second.getValue()); Property prop = new DefaultProperty.Builder().value(String.valueOf(result)).valueType(DataTypeDefXsd.INT).build(); return new OperationVariable[] { new DefaultOperationVariable.Builder().value(prop).build() }; } } ``` -------------------------------- ### Example Authorization Configuration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasenvironment/basyx.aasenvironment-feature-authorization/Readme.md An example of a valid configuration for enabling authorization with RBAC and Keycloak, including the JWT issuer URI. ```properties basyx.feature.authorization.enabled = true basyx.feature.authorization.type = rbac basyx.feature.authorization.jwtBearerTokenProvider = keycloak basyx.feature.authorization.rbac.file = classpath:rbac_rules.json spring.security.oauth2.resourceserver.jwt.issuer-uri= http://localhost:9096/realms/BaSyx ``` -------------------------------- ### Environment Variable Configuration Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/docs/Components.md Demonstrates how Spring configuration properties can be set via environment variables. Replace '.' with '_' and capitalize letters. ```bash Example: "basyx.backend" can be configured via the environment variable "BASYX_BACKEND". ``` -------------------------------- ### JSON RBAC Rule Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-authorization/Readme.md An example of an initial RBAC rule defined in JSON format. ```json { "role": "admin", "action": "DELETE", "targetInformation": { "@type": "aas-registry", "aasIds": "*" } } ``` -------------------------------- ### Example AAS Discovery Service Authorization Configuration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-feature-authorization/Readme.md An example configuration demonstrating how to enable RBAC authorization with Keycloak as the JWT provider. Ensure the issuer URI points to your Keycloak realm. ```json { "basyx.feature.authorization.enabled": true, "basyx.feature.authorization.type": "rbac", "basyx.feature.authorization.jwtBearerTokenProvider": "keycloak", "basyx.feature.authorization.rbac.file": "classpath:rbac_rules.json", "spring.security.oauth2.resourceserver.jwt.issuer-uri": "http://localhost:9096/realms/BaSyx" } ``` -------------------------------- ### Start BaSyx Containers with Docker Compose Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxKafka/README.md Use this command to launch all required BaSyx services in detached mode. Ensure you are in the project's root directory. ```bash docker compose up -d ``` -------------------------------- ### Run Docker Compose Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-hierarchy-example/Readme.md Execute this command to start the Docker containers for the root and delegated AAS Registries. ```bash docker compose up ``` -------------------------------- ### Automatic Rule Splitting Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-authorization/Readme.md Demonstrates how a rule with multiple actions is split into individual rules, each with a single action. This is useful for simplifying rule management. ```json { "role": "admin", "action": ["CREATE", "READ"], "targetInformation": { "@type": "aas-registry", "aasIds": "*" } } ``` ```json { "role": "admin", "action": "CREATE", "targetInformation": { "@type": "aas-registry", "aasIds": "*" } }, { "role": "admin", "action": "READ", "targetInformation": { "@type": "aas-registry", "aasIds": "*" } } ``` -------------------------------- ### Build Docker Images with Maven Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/docs/Developer.md Use this Maven command to build Docker images for BaSyx components and execute integration tests. Ensure the docker compose file in the repository root is started. ```bash mvn clean install -Ddocker.namespace=eclipsebasyx ``` -------------------------------- ### Automatic Rule Splitting Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/basyx.aasrepository-feature-authorization/Readme.md Demonstrates how a rule with multiple actions is automatically split into separate rules, each with a single action. This is useful for simplifying rule management. ```json { "role": "admin", "action": ["CREATE", "READ"], "targetInformation": { "@type": "aas", "aasIds": "*" } } ``` ```json { "role": "admin", "action": "CREATE", "targetInformation": { "@type": "aas", "aasIds": "*" } } ``` ```json { "role": "admin", "action": "READ", "targetInformation": { "@type": "aas", "aasIds": "*" } } ``` -------------------------------- ### RBAC Rule Configuration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-feature-authorization/Readme.md Structure and examples for configuring RBAC rules in a JSON file. ```APIDOC ## RBAC Rule Configuration RBAC rules should be configured in a JSON file as follows: ```json [ { "role": "basyx-assetid-creator", "action": "CREATE", "targetInformation": { "@type": "aas-discovery-service", "aasIds": "*", "assetIds": [] } }, { "role": "basyx-assetid-discoverer", "action": "READ", "targetInformation": { "@type": "aas-discovery-service", "aasIds": ["AasId1", "AasId2"], "assetIds": [] } }, { "role": "basyx-assetid-deleter", "action": "DELETE", "targetInformation": { "@type": "aas-discovery-service", "aasIds": "AasId1", "assetIds": [] } }, { "role": "basyx-aas-discoverer-all", "action": "READ", "targetInformation": { "@type": "aas-discovery-service", "aasIds": null, "assetIds": [ { "name": "*", "value": "*" } ] } }, { "role": "basyx-aas-discoverer-specific", "action": "READ", "targetInformation": { "@type": "aas-discovery-service", "aasIds": null, "assetIds": [ { "name": "assetName1", "value": "assetValue1" }, { "name": "assetName2", "value": "assetValue2" } ] } } ] ``` The `role` defines which role is allowed to perform the defined actions. The `action` can be CREATE, READ, DELETE, and the `targetInformation` provides coarse-grained control over the resource. You may define the `aasIds` and `assetIds` with a wildcard (*), which means the defined role with action can perform operations on all AASs and Assets. You can also define specific `aasIds` and `assetIds`. **Special Configuration Notes:** - The wildcard `*` for `assetIds` must be inserted in both the `name` and `value` to indicate non-specific filtering for the `READ` endpoint on `/lookup/shells`. ``` -------------------------------- ### Run Submodel Service with Docker Compose Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/example/Readme.md Starts the Submodel Service Component using Docker Compose. This mode allows for dynamic compilation of Java sources during startup. ```bash ./run-compose.sh ``` -------------------------------- ### Run Submodel Repository Docker Container Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelrepository/Readme.md This command starts the Submodel Repository Docker container, mapping port 8081 and mounting a custom application properties file. Ensure the path 'C:/tmp/application.properties' exists and is accessible. ```bash docker run --name=sm-repo -p:8081:8081 -v C:/tmp/application.properties:/application/application.properties eclipsebasyx/submodel-repository:2.0.0-SNAPSHOT ``` -------------------------------- ### JSON RBAC Rule Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/basyx.aasrepository-feature-authorization/Readme.md An example of an RBAC rule defined in JSON format, which can be automatically adapted and stored in a Security Submodel. ```json { "role": "admin", "action": "DELETE", "targetInformation": { "@type": "aas", "aasIds": "*" } } ``` -------------------------------- ### Query Concept Description Repository Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxQueryLanguage/README.md This JSON query retrieves all Concept Descriptions that have an English description ('en-us'), a revision equal to 9, and 'acplt' within their isCaseOf field. ```json { "$condition": { "$match": [ { "$eq": [ { "$field": "$cd#description[].language" }, { "$strVal": "en-us" } ] }, { "$eq": [ { "$numCast": { "$field": "$cd#administration.revision" } }, { "$numVal": 9 } ] }, { "$contains": [ { "$field": "$cd#isCaseOf.keys[]" }, { "$strVal": "acplt" } ] } ] } } ``` -------------------------------- ### Run HierarchicalAasRegistryIT Test Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-hierarchy-example/Readme.md This is the integration test class that executes the hierarchical registry scenario. Ensure all modules are installed locally before running. ```java /src/test/java/org/eclipse/digitaltwin/basyx/aasregistry/feature/hierarchy/example/HierachicalAasRegistryIT.java ``` -------------------------------- ### Run Standalone Submodel Service Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/example/Readme.md Executes the standalone mode for the Submodel Service Component, building and running a preconfigured Docker image. Use this for a quick setup. ```bash ./run-standalone.sh ``` -------------------------------- ### RBAC Rule Configuration Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository-feature-authorization/Readme.md Define RBAC rules in a JSON file. Each rule specifies a role, an action (or list of actions), and target information for accessing Concept Descriptions. Wildcards can be used for broad access, or specific Concept Description IDs for granular control. ```json [ { "role": "basyx-reader", "action": "READ", "targetInformation": { "@type": "concept-description", "conceptDescriptionIds": "*" } }, { "role": "admin", "action": ["CREATE", "READ", "UPDATE", "DELETE"], "targetInformation": { "@type": "concept-description", "conceptDescriptionIds": "*" } }, { "role": "basyx-deleter", "action": "DELETE", "targetInformation": { "@type": "concept-description", "conceptDescriptionIds": "*" } }, { "role": "basyx-reader-two", "action": "READ", "targetInformation": { "@type": "concept-description", "conceptDescriptionIds": ["testCDId1","specificConceptDescriptionId","testCDId2"] } } ] ``` -------------------------------- ### RBAC Rule Configuration Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelregistry/basyx.submodelregistry-feature-authorization/Readme.md Define RBAC rules in a JSON file to specify role-based access control for Submodel Registry operations. Rules include role, action, and target information. ```json [ { "role": "basyx-reader", "action": "READ", "targetInformation": { "@type": "submodel-registry", "submodelId": "*" } }, { "role": "admin", "action": ["CREATE", "READ", "UPDATE", "DELETE"], "targetInformation": { "@type": "submodel-registry", "submodelId": "*" } }, { "role": "basyx-deleter", "action": "DELETE", "targetInformation": { "@type": "submodel-registry", "submodelId": "specificSubmodelId" } } ] ``` -------------------------------- ### Configure Allowed CORS Methods Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/docs/Components.md Define the comma-separated list of HTTP methods allowed for Cross-Site Resource Sharing. Defaults to GET,HEAD,POST if not specified. ```properties basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD ``` -------------------------------- ### RBAC Rule Configuration Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelrepository/basyx.submodelrepository-feature-authorization/Readme.md Defines RBAC rules for authorization. Each rule specifies a role, allowed actions (single or list), and target information for Submodels and Submodel Elements. Wildcards (*) can be used for broad access. ```json [ { "role": "basyx-reader", "action": "READ", "targetInformation": { "@type": "submodel", "submodelIds": "*", "submodelElementIdShortPaths": "*" } }, { "role": "admin", "action": ["CREATE", "READ", "UPDATE", "DELETE", "EXECUTE"], "targetInformation": { "@type": "submodel", "submodelIds": "*", "submodelElementIdShortPaths": "*" } }, { "role": "basyx-reader-two", "action": "READ", "targetInformation": { "@type": "submodel", "submodelIds": "specificSubmodelId", "submodelElementIdShortPaths": "*" } }, { "role": "basyx-sme-reader", "action": "READ", "targetInformation": { "@type": "submodel", "submodelIds": ["specificSubmodelId", "testSMId1", "testSMId2"], "submodelElementIdShortPaths": ["testSMEIdShortPath1","smc2.specificSubmodelElementIdShort","testSMEIdShortPath2"] } } ] ``` -------------------------------- ### Simple RBAC Rule Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-authorization/Readme.md Defines an RBAC rule granting the 'admin' role permission to perform the 'READ' action on all resources of type 'aas-registry'. ```json { "role": "admin", "action": "READ", "targetInformation": { "@type": "aas-registry", "aasIds": "*" } } ``` -------------------------------- ### Query Submodel Repository Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxQueryLanguage/README.md This JSON query retrieves all Submodels that meet the following conditions: kind is 'Instance', revision is equal to 9, version is not equal to revision, and semanticId contains 'SubmodelTemplates'. ```json { "$condition": { "$and": [ { "$eq": [ { "$field": "$sm#kind" }, { "$strVal": "Instance" } ] }, { "$eq": [ { "$numCast": { "$field": "$sm#administration.revision" } }, { "$numVal": 9 } ] }, { "$ne": [ { "$field": "$sm#administration.version" }, { "$field": "$sm#administration.revision" } ] }, { "$contains": [ { "$field": "$sm#semanticId.keys[]" }, { "$strVal": "SubmodelTemplates" } ] } ] } } ``` -------------------------------- ### Configure Allowed Methods for CORS Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/docs/Management_Endpoint.md Set a comma-separated list of HTTP methods allowed for CORS requests. Defaults to GET if not specified. Use '*' to allow all methods. ```properties management.endpoints.web.cors.allowed-methods= ``` -------------------------------- ### Simple RBAC Rule Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/basyx.aasrepository-feature-authorization/Readme.md This JSON defines a simple RBAC rule. It grants the 'admin' role permission to perform the 'READ' action on all resources of type 'aas' using a wildcard. ```json { "role": "admin", "action": "READ", "targetInformation": { "@type": "aas", "aasIds": "*" } } ``` -------------------------------- ### Build Project with Maven Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md Use this command to manually build the service and generate JAR files. ```bash mvn clean package ``` -------------------------------- ### Build Docker Image with Maven Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.example/Readme.md Use this Maven command to build the standalone submodel as a Docker image. Configure the Docker namespace using the -Ddocker.namespace property. ```bash mvn clean install -Ddocker.namespace=yournamespace ``` -------------------------------- ### List Docker Images Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/README.md Check the Docker images available on your system. ```shell docker images ... ``` -------------------------------- ### Build Docker Image with Namespace Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md Set the docker.namespace variable before building the Docker image. This command builds the JAR files and prepares the Docker image. ```bash export docker.namespace=my-docker-user mvn clean package -Ddocker.namespace=my-docker-user ``` -------------------------------- ### Configure Kafka Bootstrap Servers (Property) Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-service-kafka-events/Readme.md Set the Kafka bootstrap servers using a system property. This is required for the Kafka events implementation. ```properties -Dspring.kafka.bootstrap-servers=PLAINTEXT://kafka:29092 ``` -------------------------------- ### Run ConceptDescription Repository Docker Container Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.conceptdescriptionrepository/Readme.md Use this Docker command to run the ConceptDescription Repository. Ensure the volume mapping for application.properties is correct for your system. ```bash docker run --name=cd-repo -p:8081:8081 -v C:/tmp/application.properties:/application/application.properties eclipsebasyx/conceptdescription-repository:2.0.0-SNAPSHOT ``` -------------------------------- ### Example Request Body for Operation Delegation Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelrepository/basyx.submodelrepository-feature-operation-delegation/Readme.md This JSON structure represents a typical request body when delegating an operation. It includes details about the Submodel Element being operated on. ```json [ { "value": { "modelType": "Property", "value": "5", "valueType": "xs:int", "idShort": "int" } } ] ``` -------------------------------- ### Build Docker Images Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/README.md Build Docker images by specifying the Docker namespace and password. Tests are skipped during this process. ```shell MAVEN_OPS='-Xmx2048 -Xms1024' mvn clean install -DskipTests -Ddocker.namespace=eclipsebasyx -Ddocker.password="" ``` -------------------------------- ### Configure Kafka Bootstrap Servers (Environment Variable) Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-service-kafka-events/Readme.md Alternatively, set the Kafka bootstrap servers using an environment variable. This is an alternative to using system properties. ```env KAFKA_BOOTSTRAP_SERVERS=PLAINTEXT://kafka:29092 ``` -------------------------------- ### Deploy Docker Images and Maven Artifacts Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/README.md Deploy Docker images and Maven artifacts using specified registry, namespace, and password. Maven options for memory are also included. ```shell MAVEN_OPS='-Xmx2048 -Xms1024' mvn deploy -Ddocker.registry=docker.io -Ddocker.namespace=eclipsebasyx -Ddocker.password=pwd ``` -------------------------------- ### Example Persistent RBAC Rule (Submodel-based JSON) Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxDynamicRBAC/README.md This JSON represents a persistent RBAC rule structured as a Submodel element collection. It includes role, action, and target information. ```json { "modelType": "SubmodelElementCollection", "idShort": "YWRtaW5SRUFEb3JnLmVjbGlwc2UuZGlnaXRhbHR3aW4uYmFzeXguYWFzcmVwb3NpdG9yeS5mZWF0dXJlLmF1dGhvcml6YXRpb24uQWFzVGFyZ2V0SW5mb3JtYXRpb24=", "value": [ { "modelType": "Property", "value": "admin", "idShort": "role" }, { "modelType": "SubmodelElementList", "idShort": "action", "orderRelevant": true, "value": [ { "modelType": "Property", "value": "READ" } ] }, { "modelType": "SubmodelElementCollection", "idShort": "targetInformation", "value": [ { "modelType": "SubmodelElementList", "idShort": "aasIds", "orderRelevant": true, "value": [ { "modelType": "Property", "value": "*" } ] }, { "modelType": "Property", "value": "aas", "idShort": "@type" } ] } ] } ``` -------------------------------- ### Enable Registry Integration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/Readme.md Configure these properties to enable automatic integration of the Descriptor with the Registry during Shell creation and removal. ```properties basyx.aasrepository.feature.registryintegration = {AAS-Registry-Base-Url} basyx.externalurl = {AAS-Repo-Base-Url} ``` -------------------------------- ### Upload AAS Environment via Curl Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasenvironment/Readme.md Example curl command to upload an AASX file to the AAS Environment's upload endpoint. Ensure the 'Accept' header matches the file type being uploaded. ```bash curl --location 'http://localhost:8081/upload' \ --header 'Accept: application/asset-administration-shell-package' \ --form 'file=@"Sample.aasx"' ``` -------------------------------- ### InMemory RBAC Rules Configuration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-feature-authorization/Readme.md An example JSON array defining multiple RBAC rules for in-memory storage, including roles, actions, and target AAS IDs. Rules cannot be modified after application startup. ```json [ { "role": "basyx-reader", "action": "READ", "targetInformation": { "@type": "aas-registry", "aasIds": "*" } }, { "role": "admin", "action": ["CREATE", "READ", "UPDATE", "DELETE"], "targetInformation": { "@type": "aas-registry", "aasIds": "*" } }, { "role": "basyx-deleter", "action": "DELETE", "targetInformation": { "@type": "aas-registry", "aasIds": ["testAasId1", "specificAasId", "testAasId2"] } } ] ``` -------------------------------- ### Query AAS Repository Example Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/examples/BaSyxQueryLanguage/README.md This JSON query retrieves all AAS that match specific criteria: idShort containing 'Test', revision less than 11, globalAssetId not equal to assetKind, or including a submodel with idShort 'BillOfMaterial'. ```json { "$condition": { "$or": [ { "$contains": [ { "$field": "$aas#idShort" }, { "$strVal": "Test" } ] }, { "$lt": [ { "$numCast": { "$field": "$aas#administration.revision" } }, { "$numVal": 11 } ] }, { "$ne": [ { "$field": "$aas#assetInformation.globalAssetId" }, { "$field": "$aas#assetInformation.assetKind" } ] }, { "$contains": [ { "$field": "$aas#submodels.keys[]" }, { "$strVal": "BillOfMaterial" } ] } ] } } ``` -------------------------------- ### Generate Docker Image Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelregistry/basyx.submodelregistry-feature-hierarchy-example/Readme.md Use this Maven command to generate the Docker image for the submodel registry. Specify the Docker namespace as needed. ```bash mvn clean install -Ddocker.namespace=submodel-registry-test ``` -------------------------------- ### Configure MongoDB URI (System Property) Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-service-mongodb-storage/Readme.md Set the MongoDB connection URI as a system property to configure the storage connection. ```properties -Dspring.data.mongodb.uri=mongodb://admin:admin@localhost:27017/ ``` -------------------------------- ### Combine Multiple Search Queries Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-client-native/README.md Chain multiple ShellDescriptorQuery objects together using combinedWith() to create complex aggregated queries. The example demonstrates combining ID short, extension tag, and submodel descriptor queries. ```java ShellDescriptorQuery queryA = new ShellDescriptorQuery().queryType(QueryTypeEnum.REGEX).path(AasRegistryPaths.idShort()).value("short-id"); ShellDescriptorQuery queryB = new ShellDescriptorQuery().queryType(QueryTypeEnum.REGEX).path(AasRegistryPaths.extensions().value()).extensionName("TAG").value("private"); ShellDescriptorQuery queryC = new ShellDescriptorQuery().queryType(QueryTypeEnum.REGEX).path(AasRegistryPaths.submodelDescriptors().isShort()).value("sm_id_short"); queryA.combinedWith(queryB); queryB.combinedWith(queryC); ``` -------------------------------- ### Security Test Script for Submodel Service Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/example/Readme.md Demonstrates testing rule-based authorization against the Submodel Service using Keycloak. It covers token retrieval, authorized requests, and denied requests. ```bash ./run-security-test.sh ``` -------------------------------- ### Configure Favicon Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasrepository/Readme.md To configure the favicon, place the `favicon.ico` file in the specified static resources directory within the BaSyx common HTTP module. ```plaintext ../basyx.common/basyx.http/src/main/resources/static/ ``` -------------------------------- ### Run Maven Test Command Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md Command to execute the test suite using Maven. This command runs all defined tests, including integration tests for different storage backends. ```bash mvn test ``` -------------------------------- ### Activate InMemory Storage Profile Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-service-inmemory-storage/Readme.md Activate the in-memory storage implementation by setting the active profile or the registry.type attribute. ```bash -Dspring.profiles.active=logEvents,inMemoryStorage ``` -------------------------------- ### Custom Docker Image Build Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.component/Readme.md Dockerfile to build a custom image for deployment. It copies application sources, JARs, configuration files, and uses a specific base image. ```dockerfile FROM eclipsebasyx/submodel-service:0.2.0-SNAPSHOT COPY sources/ /application/sources COPY jars/ /application/jars COPY submodel.json /application/submodel.json COPY application.yml /application/config/application.yml ``` -------------------------------- ### Configure Authorization for Registry Integration Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice-feature-registry-integration/Readme.md Enable and configure authorization settings, including client ID, secret, and token endpoint, if the Submodel Registry requires it. ```properties basyx.submodelservice.feature.registryintegration.authorization.enabled=true basyx.submodelservice.feature.registryintegration.authorization.client-id= basyx.submodelservice.feature.registryintegration.authorization.client-secret= basyx.submodelservice.feature.registryintegration.authorization.token-endpoint=http://localhost:9090/oauth/token ``` -------------------------------- ### Run Aas Discovery Service with Docker Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasdiscoveryservice/Readme.md Deploy the Aas Discovery Service using Docker. Mount a custom application.properties file for configuration. Ensure the volume binding is compatible with your terminal (tested with Windows PowerShell). ```bash docker run --name=aas-discovery-service -p:8081:8081 -v C:/tmp/application.properties:/application/application.properties eclipsebasyx/aas-discovery:2.0.0-SNAPSHOT ``` -------------------------------- ### Preconfigure Authorization Environment Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasenvironment/basyx.aasenvironment-feature-authorization/Readme.md Set these properties for a preconfigured environment, especially when using Keycloak. This includes token endpoint, grant type, client credentials, and user details. ```properties basyx.aasenvironment.authorization.preconfiguration.token-endpoint = basyx.aasenvironment.authorization.preconfiguration.grant-type = basyx.aasenvironment.authorization.preconfiguration.client-id = basyx.aasenvironment.authorization.preconfiguration.client-secret= basyx.aasenvironment.authorization.preconfiguration.username = basyx.aasenvironment.authorization.preconfiguration.password = basyx.aasenvironment.authorization.preconfiguration.scopes = ``` -------------------------------- ### Activate MongoDB Storage Profile Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.aasregistry/basyx.aasregistry-service-mongodb-storage/Readme.md Activate the MongoDB storage implementation by setting the active profile or the registry.type attribute. ```properties -Dspring.profiles.active=logEvents,mongoDbStorage ``` -------------------------------- ### Run Standalone Submodel Docker Container Source: https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/basyx.submodelservice/basyx.submodelservice.example/Readme.md After building the image, run the Docker container and map port 8081 to access the submodel service on http://localhost:8081/submodel. ```bash docker run -p 8081:8081 testnamespace/standalone_submodel_example:2.0.0-SNAPSHOT ```