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 Mar 9, 2023
2 parents 4a4067a + c47b99e commit 96f78ec
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 22 deletions.
16 changes: 16 additions & 0 deletions dist/javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,20 @@
</plugin>
</plugins>
</build>

<profiles>
<!--
Fixes MID-8486 invalid "undefined" link in Javadoc search on JDK 11.
See also discussion under this answer: https://stackoverflow.com/a/52603413
-->
<profile>
<id>active-on-jdk-11</id>
<activation>
<jdk>11</jdk>
</activation>
<properties>
<javadoc.options>--no-module-directories</javadoc.options>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,6 @@ public static <O extends ObjectType> String getName(ObjectReferenceType ref, Pag
String name = getName(ref);
if (StringUtils.isEmpty(name) || name.equals(ref.getOid())) {
String oid = ref.getOid();
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions
.createCollection(GetOperationOptions.createNoFetch());
Class<O> type = (Class<O>) ObjectType.class;
PrismObject<O> object = WebModelServiceUtils.loadObject(type, oid, pageBase,
pageBase.createSimpleTask(operation), new OperationResult(operation));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import com.evolveum.midpoint.web.component.menu.top.LocaleTextPanel;

import com.evolveum.midpoint.xml.ns._public.common.common_3.AuthenticationSequenceModuleNecessityType;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.RestartResponseException;
Expand Down Expand Up @@ -161,19 +163,38 @@ private void showExceptionMessage() {
return;
}

String msg = ex.getMessage();
if (StringUtils.isEmpty(msg)) {
msg = "web.security.provider.unavailable";
}
if (showErrorMessage()) {
String msg = ex.getMessage();
if (StringUtils.isEmpty(msg)) {
msg = "web.security.provider.unavailable";
}

String[] msgs = msg.split(";");
for (String message : msgs) {
message = getLocalizationService().translate(message, null, getLocale(), message);
error(message);
String[] msgs = msg.split(";");
for (String message : msgs) {
message = getLocalizationService().translate(message, null, getLocale(), message);
error(message);
}
}
httpSession.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
}

private boolean showErrorMessage() {
return !previousPrecessedModuleHasRequisiteNecessity();
}

private boolean previousPrecessedModuleHasRequisiteNecessity() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication instanceof MidpointAuthentication) {
MidpointAuthentication mpAuthentication = (MidpointAuthentication) authentication;
int index = mpAuthentication.getIndexOfProcessingModule(false);
if (index > 0) {
ModuleAuthentication module = mpAuthentication.getAuthModules().get(index - 1).getBaseModuleAuthentication();
return AuthenticationSequenceModuleNecessityType.REQUISITE.equals(module.getNecessity());
}
}
return false;
}

@Override
protected void onBeforeRender() {
super.onBeforeRender();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
public class AssignmentsUtil {

public enum AssignmentTypeType {
CONSTRUCTION, ABSTRACT_ROLE, POLICY_RULE, FOCUS_MAPPING, PERSONA_CONSTRUCTION, ASSIGNMENT_RELATION;
CONSTRUCTION, ABSTRACT_ROLE, POLICY_RULE, FOCUS_MAPPING, PERSONA_CONSTRUCTION, ASSIGNMENT_RELATION
}

private static final Trace LOGGER = TraceManager.getTrace(AssignmentsUtil.class);
private static final String DOT_CLASS = AssignmentsUtil.class.getSimpleName() + ".";
private static final String OPERATION_LOAD_USER = DOT_CLASS + "loadObject";

public static AssignmentTypeType getAssignmentType(PrismContainerValueWrapper<AssignmentType> assignmentValueWrapper) {
if (assignmentValueWrapper == null) {
Expand Down Expand Up @@ -168,7 +170,7 @@ private static IModel<String> createTimeIntervalStatusMessage(TimeIntervalStatus
}

public static IModel<Date> createDateModel(final IModel<XMLGregorianCalendar> model) {
return new Model<Date>() {
return new Model<>() {

@Override
public Date getObject() {
Expand All @@ -191,7 +193,7 @@ public void setObject(Date object) {
}

public static IModel<String> createAssignmentStatusClassModel(final UserDtoStatus model) {
return new IModel<String>() {
return new IModel<>() {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -202,7 +204,7 @@ public String getObject() {
}

public static IModel<String> createAssignmentIconTitleModel(BasePanel panel, AssignmentEditorDtoType type) {
return new IModel<String>() {
return new IModel<>() {
private static final long serialVersionUID = 1L;

@Override
Expand Down Expand Up @@ -276,7 +278,7 @@ public static String getName(AssignmentType assignment, PageBase pageBase) {
// account assignment through account construction
ConstructionType construction = assignment.getConstruction();
if (construction.getResourceRef() != null) {
sb.append(WebComponentUtil.getName(construction.getResourceRef(), true));
sb.append(WebComponentUtil.getName(construction.getResourceRef(), pageBase, OPERATION_LOAD_USER));
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo
saveException(request, exception);
getRedirectStrategy().sendRedirect(request, response, mpAuthentication.getAuthenticationChannel().getPathDuringProccessing());
return;
} else {
moduleAuthentication.recordFailure(exception);
saveException(request, mpAuthentication.getAuthenticationExceptionIfExsits());
getRedirectStrategy().sendRedirect(request, response, mpAuthentication.getAuthenticationChannel().getPathAfterUnsuccessfulAuthentication());
}
moduleAuthentication.recordFailure(exception);
saveException(request, mpAuthentication.getAuthenticationExceptionIfExsits());
}

saveException(request, exception);
Expand Down
5 changes: 0 additions & 5 deletions tools/jenkins/midpoint-conntest-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ podTemplate(
activeDeadlineSeconds: 7200,
idleMinutes: 1,
workspaceVolume: dynamicPVC(requestsSize: "20Gi"),
yaml:'''
spec:
securityContext:
fsGroup: 1000
''',
containers: [
containerTemplate(name: 'jnlp',
image: 'jenkins/inbound-agent:4.10-3-alpine',
Expand Down

0 comments on commit 96f78ec

Please sign in to comment.