Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/mid-7053
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 22, 2021
2 parents f9b9529 + 03ce167 commit d98dea9
Show file tree
Hide file tree
Showing 126 changed files with 3,008 additions and 2,022 deletions.
30 changes: 20 additions & 10 deletions gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,24 @@
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-saml2-service-provider</artifactId>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-core</artifactId>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-saml-api</artifactId>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-security-api</artifactId>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-xmlsec-api</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
Expand Down Expand Up @@ -637,14 +653,8 @@
<artifactId>openjson</artifactId>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml-security-impl</artifactId>
<exclusions>
<exclusion>
<groupId>org.cryptacular</groupId>
<artifactId>cryptacular</artifactId>
</exclusion>
</exclusions>
<groupId>net.shibboleth.utilities</groupId>
<artifactId>java-support</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collect
CompositedIconBuilder builder = new CompositedIconBuilder();

builder.setBasicIcon(WebComponentUtil.getIconCssClass(additionalButtonDisplayType), IconCssStyle.IN_ROW_STYLE)
.appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType));
.appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType))
.setTitle(WebComponentUtil.getTranslatedPolyString(additionalButtonDisplayType.getTooltip()));
// .appendLayerIcon(WebComponentUtil.createIconType(GuiStyleConstants.CLASS_PLUS_CIRCLE, "green"), IconCssStyle.BOTTOM_RIGHT_STYLE);

return builder.build();
Expand Down Expand Up @@ -238,7 +239,8 @@ protected MultiFunctinalButtonDto load() {
});
}

if (!(isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget()) && getNewObjectGenericButtonVisibility()) {
if (!(isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget())
&& getNewObjectGenericButtonVisibility() && isGenericNewButtonVisible()) {
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
DisplayType defaultButtonDisplayType = getNewObjectButtonSpecialDisplayType();
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
Expand All @@ -260,6 +262,10 @@ protected MultiFunctinalButtonDto load() {

}

protected boolean isGenericNewButtonVisible() {
return true;
}

@Override
protected List<IColumn<SelectableBean<O>, String>> createDefaultColumns() {
GuiObjectListViewType defaultView = DefaultColumnUtils.getDefaultView(getType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public enum PageTypes {
ARCHETYPE("archetypes", GuiStyleConstants.EVO_ARCHETYPE_TYPE_ICON, PageArchetypes.class, PageArchetype.class, com.evolveum.midpoint.web.page.admin.archetype.PageArchetype.class, ArchetypeType.COMPLEX_TYPE),
OBJECT_COLLECTION("objectCollections", GuiStyleConstants.CLASS_OBJECT_COLLECTION_ICON, PageObjectCollections.class, PageObjectCollection.class, com.evolveum.midpoint.web.page.admin.objectCollection.PageObjectCollection.class, ObjectCollectionType.COMPLEX_TYPE),
OBJECT_TEMPLATE("objectTemplates", GuiStyleConstants.CLASS_OBJECT_TEMPLATE_ICON, PageObjectTemplates.class, PageObjectTemplate.class, com.evolveum.midpoint.web.page.admin.objectTemplate.PageObjectTemplate.class, ObjectTemplateType.COMPLEX_TYPE),
REPORT("reports", GuiStyleConstants.CLASS_REPORT_ICON, PageReports .class, PageReport.class, com.evolveum.midpoint.web.page.admin.reports.PageReport.class, ReportType.COMPLEX_TYPE);
REPORT("reports", GuiStyleConstants.CLASS_REPORT_ICON, PageReports.class, PageReport.class, com.evolveum.midpoint.web.page.admin.reports.PageReport.class, ReportType.COMPLEX_TYPE);

private String identifier;
private String icon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ protected DetailsFragment createDetailsFragment() {
protected void initFragmentLayout() {
add(initSummaryPanel());
MidpointForm form = new MidpointForm(ID_MAIN_FORM);
form.setMultiPart(true);
add(form);

initButtons(form);
Expand Down Expand Up @@ -241,8 +242,14 @@ public Collection<ObjectDeltaOperation<? extends ObjectType>> saveOrPreviewPerfo

LOGGER.trace("returning from saveOrPreviewPerformed");
Collection<ObjectDeltaOperation<? extends ObjectType>> executedDeltas = executeChanges(deltas, previewOnly, options, task, result, target);
// result.computeStatusIfUnknown();
// showResult(result);

result.computeStatusIfUnknown();
showResult(result);
if (!previewOnly && result.isSuccess()) {
redirectBack();
} else {
target.add(getFeedbackPanel());
}
return executedDeltas;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected void initLayout() {
reportTable.setOutputMarkupId(true);

WebMarkupContainer tableBox = new WebMarkupContainer(ID_TABLE_BOX);
tableBox.add(new VisibleBehaviour(() -> getOperationalButtonsPanel().isShowingPreview() && reportTable.hasView()));
tableBox.add(new VisibleBehaviour(() -> getOperationalButtonsPanel() != null && getOperationalButtonsPanel().isShowingPreview() && reportTable.hasView()));
tableBox.setOutputMarkupId(true);
tableContainer.add(tableBox);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package com.evolveum.midpoint.web.boot;

import org.apache.commons.lang3.StringUtils;
import org.jasig.cas.client.validation.TicketValidator;
//import org.jasig.cas.client.validation.TicketValidator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ public class UploadDownloadPanel extends InputPanel {
private static final String DOWNLOAD_CONTENT_TYPE = "text/plain";

private final String downloadFileName = null;
private boolean isReadOnly;

public UploadDownloadPanel(String id, boolean isReadOnly) {
super(id);
initLayout(isReadOnly);
this.isReadOnly = isReadOnly;
}

private void initLayout(final boolean isReadOnly) {
@Override
protected void onInitialize() {
super.onInitialize();
initLayout();
}

private void initLayout() {
final FileUploadField fileUpload = new FileUploadField(ID_INPUT_FILE) {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private void initLayout() {
add(mainForm);

MainObjectListPanel<ReportType> table = new MainObjectListPanel<ReportType>(ID_TABLE, ReportType.class) {

private static final long serialVersionUID = 1L;

@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_REPORTS;
Expand All @@ -98,6 +99,11 @@ protected IColumn<SelectableBean<ReportType>, String> createCheckboxColumn() {
protected List<InlineMenuItem> createInlineMenu() {
return PageReports.this.createInlineMenu();
}

@Override
protected boolean isGenericNewButtonVisible() {
return false;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

import static org.springframework.security.saml.util.StringUtils.stripSlashes;

/**
* @author mserbak
* @author lskublik
Expand Down Expand Up @@ -189,7 +187,7 @@ private String getUrlProcessingLogin() {
&& (moduleAuthentication instanceof LoginFormModuleAuthentication
|| moduleAuthentication instanceof LdapModuleAuthentication)){
String prefix = moduleAuthentication.getPrefix();
return stripSlashes(prefix) + "/spring_security_login";
return SecurityUtils.stripSlashes(prefix) + "/spring_security_login";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.ArrayList;
import java.util.List;

import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.web.component.form.MidpointForm;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.security.util.SecurityUtils;
Expand All @@ -32,7 +31,7 @@
import com.evolveum.midpoint.web.security.module.authentication.Saml2ModuleAuthentication;
import com.evolveum.midpoint.web.security.util.IdentityProvider;

import org.springframework.security.saml.SamlAuthentication;
import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken;

/**
* @author skublik
Expand Down Expand Up @@ -74,9 +73,9 @@ protected void populateItem(ListItem<IdentityProvider> item) {

private boolean existSamlAuthentication(ModuleAuthentication actualModule) {
return actualModule instanceof Saml2ModuleAuthentication
&& (actualModule.getAuthentication() instanceof SamlAuthentication
&& (actualModule.getAuthentication() instanceof Saml2AuthenticationToken
|| (actualModule.getAuthentication() instanceof AnonymousAuthenticationToken
&& actualModule.getAuthentication().getDetails() instanceof SamlAuthentication));
&& actualModule.getAuthentication().getDetails() instanceof Saml2AuthenticationToken));
}

private List<IdentityProvider> getProviders() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
import java.util.ArrayList;
import java.util.List;

import static org.springframework.security.saml.util.StringUtils.stripSlashes;

/**
* @author lskublik
*/
Expand Down Expand Up @@ -379,7 +377,7 @@ private String getUrlProcessingLogin() {
ModuleAuthentication moduleAuthentication = mpAuthentication.getProcessingModuleAuthentication();
if (moduleAuthentication != null && moduleAuthentication instanceof SecurityQuestionFormModuleAuthentication){
String prefix = ((SecurityQuestionFormModuleAuthentication) moduleAuthentication).getPrefix();
return stripSlashes(prefix) + "/spring_security_login";
return SecurityUtils.stripSlashes(prefix) + "/spring_security_login";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse resp
auditEvent(request, authentication);
}

private void auditEvent(HttpServletRequest request, Authentication authentication) {
protected void auditEvent(HttpServletRequest request, Authentication authentication) {
OperationResult result = new OperationResult(OP_AUDIT_EVENT); // Eventually we should get this from the caller

MidPointPrincipal principal = SecurityUtils.getPrincipalUser(authentication);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*/
package com.evolveum.midpoint.web.security;

import static org.springframework.security.saml.util.StringUtils.stripSlashes;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.evolveum.midpoint.security.api.SecurityUtil;

import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
Expand All @@ -39,7 +39,7 @@ public class MidPointAuthenticationSuccessHandler extends SavedRequestAwareAuthe
private String prefix = "";

public MidPointAuthenticationSuccessHandler setPrefix(String prefix) {
this.prefix = "/" + stripSlashes(prefix) + "/";
this.prefix = "/" + SecurityUtils.stripSlashes(prefix) + "/";
return this;
}

Expand Down

0 comments on commit d98dea9

Please sign in to comment.