github-advanced-security[bot] commented on code in PR #1628:
URL: https://github.com/apache/syncope/pull/1628#discussion_r4663591215
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java:
##########
@@ -378,6 +390,26 @@
return audience;
}
+ public List<String> getTokenExchangeAllowedResources() {
+ return tokenExchangeAllowedResources;
+ }
+
+ public List<String> getTokenExchangeAllowedAudience() {
Review Comment:
## CodeQL / Exposing internal representation
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](1).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](2).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](3).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](4).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](5).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](6).
getTokenExchangeAllowedAudience exposes the internal representation stored
in field tokenExchangeAllowedAudience. The value may be modified [after this
call to getTokenExchangeAllowedAudience](7).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2717)
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java:
##########
@@ -378,6 +390,26 @@
return audience;
}
+ public List<String> getTokenExchangeAllowedResources() {
+ return tokenExchangeAllowedResources;
+ }
+
+ public List<String> getTokenExchangeAllowedAudience() {
+ return tokenExchangeAllowedAudience;
+ }
+
+ public List<String> getTokenExchangeAllowedTokenTypes() {
Review Comment:
## CodeQL / Exposing internal representation
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](1).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](2).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](3).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](4).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](5).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](6).
getTokenExchangeAllowedTokenTypes exposes the internal representation stored
in field tokenExchangeAllowedTokenTypes. The value may be modified [after this
call to getTokenExchangeAllowedTokenTypes](7).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2716)
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java:
##########
@@ -378,6 +390,26 @@
return audience;
}
+ public List<String> getTokenExchangeAllowedResources() {
+ return tokenExchangeAllowedResources;
+ }
+
+ public List<String> getTokenExchangeAllowedAudience() {
+ return tokenExchangeAllowedAudience;
+ }
+
+ public List<String> getTokenExchangeAllowedTokenTypes() {
+ return tokenExchangeAllowedTokenTypes;
+ }
+
+ public List<String> getTokenExchangeAllowedActorTokenTypes() {
Review Comment:
## CodeQL / Exposing internal representation
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](1).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](2).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](3).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](4).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](5).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](6).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](7).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](8).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](9).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](10).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](11).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](12).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](13).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](14).
getTokenExchangeAllowedActorTokenTypes exposes the internal representation
stored in field tokenExchangeAllowedActorTokenTypes. The value may be modified
[after this call to getTokenExchangeAllowedActorTokenTypes](15).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2715)
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java:
##########
@@ -378,6 +390,26 @@
return audience;
}
+ public List<String> getTokenExchangeAllowedResources() {
Review Comment:
## CodeQL / Exposing internal representation
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](1).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](2).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](3).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](4).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](5).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](6).
getTokenExchangeAllowedResources exposes the internal representation stored
in field tokenExchangeAllowedResources. The value may be modified [after this
call to getTokenExchangeAllowedResources](7).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2718)
##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ClientAppDataBinderImpl.java:
##########
@@ -294,6 +297,29 @@
}
protected void doUpdate(final OIDCRPClientApp clientApp, final
OIDCRPClientAppTO clientAppTO) {
+ if
(clientAppTO.getTokenExchangeAllowedActorTokenTypes().stream().anyMatch(StringUtils::isBlank))
{
+ SyncopeClientException invalid =
SyncopeClientException.build(ClientExceptionType.InvalidValues);
+ invalid.getElements().add("Token exchange actor token types cannot
contain blank values");
+ throw invalid;
+ }
+
+
clientAppTO.getTokenExchangeRequiredActorTokenAttributes().forEach((name,
expressions) -> {
+ if (StringUtils.isBlank(name) || expressions == null ||
expressions.isEmpty()
+ || expressions.stream().anyMatch(StringUtils::isBlank)) {
+ SyncopeClientException invalid =
SyncopeClientException.build(ClientExceptionType.InvalidValues);
+ invalid.getElements().add("Invalid token exchange actor token
attributes");
+ throw invalid;
+ }
+ try {
+ expressions.forEach(Pattern::compile);
Review Comment:
## CodeQL / Regular expression injection
This regular expression is constructed from a [user-provided value](1).
This regular expression is constructed from a [user-provided value](2).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2713)
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java:
##########
@@ -378,6 +390,26 @@
return audience;
}
+ public List<String> getTokenExchangeAllowedResources() {
+ return tokenExchangeAllowedResources;
+ }
+
+ public List<String> getTokenExchangeAllowedAudience() {
+ return tokenExchangeAllowedAudience;
+ }
+
+ public List<String> getTokenExchangeAllowedTokenTypes() {
+ return tokenExchangeAllowedTokenTypes;
+ }
+
+ public List<String> getTokenExchangeAllowedActorTokenTypes() {
+ return tokenExchangeAllowedActorTokenTypes;
+ }
+
+ public Map<String, List<String>>
getTokenExchangeRequiredActorTokenAttributes() {
Review Comment:
## CodeQL / Exposing internal representation
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](1).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](2).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](3).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](4).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](5).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](6).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](7).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](8).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](9).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](10).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](11).
getTokenExchangeRequiredActorTokenAttributes exposes the internal
representation stored in field tokenExchangeRequiredActorTokenAttributes. The
value may be modified [after this call to
getTokenExchangeRequiredActorTokenAttributes](12).
[Show more
details](https://github.com/apache/syncope/security/code-scanning/2714)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]