-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements a feature to support the Submodel-based RBAC rules backend for the remaining components #574
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
Signed-off-by: Mohammad Ghazanfar Ali Danish <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. I added some remarks and questions.
@@ -0,0 +1,134 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
public SubmodelElementCollection adapt(TargetInformation targetInformation) { | ||
|
||
if (targetInformation instanceof AasTargetInformation) | ||
return new AasTargetInformationAdapter().adapt(targetInformation); | ||
|
||
if (targetInformation instanceof SubmodelTargetInformation) | ||
return new SubmodelTargetInformationAdapter().adapt(targetInformation); | ||
|
||
if (targetInformation instanceof ConceptDescriptionTargetInformation) | ||
return new CDTargetInformationAdapter().adapt(targetInformation); | ||
|
||
SubmodelElementCollection targetInformationSMC = new DefaultSubmodelElementCollection.Builder().idShort("targetInformation").build(); | ||
|
||
SubmodelElementList aasId = new DefaultSubmodelElementList.Builder().idShort("aasIds").build(); | ||
SubmodelElementList submodelId = new DefaultSubmodelElementList.Builder().idShort("submodelIds").build(); | ||
Property typeProperty = new DefaultProperty.Builder().idShort("@type").value("aas-environment").build(); | ||
|
||
List<SubmodelElement> aasIds = ((AasEnvironmentTargetInformation) targetInformation).getAasIds().stream().map(this::transform).collect(Collectors.toList()); | ||
List<SubmodelElement> submodelIds = ((AasEnvironmentTargetInformation) targetInformation).getSubmodelIds().stream().map(this::transform).collect(Collectors.toList()); | ||
aasId.setValue(aasIds); | ||
submodelId.setValue(submodelIds); | ||
|
||
targetInformationSMC.setValue(Arrays.asList(aasId, submodelId, typeProperty)); | ||
|
||
return targetInformationSMC; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are handling ConceptDescriptionTargetInformation
in L67-68 but in L72-73 you are only creating lists for aasIds
and submodelIds
. Are conceptDescriptionIds missing here?
@@ -0,0 +1,184 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
@@ -0,0 +1,114 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
SubmodelElementList aasId = new DefaultSubmodelElementList.Builder().idShort("conceptDescriptionIds").build(); | ||
Property typeProperty = new DefaultProperty.Builder().idShort("@type").value("concept-description").build(); | ||
|
||
List<SubmodelElement> aasIds = ((ConceptDescriptionTargetInformation) targetInformation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List<SubmodelElement> aasIds = ((ConceptDescriptionTargetInformation) targetInformation) | |
List<SubmodelElement> cdIds = ((ConceptDescriptionTargetInformation) targetInformation) |
@@ -0,0 +1,161 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
@@ -0,0 +1,101 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
@@ -0,0 +1,155 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
@@ -0,0 +1,109 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
@@ -0,0 +1,173 @@ | |||
/******************************************************************************* | |||
* Copyright (C) 2024 the Eclipse BaSyx Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (C) 2024 the Eclipse BaSyx Authors | |
* Copyright (C) 2025 the Eclipse BaSyx Authors |
Description of Changes
Implements a feature to support the Submodel-based RBAC rules backend. This also includes the management of RBAC rules dynamically using the Submodel API. It separates the backend into InMemory and Submodel-based.
Similar to the already implemented module #407
The remaining modules except the AAS Discovery are implemented in this PR.
BaSyx Configuration for Testing
These extra configurations are required along with the current authorization configurations to configure the newly implemented feature:
basyx.feature.authorization.rules.backend=Submodel
basyx.feature.authorization.rules.backend.submodel.authorization.endpoint=<Endpoint of the Security Submodel>
basyx.feature.authorization.rules.backend.submodel.authorization.token-endpoint=<Token Endpoint>
basyx.feature.authorization.rules.backend.submodel.authorization.grant-type = <CLIENT_CREDENTIALS> or <PASSWORD>
basyx.feature.authorization.rules.backend.submodel.authorization.client-id=<client-id>
basyx.feature.authorization.rules.backend.submodel.authorization.client-secret=<client-secret>
basyx.feature.authorization.rules.backend.submodel.authorization.username=<username>
basyx.feature.authorization.rules.backend.submodel.authorization.password=<password>