-
Notifications
You must be signed in to change notification settings - Fork 43
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
Adds authorization support for preconfigured AAS Environment #325
Conversation
Signed-off-by: FriedJannik <Jannik.Fried@iese.fraunhofer.de> Co-authored-by: Aaron Zielstorff <aaron.zielstorff@iese.fraunhofer.de> Co-authored-by: Mohammad Ghazanfar Ali Danish <ghazanfar.danish@iese.fraunhofer.de>
- Embeds Preconfiguration to current Test Classes Signed-off-by: FriedJannik <Jannik.Fried@iese.fraunhofer.de> Co-authored-by: Aaron Zielstorff <aaron.zielstorff@iese.fraunhofer.de>
This reverts commit cd32396.
private Logger logger = LoggerFactory.getLogger(AasEnvironmentPreconfigurationLoader.class); | ||
|
||
@Value("${basyx.environment:#{null}}") | ||
private List<String> pathsToLoad; | ||
|
||
private ResourceLoader resourceLoader; | ||
|
||
|
||
@Value("${basyx.aasenvironment.authorization.preconfiguration.token-endpoint:#{null}}") |
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.
I suggest documenting this new pars in the README
@@ -80,10 +125,15 @@ public void loadPreconfiguredEnvironments(AasEnvironment aasEnvironment) | |||
int filesCount = files.size(); | |||
int currenFileIndex = 0; | |||
|
|||
if(authorizationEnabled) { |
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.
I suggest moving these changes to a new class: AuthorizedAasEnvironmentPreconfig... in aasenvironment-feature-authorization
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.
We need this part here, because we need to authorize the Action performed by the PreConfiguration Loader, so imo it is not possible to extract this
@@ -106,7 +106,6 @@ | |||
<dependency> | |||
<groupId>org.apache.httpcomponents.client5</groupId> | |||
<artifactId>httpclient5</artifactId> |
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.
Is this change necessary? (line 109)
this.password = password; | ||
} | ||
|
||
public AccessTokenProvider create(){ |
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.
Consider adding unit tests to this factory
Signed-off-by: FriedJannik <Jannik.Fried@iese.fraunhofer.de>
Co-authored-by: Aaron Zielstorff <aaron.zielstorff@iese.fraunhofer.de> Signed-off-by: FriedJannik <Jannik.Fried@iese.fraunhofer.de>
@@ -31,9 +31,11 @@ | |||
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironmentFactory; | |||
import org.eclipse.digitaltwin.basyx.aasenvironment.feature.AasEnvironmentFeature; | |||
import org.eclipse.digitaltwin.basyx.aasenvironment.feature.DecoratedAasEnvironmentFactory; | |||
import org.eclipse.digitaltwin.basyx.aasenvironment.preconfiguration.AasEnvironmentPreconfigurationLoader; |
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.
Imports not needed
@@ -71,6 +71,10 @@ | |||
<groupId>org.eclipse.digitaltwin.basyx</groupId> | |||
<artifactId>basyx.http</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.eclipse.digitaltwin.basyx</groupId> | |||
<artifactId>basyx.client</artifactId> |
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.
Is this dep. required?
No description provided.