You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by "andrea-patricelli (via GitHub)" <gi...@apache.org> on 2023/02/22 12:13:22 UTC
[GitHub] [syncope] andrea-patricelli opened a new pull request, #413: [SYNCOPE-1732] support generic access policy configuration through be…
andrea-patricelli opened a new pull request, #413:
URL: https://github.com/apache/syncope/pull/413
…an panel
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] ilgrosso commented on a diff in pull request #413: [SYNCOPE-1732] support generic access policy configuration through be…
Posted by "ilgrosso (via GitHub)" <gi...@apache.org>.
ilgrosso commented on code in PR #413:
URL: https://github.com/apache/syncope/pull/413#discussion_r1114245710
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccessPolicyConf.java:
##########
@@ -94,14 +92,12 @@ public void setUnauthorizedRedirectUrl(final URI unauthorizedRedirectUrl) {
}
@JacksonXmlElementWrapper(localName = "requiredAttrs")
Review Comment:
This annotation should be removed altogether.
##########
wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/DefaultAccessMapper.java:
##########
@@ -43,10 +45,12 @@ public RegisteredServiceAccessStrategy build(final AccessPolicyTO policy) {
accessStrategy.setUnauthorizedRedirectUrl(conf.getUnauthorizedRedirectUrl());
conf.getRequiredAttrs().forEach(
- attr -> accessStrategy.getRequiredAttributes().put(attr.getSchema(), new HashSet<>(attr.getValues())));
+ (k, v) -> accessStrategy.getRequiredAttributes().put(k,
+ new HashSet<>(Set.of(StringUtils.split(v, ",")))));
Review Comment:
Questions:
1. are `new Hashet<>(Set.of(...)) both required? wouldn't be enough to have `Set.of(...)`?
2. can we `trim()` the values after splitting by `,`? I'd like to avoid issues if one inputs `value1, value2` as oppositve as `value1,value2`
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccessPolicyConf.java:
##########
@@ -94,14 +92,12 @@ public void setUnauthorizedRedirectUrl(final URI unauthorizedRedirectUrl) {
}
@JacksonXmlElementWrapper(localName = "requiredAttrs")
- @JacksonXmlProperty(localName = "requiredAttr")
- public List<Attr> getRequiredAttrs() {
+ public Map<String, String> getRequiredAttrs() {
return requiredAttrs;
}
@JacksonXmlElementWrapper(localName = "rejectedAttrs")
Review Comment:
This annotation should be removed altogether.
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] andrea-patricelli merged pull request #413: [SYNCOPE-1732] Support generic access policy configuration through BeanPanel
Posted by "andrea-patricelli (via GitHub)" <gi...@apache.org>.
andrea-patricelli merged PR #413:
URL: https://github.com/apache/syncope/pull/413
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] andrea-patricelli commented on a diff in pull request #413: [SYNCOPE-1732] Support generic access policy configuration through BeanPanel
Posted by "andrea-patricelli (via GitHub)" <gi...@apache.org>.
andrea-patricelli commented on code in PR #413:
URL: https://github.com/apache/syncope/pull/413#discussion_r1114337579
##########
wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/DefaultAccessMapper.java:
##########
@@ -43,10 +45,12 @@ public RegisteredServiceAccessStrategy build(final AccessPolicyTO policy) {
accessStrategy.setUnauthorizedRedirectUrl(conf.getUnauthorizedRedirectUrl());
conf.getRequiredAttrs().forEach(
- attr -> accessStrategy.getRequiredAttributes().put(attr.getSchema(), new HashSet<>(attr.getValues())));
+ (k, v) -> accessStrategy.getRequiredAttributes().put(k,
+ new HashSet<>(Set.of(StringUtils.split(v, ",")))));
Review Comment:
sure
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] github-code-scanning[bot] commented on a diff in pull request #413: [SYNCOPE-1732] Support generic access policy configuration through BeanPanel
Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #413:
URL: https://github.com/apache/syncope/pull/413#discussion_r1114382411
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccessPolicyConf.java:
##########
@@ -93,15 +90,11 @@
this.unauthorizedRedirectUrl = unauthorizedRedirectUrl;
}
- @JacksonXmlElementWrapper(localName = "requiredAttrs")
- @JacksonXmlProperty(localName = "requiredAttr")
- public List<Attr> getRequiredAttrs() {
+ public Map<String, String> getRequiredAttrs() {
Review Comment:
## Exposing internal representation
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](1).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](2).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](3).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](4).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](5).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](6).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](7).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](8).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](9).
[Show more details](https://github.com/apache/syncope/security/code-scanning/1215)
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] github-code-scanning[bot] commented on a diff in pull request #413: [SYNCOPE-1732] Support generic access policy configuration through BeanPanel
Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #413:
URL: https://github.com/apache/syncope/pull/413#discussion_r1114260262
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccessPolicyConf.java:
##########
@@ -94,14 +92,12 @@
}
@JacksonXmlElementWrapper(localName = "requiredAttrs")
- @JacksonXmlProperty(localName = "requiredAttr")
- public List<Attr> getRequiredAttrs() {
+ public Map<String, String> getRequiredAttrs() {
return requiredAttrs;
}
@JacksonXmlElementWrapper(localName = "rejectedAttrs")
- @JacksonXmlProperty(localName = "rejectedAttr")
- public List<Attr> getRejectedAttrs() {
+ public Map<String, String> getRejectedAttrs() {
Review Comment:
## Exposing internal representation
getRejectedAttrs exposes the internal representation stored in field rejectedAttrs. The value may be modified [after this call to getRejectedAttrs](1).
[Show more details](https://github.com/apache/syncope/security/code-scanning/1213)
##########
common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccessPolicyConf.java:
##########
@@ -94,14 +92,12 @@
}
@JacksonXmlElementWrapper(localName = "requiredAttrs")
- @JacksonXmlProperty(localName = "requiredAttr")
- public List<Attr> getRequiredAttrs() {
+ public Map<String, String> getRequiredAttrs() {
Review Comment:
## Exposing internal representation
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](1).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](2).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](3).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](4).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](5).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](6).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](7).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](8).
getRequiredAttrs exposes the internal representation stored in field requiredAttrs. The value may be modified [after this call to getRequiredAttrs](9).
[Show more details](https://github.com/apache/syncope/security/code-scanning/1214)
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [syncope] ilgrosso commented on a diff in pull request #413: [SYNCOPE-1732] support generic access policy configuration through be…
Posted by "ilgrosso (via GitHub)" <gi...@apache.org>.
ilgrosso commented on code in PR #413:
URL: https://github.com/apache/syncope/pull/413#discussion_r1114248818
##########
wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/DefaultAccessMapper.java:
##########
@@ -43,10 +45,12 @@ public RegisteredServiceAccessStrategy build(final AccessPolicyTO policy) {
accessStrategy.setUnauthorizedRedirectUrl(conf.getUnauthorizedRedirectUrl());
conf.getRequiredAttrs().forEach(
- attr -> accessStrategy.getRequiredAttributes().put(attr.getSchema(), new HashSet<>(attr.getValues())));
+ (k, v) -> accessStrategy.getRequiredAttributes().put(k,
+ new HashSet<>(Set.of(StringUtils.split(v, ",")))));
Review Comment:
Questions:
1. are `new Hashet<>(Set.of(...))` both required? wouldn't be enough to have `Set.of(...)`?
2. can we `trim()` the values after splitting by `,`? I'd like to avoid issues if one inputs `value1, value2` as oppositve as `value1,value2`
--
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: dev-unsubscribe@syncope.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org