Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jun 28, 2021
2 parents 9f425f9 + 8e32228 commit 74fcbf3
Show file tree
Hide file tree
Showing 116 changed files with 986 additions and 2,131 deletions.
2 changes: 1 addition & 1 deletion dist/javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<isOffline>true</isOffline>
<doctitle>midPoint Aggregate JavaDoc</doctitle>
<windowtitle>midPoint Aggregate JavaDoc</windowtitle>
<additionalJOption>--no-module-directories</additionalJOption>
<!--<additionalJOption>&#45;&#45;no-module-directories</additionalJOption>-->
<doclint>none</doclint>
<quiet>true</quiet>
<debug>false</debug>
Expand Down
2 changes: 1 addition & 1 deletion dist/midpoint-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<quiet>false</quiet>
<debug>false</debug>
<doclint>none</doclint>
<additionalJOption>--no-module-directories</additionalJOption>
<!--<additionalJOption>&#45;&#45;no-module-directories</additionalJOption>-->

<!--
TODO: Not usable yet, see https://github.com/asciidoctor/asciidoclet/pull/96 for the progress on JDK 11 support.
Expand Down
17 changes: 12 additions & 5 deletions gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
</dependency>
<dependency>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-extensions</artifactId>
Expand Down Expand Up @@ -206,7 +202,7 @@
</exclusion>
<exclusion>
<!-- unused library -->
<groupId>org.webjars</groupId>
<groupId>org.webjars.npm</groupId>
<artifactId>handlebars</artifactId>
</exclusion>
<exclusion>
Expand All @@ -218,6 +214,11 @@
<groupId>com.darrinholst</groupId>
<artifactId>sass-java-gems</artifactId>
</exclusion>
<exclusion>
<!-- unused library -->
<groupId>org.webjars.npm</groupId>
<artifactId>jshint</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -632,6 +633,12 @@
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-security-impl</artifactId>
<exclusions>
<exclusion>
<groupId>org.cryptacular</groupId>
<artifactId>cryptacular</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import org.apache.wicket.ajax.attributes.ThrottlingSettings;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings;
import org.apache.wicket.util.time.Duration;

import java.time.Duration;

/**
* @author semancik
Expand All @@ -37,7 +38,7 @@ public void onClick(AjaxRequestTarget target) {
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
AutoCompleteSettings settings = createAutoCompleteSettings();
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.milliseconds(settings.getThrottleDelay()), true));
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.ofMillis(settings.getThrottleDelay()), true));
}
};
add(showChoices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package com.evolveum.midpoint.gui.api.component.autocomplete;

import java.time.Duration;
import java.util.Iterator;

import org.apache.wicket.ajax.AjaxRequestTarget;
Expand All @@ -19,7 +20,6 @@
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.model.IModel;
import org.apache.wicket.util.convert.IConverter;
import org.apache.wicket.util.time.Duration;

import com.evolveum.midpoint.web.model.LookupPropertyModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType;
Expand Down Expand Up @@ -82,7 +82,7 @@ protected void onUpdate(AjaxRequestTarget target) {
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
AutoCompleteSettings settings = createAutoCompleteSettings();
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.milliseconds(settings.getThrottleDelay()), true));
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.ofMillis(settings.getThrottleDelay()), true));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package com.evolveum.midpoint.gui.api.component.password;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
Expand All @@ -27,7 +28,6 @@
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.util.time.Duration;
import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.ValidationError;
Expand Down Expand Up @@ -214,7 +214,7 @@ protected void onUpdate(AjaxRequestTarget target) {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.milliseconds(500), true));
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.ofMillis(500), true));
attributes.setChannel(new AjaxChannel("Drop", AjaxChannel.Type.DROP));
}
});
Expand All @@ -232,7 +232,7 @@ protected void onUpdate(AjaxRequestTarget target) {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.milliseconds(500), true));
attributes.setThrottlingSettings(new ThrottlingSettings(Duration.ofMillis(500), true));
attributes.setChannel(new AjaxChannel("Drop", AjaxChannel.Type.DROP));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
import org.apache.wicket.request.resource.ContentDisposition;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.time.Duration;

import java.time.Duration;

public abstract class AbstractAjaxDownloadBehavior extends AbstractAjaxBehavior {

Expand Down Expand Up @@ -60,7 +61,7 @@ public void respond(IRequestCycle requestCycle) {
super.respond(requestCycle);
}
}.setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND);
.setCacheDuration(Duration.ofSeconds(1));
if (StringUtils.isNotEmpty(getFileName())){
reqHandler.setFileName(getFileName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import org.apache.wicket.util.file.Files;
import org.apache.wicket.util.resource.FileResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.time.Duration;

import java.time.Duration;

public abstract class AjaxDownloadBehaviorFromFile extends AbstractAjaxBehavior {

Expand Down Expand Up @@ -70,7 +71,7 @@ public void respond(IRequestCycle requestCycle) {
}
}
}.setFileName(file.getName()).setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND));
.setCacheDuration(Duration.ofSeconds(1)));
}

public void setContentType(String contentType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.evolveum.midpoint.web.component.search;

import java.io.Serializable;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -53,7 +54,6 @@
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.util.time.Duration;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
Expand Down Expand Up @@ -568,7 +568,7 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);

attributes.setThrottlingSettings(
new ThrottlingSettings(ID_ADVANCED_AREA, Duration.milliseconds(500), true));
new ThrottlingSettings(ID_ADVANCED_AREA, Duration.ofMillis(500), true));
}
});
advancedArea.add(AttributeAppender.append("placeholder", getPageBase().createStringResource("SearchPanel.insertFilterXml")));
Expand All @@ -589,7 +589,7 @@ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);

attributes.setThrottlingSettings(
new ThrottlingSettings(ID_AXIOM_QUERY_FIELD, Duration.milliseconds(500), true));
new ThrottlingSettings(ID_AXIOM_QUERY_FIELD, Duration.ofMillis(500), true));
attributes.setChannel(new AjaxChannel("Drop", AjaxChannel.Type.DROP));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.wizard.*;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.IFormSubmittingComponent;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

/**
* @author lazyman
*/
public class WizardButtonBar extends Panel implements IDefaultButtonProvider {
public class WizardButtonBar extends Panel{

private static final String ID_PREVIOUS = "previous";
private static final String ID_NEXT = "next";
Expand Down Expand Up @@ -181,21 +179,21 @@ private void couldntSave() {
getPage().setResponsePage(getPage());
}

@Override
public IFormSubmittingComponent getDefaultButton(IWizardModel model) {

if (model.isNextAvailable()){
return (IFormSubmittingComponent)get("next");
}

else if (model.isLastAvailable()){
return (IFormSubmittingComponent)get("last");
}

else if (model.isLastStep(model.getActiveStep())){
return (IFormSubmittingComponent)get("finish");
}

return null;
}
// @Override
// public IFormSubmittingComponent getDefaultButton(IWizardModel model) {
//
// if (model.isNextAvailable()){
// return (IFormSubmittingComponent)get("next");
// }
//
// else if (model.isLastAvailable()){
// return (IFormSubmittingComponent)get("last");
// }
//
// else if (model.isLastStep(model.getActiveStep())){
// return (IFormSubmittingComponent)get("finish");
// }
//
// return null;
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ public Class<? extends PageBase> getHomePage() {
public void init() {
super.init();

getCspSettings().blocking().disabled();

getJavaScriptLibrarySettings().setJQueryReference(
new PackageResourceReference(MidPointApplication.class,
"../../../../../webjars/AdminLTE/2.4.18/bower_components/jquery/dist/jquery.min.js")); //todo no jquery.js is found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.security.config.annotation.web.HttpSecurityBuilder;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.config.annotation.web.configurers.SecurityContextConfigurer;
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
import org.springframework.security.web.context.SecurityContextRepository;
import org.springframework.security.web.session.InvalidSessionStrategy;
Expand Down Expand Up @@ -42,7 +43,7 @@ public void configure(H http) throws Exception {
MidpointAuthFilter mpFilter = postProcess(new MidpointAuthFilter(sharedObjects));
mpFilter.createFilterForAuthenticatedRequest();
http.addFilterBefore(mpFilter, SessionManagementFilter.class);
http.addFilterBefore(new TranslateExceptionFilter(), MidpointAuthFilter.class);
http.addFilterAfter(new TranslateExceptionFilter(), AnonymousAuthenticationFilter.class);
}

private void setSharedObject(Map<Class<? extends Object>, Object> sharedObjects, H http, Class<? extends Object> clazz) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.evolveum.midpoint.web.security.AuditedLogoutHandler;
import com.evolveum.midpoint.web.security.WicketLoginUrlAuthenticationEntryPoint;
import com.evolveum.midpoint.web.security.module.configuration.LoginFormModuleWebSecurityConfiguration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.security.cas.web.CasAuthenticationFilter;
Expand Down Expand Up @@ -76,8 +77,7 @@ protected void configure(HttpSecurity http) throws Exception {
.authenticationEntryPoint(new WicketLoginUrlAuthenticationEntryPoint("/login"));

http.logout().clearAuthentication(true)
.logoutRequestMatcher(getLogoutMatcher(http, getPrefix() +"/logout"))
// .logoutUrl(stripEndingSlases(getPrefix()) +"/logout")
.logoutRequestMatcher(getLogoutMatcher(http, getPrefix() + "/logout"))
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID")
.logoutSuccessHandler(createLogoutHandler());
Expand All @@ -87,7 +87,7 @@ protected void configure(HttpSecurity http) throws Exception {
http.addFilterBefore(requestSingleLogoutFilter, LogoutFilter.class);
}

if (Arrays.stream(environment.getActiveProfiles()).anyMatch(p -> p.equalsIgnoreCase("ssoenv"))) {
if (Arrays.stream(environment.getActiveProfiles()).anyMatch(p -> p.equalsIgnoreCase("ssoenv"))) {
http.addFilterBefore(requestAttributeAuthenticationFilter, LogoutFilter.class);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
import com.evolveum.midpoint.web.security.module.configuration.SamlModuleWebSecurityConfiguration;
import com.evolveum.midpoint.web.security.util.SecurityUtils;

import org.springframework.security.web.savedrequest.RequestCacheAwareFilter;
import org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter;

/**
* @author skublik
*/
Expand Down Expand Up @@ -82,21 +85,21 @@ protected void configure(HttpSecurity http) throws Exception {
getBeanConfiguration().samlConfigurationFilter(),
BasicAuthenticationFilter.class
)
.addFilterAfter(
.addFilterBefore(
getBeanConfiguration().spMetadataFilter(),
getBeanConfiguration().samlConfigurationFilter().getClass()
RequestCacheAwareFilter.class
)
.addFilterAfter(
.addFilterAt(
getBeanConfiguration().spAuthenticationRequestFilter(),
getBeanConfiguration().spMetadataFilter().getClass()
RequestCacheAwareFilter.class
)
.addFilterAfter(
getBeanConfiguration().spAuthenticationResponseFilter(),
getBeanConfiguration().spAuthenticationRequestFilter().getClass()
RequestCacheAwareFilter.class
)
.addFilterAfter(
.addFilterBefore(
getBeanConfiguration().spSamlLogoutFilter(),
getBeanConfiguration().spAuthenticationResponseFilter().getClass()
SecurityContextHolderAwareRequestFilter.class
);
}

Expand Down

This file was deleted.

0 comments on commit 74fcbf3

Please sign in to comment.