Skip to content

Commit

Permalink
Merge pull request #295 from bci-oss/feature/287-extend-dtr-apis-for-…
Browse files Browse the repository at this point in the history
…access-management__01-define-service-interface

feat: Extend DTR APIs for Access management - Add service interface
  • Loading branch information
tunacicek authored Feb 1, 2024
2 parents f438fe9 + 2a94058 commit ccc7ce0
Show file tree
Hide file tree
Showing 11 changed files with 246 additions and 9 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ The following people have contributed to this repository:
* Johannes Kristan, Bosch.IO GmbH, [email protected]
* Simone Lindner, [email protected]
* Aggarwal Sahil, Robert Bosch GmbH, [email protected]
* Tunahan Cicek, Robert Bosch GmbH, [email protected]
* Istvan Zoltan Nagy, Robert Bosch GmbH, [email protected]

Please add yourself to this list, if you contribute to the content.
76 changes: 76 additions & 0 deletions access-control-service-interface/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
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
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>digital-twin-registry</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.eclipse.tractusx.digital_twin_registry</groupId>
<artifactId>digital-twin-registry-access-control-service-interface</artifactId>
<name>Tractus-X Semantic Layer Digital Twin Registry Access Control Interface</name>
<description>Module contains the Semantic Layer Digital Twin Registry Service's access control service interface</description>
<packaging>jar</packaging>

<organization>
<name>${organization}</name>
<url>${url}</url>
</organization>

<licenses>
<license>
<name>${licence_name}</name>
<url>${licence_url}</url>
<distribution>${licence_distribution}</distribution>
<comments>${licence_comments}</comments>
</license>
</licenses>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
*
* 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
*
******************************************************************************/

package org.eclipse.tractusx.semantics.accesscontrol.api;

import java.util.Set;

import org.eclipse.tractusx.semantics.accesscontrol.api.exception.DenyAccessException;
import org.eclipse.tractusx.semantics.accesscontrol.api.model.AccessRule;
import org.eclipse.tractusx.semantics.accesscontrol.api.model.ShellVisibilityCriteria;
import org.eclipse.tractusx.semantics.accesscontrol.api.model.SpecificAssetId;

public interface AccessControlRuleService {

Set<SpecificAssetId> filterValidSpecificAssetIdsForLookup( Set<SpecificAssetId> specificAssetIds, String bpn ) throws DenyAccessException;

ShellVisibilityCriteria fetchVisibilityCriteriaForShell( Set<SpecificAssetId> specificAssetIds, String bpn ) throws DenyAccessException;

Set<AccessRule> fetchApplicableRulesForPartner( String bpn ) throws DenyAccessException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
*
* 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
*
******************************************************************************/

package org.eclipse.tractusx.semantics.accesscontrol.api.exception;

public class DenyAccessException extends Exception {

public DenyAccessException( String message ) {
super( message );
}

public DenyAccessException( String message, Throwable cause ) {
super( message, cause );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
*
* 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
*
******************************************************************************/

package org.eclipse.tractusx.semantics.accesscontrol.api.model;

import java.util.Set;

public record AccessRule(Set<SpecificAssetId> requiredSpecificAssetIds, Set<String> visibleSemanticIds) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
*
* 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
*
******************************************************************************/

package org.eclipse.tractusx.semantics.accesscontrol.api.model;

import java.util.Set;

public record ShellVisibilityCriteria(Set<String> visibleSpecificAssetIdNames, Set<String> visibleSemanticIds) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH and others
*
* 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
*
******************************************************************************/

package org.eclipse.tractusx.semantics.accesscontrol.api.model;

public record SpecificAssetId(String name, String value) {
}
Empty file.
Empty file.
10 changes: 7 additions & 3 deletions backend/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021-2023 T-Systems International GmbH
Copyright (c) 2021-2023 Contributors to the Eclipse Foundation
Copyright (c) 2021 T-Systems International GmbH and others
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
Expand All @@ -17,7 +16,8 @@
under the License.
SPDX-License-Identifier: Apache-2.0
-->
-->

<!-- Maven POM file to the SLDT services -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down Expand Up @@ -51,6 +51,10 @@
</licenses>

<dependencies>
<dependency>
<groupId>org.eclipse.tractusx.digital_twin_registry</groupId>
<artifactId>digital-twin-registry-access-control-service-interface</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
20 changes: 14 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021-2023 T-Systems International GmbH
Copyright (c) 2021-2023 Contributors to the Eclipse Foundation
Copyright (c) 2021 T-Systems International GmbH and others
See the AUTHORS file(s) distributed with this work for additional
information regarding authorship.
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
Expand All @@ -17,7 +16,8 @@
under the License.
SPDX-License-Identifier: Apache-2.0
-->
-->

<!-- Maven POM file to the SLDT packages -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand Down Expand Up @@ -105,12 +105,20 @@

<modules>
<module>backend</module>
<!-- more modules are expected to come -->
<module>access-control-service-interface</module>
<!-- more modules are expected to come -->
</modules>

<dependencyManagement>
<dependencies>
<!-- Predefined potential dependencies and versions -->
<!-- Modules -->
<dependency>
<groupId>org.eclipse.tractusx.digital_twin_registry</groupId>
<artifactId>digital-twin-registry-access-control-service-interface</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Java Stuff -->
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down

0 comments on commit ccc7ce0

Please sign in to comment.