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 #901

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KaveeshaPiumini
Copy link
Contributor

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 uses a boolean variable to decide on whether to include disabled users or exclude disabled users. This uses a nested query to get all the inactive users for a given time period and filters disabled or non-disabled users.

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

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 81.42857% with 13 lines in your changes missing coverage. Please review.

Project coverage is 51.14%. Comparing base (55bf5a4) to head (caa1213).

Files with missing lines Patch % Lines
...entity/governance/store/JDBCIdentityDataStore.java 91.48% 4 Missing ⚠️
...ces/impl/IdleAccountIdentificationServiceImpl.java 75.00% 3 Missing and 1 partial ⚠️
...y/governance/service/IdentityDataStoreService.java 0.00% 2 Missing ⚠️
...entity/governance/store/UserIdentityDataStore.java 0.00% 2 Missing ⚠️
...ion/services/IdleAccountIdentificationService.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #901      +/-   ##
============================================
+ Coverage     50.91%   51.14%   +0.23%     
- Complexity     2431     2445      +14     
============================================
  Files           298      300       +2     
  Lines         17979    18049      +70     
  Branches       2585     2591       +6     
============================================
+ Hits           9154     9232      +78     
+ Misses         7673     7663      -10     
- Partials       1152     1154       +2     
Flag Coverage Δ
unit 38.72% <81.42%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KaveeshaPiumini KaveeshaPiumini force-pushed the Idle-Account-Suspension-API branch 4 times, most recently from e35c0e1 to b7bf193 Compare January 8, 2025 03:49
@KaveeshaPiumini KaveeshaPiumini force-pushed the Idle-Account-Suspension-API branch from b7bf193 to caa1213 Compare January 8, 2025 04:58
@piraveena
Copy link
Contributor

trigger a PR builder before merging it

@jenkins-is-staging
Copy link

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12686165198
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/12686165198

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