Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3_0_X' into OPENSEARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Oct 28, 2023
2 parents d0cf76c + 7e8f5d2 commit b739782
Show file tree
Hide file tree
Showing 30 changed files with 307 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label;
Expand Down Expand Up @@ -217,15 +216,14 @@ protected final class AttrRepoProvider extends DirectoryDataProvider<AttrRepoTO>

private AttrRepoProvider(final int paginatorRows) {
super(paginatorRows);
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<AttrRepoTO> iterator(final long first, final long count) {
List<AttrRepoTO> result = restClient.list();
result.sort(comparator);
return result.subList((int) first, (int) first + (int) count).iterator();
List<AttrRepoTO> attrRepos = restClient.list();
attrRepos.sort(comparator);
return attrRepos.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label;
Expand Down Expand Up @@ -221,15 +220,14 @@ protected final class AuthModuleProvider extends DirectoryDataProvider<AuthModul

private AuthModuleProvider(final int paginatorRows) {
super(paginatorRows);
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<AuthModuleTO> iterator(final long first, final long count) {
List<AuthModuleTO> result = restClient.list();
result.sort(comparator);
return result.subList((int) first, (int) first + (int) count).iterator();
List<AuthModuleTO> authModules = restClient.list();
authModules.sort(comparator);
return authModules.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
Expand Down Expand Up @@ -165,15 +164,14 @@ protected final class SAML2IdPEntityProvider extends DirectoryDataProvider<SAML2

public SAML2IdPEntityProvider(final int paginatorRows) {
super(paginatorRows);
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<? extends SAML2IdPEntityTO> iterator(final long first, final long count) {
List<SAML2IdPEntityTO> list = restClient.list();
list.sort(comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
List<SAML2IdPEntityTO> idps = restClient.list();
idps.sort(comparator);
return idps.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
Expand Down Expand Up @@ -191,15 +190,14 @@ protected final class SAML2SPEntityProvider extends DirectoryDataProvider<SAML2S

public SAML2SPEntityProvider(final int paginatorRows) {
super(paginatorRows);
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<? extends SAML2SPEntityTO> iterator(final long first, final long count) {
List<SAML2SPEntityTO> list = restClient.list();
list.sort(comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
List<SAML2SPEntityTO> sps = restClient.list();
sps.sort(comparator);
return sps.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.wicket.request.resource.IResource;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
Expand Down Expand Up @@ -109,11 +110,15 @@ public SyncopeCoreHealthIndicator syncopeCoreHealthIndicator(
props.isUseGZIPCompression());
}

@ConditionalOnProperty(
prefix = "keymaster", name = "enableAutoRegistration", havingValue = "true", matchIfMissing = true)
@Bean
public KeymasterStart keymasterStart() {
return new KeymasterStart(NetworkService.Type.CONSOLE);
}

@ConditionalOnProperty(
prefix = "keymaster", name = "enableAutoRegistration", havingValue = "true", matchIfMissing = true)
@Bean
public KeymasterStop keymasterStop() {
return new KeymasterStop(NetworkService.Type.CONSOLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public AnyDataProvider(
break;

default:
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
}

this.comparator = new SortableAnyProviderComparator<>(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -195,15 +194,14 @@ protected final class MailTemplateProvider extends DirectoryDataProvider<MailTem

public MailTemplateProvider(final int paginatorRows) {
super(paginatorRows);
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<MailTemplateTO> iterator(final long first, final long count) {
final List<MailTemplateTO> list = restClient.listTemplates();
list.sort(comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
List<MailTemplateTO> templates = restClient.listTemplates();
templates.sort(comparator);
return templates.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -200,16 +199,14 @@ protected class NotificationProvider extends DirectoryDataProvider<NotificationT

public NotificationProvider(final int paginatorRows) {
super(paginatorRows);

setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<NotificationTO> iterator(final long first, final long count) {
List<NotificationTO> list = restClient.list();
list.sort(comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
List<NotificationTO> notifications = restClient.list();
notifications.sort(comparator);
return notifications.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.WebMarkupContainer;
Expand Down Expand Up @@ -193,16 +192,14 @@ protected class ImplementationProvider extends DirectoryDataProvider<Implementat

public ImplementationProvider(final int paginatorRows) {
super(paginatorRows);

setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<ImplementationTO> iterator(final long first, final long count) {
List<ImplementationTO> list = restClient.list(type);
list.sort(comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
List<ImplementationTO> implementations = restClient.list(type);
implementations.sort(comparator);
return implementations.subList((int) first, (int) first + (int) count).iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.model.CompoundPropertyModel;
Expand Down Expand Up @@ -218,17 +217,14 @@ protected final class SchemaProvider extends DirectoryDataProvider<SchemaTO> {

private SchemaProvider(final int paginatorRows, final SchemaType schemaType) {
super(paginatorRows);

this.schemaType = schemaType;
setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<>(this);
}

@Override
public Iterator<SchemaTO> iterator(final long first, final long count) {
List<SchemaTO> schemas = restClient.getSchemas(this.schemaType, keyword);
schemas.sort(comparator);

return schemas.subList((int) first, (int) first + (int) count).iterator();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@
import org.apache.syncope.client.console.panels.MultilevelPanel;
import org.apache.syncope.client.console.rest.TaskRestClient;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.panels.ModalPanel;
import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;

Expand Down Expand Up @@ -93,8 +91,6 @@ protected abstract class TasksProvider<T extends TaskTO> extends DirectoryDataPr

public TasksProvider(final int paginatorRows, final TaskType type) {
super(paginatorRows);

setSort(Constants.KEY_FIELD_NAME, SortOrder.ASCENDING);
this.type = type;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.wicket.request.resource.IResource;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
Expand Down Expand Up @@ -78,11 +79,15 @@ public SyncopeCoreHealthIndicator syncopeCoreHealthIndicator(
props.isUseGZIPCompression());
}

@ConditionalOnProperty(
prefix = "keymaster", name = "enableAutoRegistration", havingValue = "true", matchIfMissing = true)
@Bean
public KeymasterStart keymasterStart() {
return new KeymasterStart(NetworkService.Type.ENDUSER);
}

@ConditionalOnProperty(
prefix = "keymaster", name = "enableAutoRegistration", havingValue = "true", matchIfMissing = true)
@Bean
public KeymasterStop keymasterStop() {
return new KeymasterStop(NetworkService.Type.ENDUSER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public interface TaskService extends ExecutableService {
* @param key key of task to be read
* @param details whether include executions or not, defaults to true
* @param <T> type of taskTO
* @return task with matching id
* @return task with matching key
*/
@GET
@Path("{type}/{key}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class KeymasterProperties {

private int maxRetries = 3;

private boolean enableAutoRegistration = true;

public String getAddress() {
return address;
}
Expand Down Expand Up @@ -72,4 +74,12 @@ public int getMaxRetries() {
public void setMaxRetries(final int maxRetries) {
this.maxRetries = maxRetries;
}

public boolean isEnableAutoRegistration() {
return enableAutoRegistration;
}

public void setEnableAutoRegistration(final boolean enableAutoRegistration) {
this.enableAutoRegistration = enableAutoRegistration;
}
}
15 changes: 15 additions & 0 deletions common/keymaster/self/rest-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ under the License.

<build>
<plugins>
<!-- Generating javadoc JAR artifact for usage with CXF's WADL generator (for core) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down
Loading

0 comments on commit b739782

Please sign in to comment.