Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/upgrade-pro…
Browse files Browse the repository at this point in the history
…cess
  • Loading branch information
1azyman committed May 30, 2023
2 parents 758392c + dfbfba7 commit f4f45ba
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 7 deletions.
3 changes: 2 additions & 1 deletion gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,14 @@
</resource>
<!-- ICF LOGGING CONFIGURATION -->
<resource>
<targetPath>../midpoint/META-INF/services</targetPath>
<targetPath>META-INF/services</targetPath>
<filtering>false</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/org.identityconnectors.common.logging</include>
</includes>
</resource>

<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import com.evolveum.midpoint.task.api.TaskManager;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.form.MultipartFormConfiguration;
import com.evolveum.midpoint.web.page.admin.certification.handlers.CertGuiHandlerRegistry;

/**
Expand Down Expand Up @@ -91,7 +92,8 @@
basePackageClasses = {
TextAreaPanelFactory.class,
GuiComponentRegistryImpl.class,
CertGuiHandlerRegistry.class
CertGuiHandlerRegistry.class,
MultipartFormConfiguration.class
})
@EnableScheduling
public class MidPointSpringApplication extends AbstractSpringBootApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.request.Response;

import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.web.security.util.SecurityUtils;

/**
Expand All @@ -20,12 +21,10 @@
*/
public class MidpointForm<T> extends Form<T> {

private static final long DEFAULT_MAX_FILE_COUNT = 10;
private boolean addFakeInputFields = false;

public MidpointForm(String id) {
super(id);
setFileCountMax(DEFAULT_MAX_FILE_COUNT);
}

/**
Expand All @@ -40,6 +39,12 @@ public MidpointForm(String id, boolean addFakeInputFields) {
this.addFakeInputFields = addFakeInputFields;
}

@Override
protected void onRender() {
setFileCountMax(MultipartFormConfiguration.getMaxMultipartsLimit());
super.onRender();
}

@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
super.onComponentTagBody(markupStream, openTag);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (C) 2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.web.component.form;

import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import com.evolveum.midpoint.repo.api.SystemConfigurationChangeDispatcher;
import com.evolveum.midpoint.repo.api.SystemConfigurationChangeListener;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AdminGuiConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;

@Component
public class MultipartFormConfiguration implements SystemConfigurationChangeListener {


@Autowired private SystemConfigurationChangeDispatcher systemConfigurationChangeDispatcher;

private static final int DEFAULT_MAX_MULTIPART_COUNT = 100;
private static Integer maxMultipartLimit = DEFAULT_MAX_MULTIPART_COUNT;

@Override
public void update(@Nullable SystemConfigurationType value) {
if (value == null) {
return;
}
AdminGuiConfigurationType adminGuiConfig = value.getAdminGuiConfiguration();
Integer configValue = null;
if (adminGuiConfig != null) {
configValue = adminGuiConfig.getFormMaxMultiparts();
}
if (configValue != null && configValue > 0) {
maxMultipartLimit = configValue;
} else {
maxMultipartLimit = DEFAULT_MAX_MULTIPART_COUNT;
}
}

public static int getMaxMultipartsLimit() {
return maxMultipartLimit != null ? maxMultipartLimit : DEFAULT_MAX_MULTIPART_COUNT;
}

@PostConstruct
public void init() {
systemConfigurationChangeDispatcher.registerListener(this);
}

@PreDestroy
public void shutdown() {
systemConfigurationChangeDispatcher.unregisterListener(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,20 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="formMaxMultiparts" type="xsd:int" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>
Sets the maximum limit for multipart data inside submitted form (inputs and file uploads are counted).
Default value is 100.
</p>
</xsd:documentation>
<xsd:appinfo>
<a:since>4.4.5</a:since>
<a:displayName>AdminGuiConfigurationType.formMaxMultiparts</a:displayName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:long"/>
</xsd:complexType>
Expand Down
1 change: 1 addition & 0 deletions infra/test-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
4 changes: 3 additions & 1 deletion model/model-intest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<dependency>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
Expand Down Expand Up @@ -352,9 +353,10 @@
<artifactId>spring-aop</artifactId>
<scope>test</scope>
</dependency>
<dependency> <!-- not sure why this must be in compile scope -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
Expand Down
20 changes: 18 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<!-- Encoding for both sources and resources -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- JDK level also affects midPoint Studio, which depends on JDK used by minimum supported IDEA version. -->
<project.source.version>11</project.source.version>
<project.source.version>17</project.source.version>
<project.build.locale>en_US</project.build.locale>
<ansi.color>true</ansi.color>
<verbose.jaxb2>false</verbose.jaxb2>
Expand Down Expand Up @@ -1753,7 +1753,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.3.0</version>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
Expand Down Expand Up @@ -1814,6 +1814,22 @@
<ignoredUsedUndeclaredDependency>org.danekja:jdk-serializable-functional</ignoredUsedUndeclaredDependency>
<ignoredUsedUndeclaredDependency>org.apache.tomcat.embed:tomcat-embed-core</ignoredUsedUndeclaredDependency>
</ignoredUsedUndeclaredDependencies>
<ignoredNonTestScopedDependencies>
<ignoredNonTestScopedDependency>com.evolveum.midpoint.*:*</ignoredNonTestScopedDependency>
<ignoredNonTestScopedDependency>org.slf4j:slf4j-api</ignoredNonTestScopedDependency>
<!-- Since generated code depends on prism-impl, it needs sometime to be runtime/compile
but report can not detect this uses (and if you change scope, it can not compile target project -->
<ignoredNonTestScopedDependency>com.evolveum.prism:prism-impl</ignoredNonTestScopedDependency>
<ignoredNonTestScopedDependency>com.evolveum.commons:concepts</ignoredNonTestScopedDependency>

<!-- Testing dependencies are not troubling us from. -->
<ignoredUsedUndeclaredDependency>org.testng:testng</ignoredUsedUndeclaredDependency>
<ignoredUsedUndeclaredDependency>org.assertj:assertj-core</ignoredUsedUndeclaredDependency>
<ignoredUsedUndeclaredDependency>org.javasimon:javasimon-core</ignoredUsedUndeclaredDependency>
<ignoredUsedUndeclaredDependency>jakarta.xml.bind:jakarta.xml.bind-api</ignoredUsedUndeclaredDependency>
<ignoredUsedUndeclaredDependency>jakarta.annotation:jakarta.annotation-api</ignoredUsedUndeclaredDependency>

</ignoredNonTestScopedDependencies>
</configuration>
</execution>
</executions>
Expand Down
4 changes: 4 additions & 0 deletions repo/repo-sql-impl-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>audit-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
Expand Down Expand Up @@ -82,6 +83,7 @@
<dependency>
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>test-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -98,6 +100,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -117,6 +120,7 @@
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-ant</artifactId>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
1 change: 1 addition & 0 deletions repo/security-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand Down
5 changes: 5 additions & 0 deletions testing/conntest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
<dependency>
<groupId>com.evolveum.commons</groupId>
<artifactId>util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
Expand Down Expand Up @@ -121,15 +123,18 @@
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-all</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<scope>test</scope>
</dependency>

<!-- TEST dependency -->
Expand Down
7 changes: 7 additions & 0 deletions testing/longtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
<dependency>
<groupId>com.evolveum.commons</groupId>
<artifactId>util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
Expand Down Expand Up @@ -110,6 +112,7 @@
<groupId>com.evolveum.icf</groupId>
<artifactId>dummy-resource</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
Expand All @@ -120,18 +123,22 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.forgerock.opendj</groupId>
<artifactId>opendj</artifactId>
<scope>test</scope>
</dependency>

<!-- TEST dependency -->
Expand Down

0 comments on commit f4f45ba

Please sign in to comment.