Skip to content

Commit

Permalink
Merge branch 'master' into DP-enable-totalresults-by-user-count
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaura committed Mar 29, 2024
2 parents 0e094f3 + 525a7fd commit cf636c7
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 65 deletions.
2 changes: 1 addition & 1 deletion components/org.wso2.carbon.identity.scim2.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.wso2.carbon.identity.scim2.common.utils.AttributeMapper;
import org.wso2.carbon.identity.scim2.common.utils.SCIMCommonConstants;
import org.wso2.carbon.identity.scim2.common.utils.SCIMCommonUtils;
import org.wso2.carbon.identity.scim2.common.utils.Scenarios;
import org.wso2.carbon.user.api.ClaimMapping;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.PaginatedUserStoreManager;
Expand Down Expand Up @@ -6399,10 +6398,10 @@ private void publishEvent(User user, String eventName, boolean isAdminUpdate)
properties.put(IdentityEventConstants.EventProperty.CREDENTIAL, user.getPassword());
if (isAdminUpdate) {
properties.put(IdentityEventConstants.EventProperty.SCENARIO,
Scenarios.CREDENTIAL_UPDATE_BY_ADMIN_VIA_CONSOLE.name());
IdentityEventConstants.EventProperty.Scenario.ScenarioTypes.POST_CREDENTIAL_UPDATE_BY_ADMIN);
} else {
properties.put(IdentityEventConstants.EventProperty.SCENARIO,
Scenarios.CREDENTIAL_UPDATE_BY_USER_VIA_MY_ACCOUNT.name());
IdentityEventConstants.EventProperty.Scenario.ScenarioTypes.POST_CREDENTIAL_UPDATE_BY_USER);
}

Event identityMgtEvent = new Event(eventName, properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,9 @@ public static void updateSystemRoleV2MetaData(int tenantId) {
*/
public static String getLoggedInUserID() throws CharonException {

if (PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId() != null) {
return PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserId();
}
try {
String loggedInUserName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
String loggedInUserTenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion components/org.wso2.carbon.identity.scim2.provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<relativePath> ../../pom.xml</relativePath>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ public Response getUser(@HeaderParam(SCIMProviderConstants.ACCEPT_HEADER) String
throw new FormatNotSupportedException(error);
}

// Validates the count parameter if exists.
if (count != null && IdentityUtil.isSCIM2UserMaxItemsPerPageEnabled()) {
count = validateCountParameter(count);
}

// obtain the user store manager
UserManager userManager = IdentitySCIMManager.getInstance().getUserManager();

Expand Down Expand Up @@ -392,4 +397,24 @@ private void removeAskPasswordConfirmationCodeThreadLocal() {
IdentityUtil.threadLocalProperties.get()
.remove(IdentityRecoveryConstants.AP_CONFIRMATION_CODE_THREAD_LOCAL_PROPERTY);
}

/**
* Validate the count query parameter.
*
* @param count Requested item count.
* @return Validated count parameter.
*/
private int validateCountParameter(Integer count) {

int maximumItemsPerPage = IdentityUtil.getMaximumItemPerPage();
if (count > maximumItemsPerPage) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Given limit exceeds the maximum limit. Therefore the limit is set to %s.",
maximumItemsPerPage));
}
return maximumItemsPerPage;
}

return count;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.identity.inbound.provisioning.scim2</groupId>
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<artifactId>identity-inbound-provisioning-scim2</artifactId>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<version>3.4.72-SNAPSHOT</version>
<version>3.4.76-SNAPSHOT</version>
<name>WSO2 Carbon - SCIM Provisioning Module</name>
<description>
SCIM 2.0 Implementation for C4
Expand Down Expand Up @@ -285,11 +285,11 @@
<inbound.auth.oauth.version>6.5.3</inbound.auth.oauth.version>
<commons-collections.version>3.2.0.wso2v1</commons-collections.version>
<carbon.kernel.version>4.10.10</carbon.kernel.version>
<identity.framework.version>7.0.89</identity.framework.version>
<identity.framework.version>7.0.112</identity.framework.version>
<junit.version>4.13.1</junit.version>
<commons.lang.version>20030203.000129</commons.lang.version>
<identity.governance.version>1.8.12</identity.governance.version>
<charon.version>4.0.17</charon.version>
<charon.version>4.0.18</charon.version>
<org.wso2.carbon.identity.organization.management.core.version>1.0.76
</org.wso2.carbon.identity.organization.management.core.version>
<org.wso2.carbon.identity.handler.event.account.lock.version>1.8.13
Expand Down

0 comments on commit cf636c7

Please sign in to comment.