Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Idle Account Suspension API to return disabled and non-disabled users #768

Merged

Conversation

KaveeshaPiumini
Copy link
Contributor

@KaveeshaPiumini KaveeshaPiumini commented Jan 7, 2025

Purpose

This PR enhance the getInactiveUsers API to:

  • Filtering disabled users from all inactive users for a given time period.
  • Filtering non-disabled users from all inactive users for a given time period.

Implementation

Implementation introduces a new queryParameter, filter, to decide on whether to include disabled users or exclude disabled users.
When filter=isDisabled eq true it returns all the inactive and disabled users for a given time period whose account state is DISABLED.
When filter=isDisabled eq false it returns all the inactive and non-disabled users for a given time period.

Tested in H2, MySQL, PostgreSQL, MSSQL, Oracle databases.

Example

Sample Request
https://localhost:9443/api/idle-account-identification/v1/inactive-users?inactiveAfter=2024-12-21&excludeBefore=2024-12-11&filter=isDisabled eq false

Sample Response

[
    {
        "userId": "a0b6793e-d996-4bc8-b600-ff8d3ce5fc9a",
        "username": "kim",
        "userStoreDomain": "PRIMARY"
    },
    {
        "userId": "c7d21584-483e-4177-a5e5-a7da6f3edef7",
        "username": "kimthree",
        "userStoreDomain": "PRIMARY"
    }
] 

Related Issue

Merge After

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12805340782

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12805340782
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12822674920

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12822674920
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12822674920

# Conflicts:
#	components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/src/main/java/org/wso2/carbon/identity/api/idle/account/identification/v1/impl/InactiveUsersApiServiceImpl.java
#	pom.xml
@KaveeshaPiumini KaveeshaPiumini force-pushed the Idle-Account-Suspension-API branch from 4a381a2 to 24667a5 Compare January 21, 2025 12:07
@sadilchamishka sadilchamishka merged commit 84720ae into wso2:master Jan 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants