ilgrosso commented on code in PR #546:
URL: https://github.com/apache/syncope/pull/546#discussion_r1390722163
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -344,6 +349,28 @@ protected Iterator<String> getChoices(final String input) {
"field", "logoutUri", new
PropertyModel<>(clientAppTO, "logoutUri"), false);
logoutUri.addValidator(new UrlValidator());
fields.add(logoutUri);
+
+ BinaryFieldPanel jwks = new BinaryFieldPanel(
+ "field", "jwks", new PropertyModel<>(clientAppTO,
"jwks"), MediaType.APPLICATION_JSON, "");
+ if (clientAppTO instanceof OIDCRPClientAppTO
Review Comment:
The check `clientAppTO instanceof OIDCRPClientAppTO` is not needed
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -344,6 +349,28 @@ protected Iterator<String> getChoices(final String input) {
"field", "logoutUri", new
PropertyModel<>(clientAppTO, "logoutUri"), false);
logoutUri.addValidator(new UrlValidator());
fields.add(logoutUri);
+
+ BinaryFieldPanel jwks = new BinaryFieldPanel(
+ "field", "jwks", new PropertyModel<>(clientAppTO,
"jwks"), MediaType.APPLICATION_JSON, "");
Review Comment:
Do not pass "" as `filekey`, it is used to name the downloaded file
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -344,6 +349,28 @@ protected Iterator<String> getChoices(final String input) {
"field", "logoutUri", new
PropertyModel<>(clientAppTO, "logoutUri"), false);
logoutUri.addValidator(new UrlValidator());
fields.add(logoutUri);
+
+ BinaryFieldPanel jwks = new BinaryFieldPanel(
+ "field", "jwks", new PropertyModel<>(clientAppTO,
"jwks"), MediaType.APPLICATION_JSON, "");
+ if (clientAppTO instanceof OIDCRPClientAppTO
+ && StringUtils.isNotBlank(((OIDCRPClientAppTO)
clientAppTO).getJwks())) {
+ ((OIDCRPClientAppTO)
clientAppTO).setJwks(Base64.getEncoder().encodeToString(
+ ((OIDCRPClientAppTO)
clientAppTO).getJwks().getBytes(StandardCharsets.UTF_8)));
+ jwks.setNewModel(new PropertyModel<>(clientAppTO,
"jwks"));
+ }
+ fields.add(jwks);
+
+ AjaxTextFieldPanel jwksUri = new AjaxTextFieldPanel(
+ "field", "jwksUri", new
PropertyModel<>(clientAppTO, "jwksUri"), false);
+ jwksUri.addValidator(new UrlValidator());
+ fields.add(jwksUri);
+
+ AjaxTextFieldPanel tokenEndpointAuthenticationMethod = new
AjaxTextFieldPanel(
Review Comment:
Let's transform this field from `String` to a new enum with values copied
from
`https://github.com/apereo/cas/blob/master/support/cas-server-support-oauth-api/src/main/java/org/apereo/cas/support/oauth/OAuth20ClientAuthenticationMethods.java`
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -344,6 +349,28 @@ protected Iterator<String> getChoices(final String input) {
"field", "logoutUri", new
PropertyModel<>(clientAppTO, "logoutUri"), false);
logoutUri.addValidator(new UrlValidator());
fields.add(logoutUri);
+
+ BinaryFieldPanel jwks = new BinaryFieldPanel(
+ "field", "jwks", new PropertyModel<>(clientAppTO,
"jwks"), MediaType.APPLICATION_JSON, "");
Review Comment:
Why using `PropertyModel` and after setting the value manually? Use a custom
model instead
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -344,6 +349,28 @@ protected Iterator<String> getChoices(final String input) {
"field", "logoutUri", new
PropertyModel<>(clientAppTO, "logoutUri"), false);
logoutUri.addValidator(new UrlValidator());
fields.add(logoutUri);
+
+ BinaryFieldPanel jwks = new BinaryFieldPanel(
+ "field", "jwks", new PropertyModel<>(clientAppTO,
"jwks"), MediaType.APPLICATION_JSON, "");
Review Comment:
Have you tried to upload something here and save, then open again and
download?
##########
client/am/console/src/main/java/org/apache/syncope/client/console/clientapps/ClientAppModalPanelBuilder.java:
##########
@@ -455,6 +482,10 @@ protected void populateItem(final ListItem<Component>
item) {
@Override
public void onSubmit(final AjaxRequestTarget target) {
try {
+ if (clientAppTO instanceof OIDCRPClientAppTO) {
Review Comment:
This conversion shall be performed by a custom model as said above
--
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]