-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend DTR APIs for Access management
- Adds new module to provide service contract for access control rules
- Loading branch information
1 parent
a09e77c
commit 9ec467c
Showing
10 changed files
with
246 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
~ Copyright (c) 2024 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 | ||
~ | ||
--> | ||
|
||
<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> |
38 changes: 38 additions & 0 deletions
38
.../main/java/org/eclipse/tractusx/semantics/accesscontrol/api/AccessControlRuleService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* Copyright (c) 2024 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 | ||
* | ||
*/ | ||
|
||
package org.eclipse.tractusx.semantics.accesscontrol.api; | ||
|
||
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; | ||
|
||
import java.util.Set; | ||
|
||
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; | ||
} |
33 changes: 33 additions & 0 deletions
33
.../java/org/eclipse/tractusx/semantics/accesscontrol/api/exception/DenyAccessException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* Copyright (c) 2024 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 | ||
* | ||
*/ | ||
|
||
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); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...face/src/main/java/org/eclipse/tractusx/semantics/accesscontrol/api/model/AccessRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* Copyright (c) 2024 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 | ||
* | ||
*/ | ||
|
||
package org.eclipse.tractusx.semantics.accesscontrol.api.model; | ||
|
||
import java.util.Set; | ||
|
||
public record AccessRule(Set<SpecificAssetId> requiredSpecificAssetIds, Set<String> visibleSemanticIds) { | ||
|
||
|
||
} |
27 changes: 27 additions & 0 deletions
27
.../java/org/eclipse/tractusx/semantics/accesscontrol/api/model/ShellVisibilityCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* Copyright (c) 2024 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 | ||
* | ||
*/ | ||
|
||
package org.eclipse.tractusx.semantics.accesscontrol.api.model; | ||
|
||
import java.util.Set; | ||
|
||
public record ShellVisibilityCriteria(Set<String> visibleSpecificAssetIdNames, Set<String> visibleSemanticIds) { | ||
} |
25 changes: 25 additions & 0 deletions
25
...src/main/java/org/eclipse/tractusx/semantics/accesscontrol/api/model/SpecificAssetId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* Copyright (c) 2024 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 | ||
* | ||
*/ | ||
|
||
package org.eclipse.tractusx.semantics.accesscontrol.api.model; | ||
|
||
public record SpecificAssetId(String name, String value) { | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters