Skip to content

Commit 9e3dbb1

Browse files
committed
Add review suggestions
1 parent 7638646 commit 9e3dbb1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

identity-apps-core/apps/authentication-portal/src/main/webapp/basicauth.jsp

+5-6
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
String resendUsername = request.getParameter("resend_username");
303303
String spProp = "sp";
304304
String spIdProp = "spId";
305-
String sp = request.getParameter("sp");
305+
String sp = Encode.forJava(request.getParameter("sp"));
306306
String spId = "";
307307
308308
try {
@@ -567,8 +567,7 @@
567567
String urlWithoutEncoding = null;
568568
try {
569569
ApplicationDataRetrievalClient applicationDataRetrievalClient = new ApplicationDataRetrievalClient();
570-
urlWithoutEncoding = applicationDataRetrievalClient.getApplicationAccessURL(tenantDomain,
571-
request.getParameter("sp"));
570+
urlWithoutEncoding = applicationDataRetrievalClient.getApplicationAccessURL(tenantDomain, sp);
572571
} catch (ApplicationDataRetrievalClientException e) {
573572
//ignored and fallback to login page url
574573
}
@@ -578,11 +577,11 @@
578577
String serverName = request.getServerName();
579578
int serverPort = request.getServerPort();
580579
String uri = (String) request.getAttribute(JAVAX_SERVLET_FORWARD_REQUEST_URI);
581-
String prmstr = URLDecoder.decode(((String) request.getAttribute(JAVAX_SERVLET_FORWARD_QUERY_STRING)), UTF_8);
580+
String paramStr = URLDecoder.decode(((String) request.getAttribute(JAVAX_SERVLET_FORWARD_QUERY_STRING)), UTF_8);
582581
if ((scheme == "http" && serverPort == HttpURL.DEFAULT_PORT) || (scheme == "https" && serverPort == HttpsURL.DEFAULT_PORT)) {
583-
urlWithoutEncoding = scheme + "://" + serverName + uri + "?" + prmstr;
582+
urlWithoutEncoding = scheme + "://" + serverName + uri + "?" + paramStr;
584583
} else {
585-
urlWithoutEncoding = scheme + "://" + serverName + ":" + serverPort + uri + "?" + prmstr;
584+
urlWithoutEncoding = scheme + "://" + serverName + ":" + serverPort + uri + "?" + paramStr;
586585
}
587586
}
588587
urlWithoutEncoding = IdentityManagementEndpointUtil.replaceUserTenantHintPlaceholder(

identity-apps-core/components/org.wso2.identity.apps.common/src/test/java/org/wso2/identity/apps/common/listener/AppPortalRoleManagementListenerTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ public void tearDown() throws Exception {
105105

106106
@DataProvider(name = "preUpdateUserListOfRoleDataProvider")
107107
public Object[][] preUpdateUserListOfRoleDataProvider() {
108-
return new Object[][]{
108+
109+
return new Object[][] {
110+
109111
// Test case where deletedUserIDList == null.
110112
{roleId, Collections.emptyList(), null, tenantDomain, isAdminRole, !isOrganization, adminUserId},
111113

@@ -143,7 +145,7 @@ public void testPreUpdateUserListOfRole(String roleId, List<String> newUserIDLis
143145
when(roleManagementService.getRoleBasicInfoById(roleId, tenantDomain)).thenReturn(role);
144146
setRoleAttributes(isAdminRole);
145147

146-
// Call the method.
148+
// Invoke pre-update method for updating the user list of a role.
147149
if (!isAdminRole || deletedUserIDList == null || isOrganization || !deletedUserIDList.contains(adminUserId)) {
148150
appPortalRoleManagementListener.preUpdateUserListOfRole(roleId, newUserIDList, deletedUserIDList,
149151
tenantDomain);

0 commit comments

Comments
 (0)