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

Add support for passwordExpiryTime in user claims on request #856

Conversation

PasinduYeshan
Copy link
Contributor

@PasinduYeshan PasinduYeshan commented Sep 10, 2024

Proposed changes in this pull request

  • Introduce new method to calculate password expiry time of a given user - getUserPasswordExpiryTime.
  • Introduce "PasswordExpiryEventListenerTest" to add passwordExpiryTime to user's claims map.

Related Issues

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 84.69388% with 15 lines in your changes missing coverage. Please review.

Project coverage is 50.76%. Comparing base (35e8681) to head (28c4788).
Report is 34 commits behind head on master.

Files with missing lines Patch % Lines
...tity/password/expiry/util/PasswordPolicyUtils.java 85.71% 2 Missing and 6 partials ⚠️
...d/expiry/listener/PasswordExpiryEventListener.java 87.50% 1 Missing and 4 partials ⚠️
...expiry/internal/EnforcePasswordResetComponent.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #856      +/-   ##
============================================
+ Coverage     50.32%   50.76%   +0.43%     
- Complexity     2385     2428      +43     
============================================
  Files           297      298       +1     
  Lines         17899    17887      -12     
  Branches       2558     2537      -21     
============================================
+ Hits           9008     9080      +72     
+ Misses         7747     7662      -85     
- Partials       1144     1145       +1     
Flag Coverage Δ
unit 38.41% <84.69%> (+0.48%) ⬆️

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.

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@PasinduYeshan PasinduYeshan changed the title Introduce method to return given user's password expiry time. Add support for passwordExpiryTime in user claims on request Dec 9, 2024
@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@PasinduYeshan
Copy link
Contributor Author

Failing with following error

Error:  The build could not read 4 projects -> [Help 1]
Error:    
Error:    The project org.wso2.carbon.identity.governance:org.wso2.carbon.identity.recovery.endpoint:1.11.23-SNAPSHOT (/home/runner/work/product-is/product-is/identity-governance/components/org.wso2.carbon.identity.recovery.endpoint/pom.xml) has 1 error
Error:      'dependencies.dependency.version' for org.springframework:spring-web:jar is missing. @ line 80, column 21
Error:    
Error:    The project org.wso2.carbon.identity.governance:org.wso2.carbon.identity.api.user.recovery:1.11.23-SNAPSHOT (/home/runner/work/product-is/product-is/identity-governance/components/org.wso2.carbon.identity.api.user.recovery/pom.xml) has 1 error
Error:      'dependencies.dependency.version' for org.springframework:spring-web:jar is missing. @ line 150, column 21
Error:    
Error:    The project org.wso2.carbon.identity.governance:org.wso2.carbon.identity.user.endpoint:1.11.23-SNAPSHOT (/home/runner/work/product-is/product-is/identity-governance/components/org.wso2.carbon.identity.user.endpoint/pom.xml) has 1 error
Error:      'dependencies.dependency.version' for org.springframework:spring-web:jar is missing. @ line 85, column 21
Error:    
Error:    The project org.wso2.carbon.identity.governance:org.wso2.carbon.identity.api.user.governance:1.11.23-SNAPSHOT (/home/runner/work/product-is/product-is/identity-governance/components/org.wso2.carbon.identity.api.user.governance/pom.xml) has 1 error
Error:      'dependencies.dependency.version' for org.springframework:spring-web:jar is missing. @ line 205, column 21
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

@jenkins-is-staging
Copy link

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

.put(PasswordPolicyConstants.PASSWORD_EXPIRY_TIME_CLAIM, String.valueOf(expiryTime)));
}
} catch (PostAuthenticationFailedException e) {
throw new UserStoreException("Error while retrieving password expiry time.", e);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check if these are logged.

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@PasinduYeshan PasinduYeshan merged commit 48c8969 into wso2-extensions:master Dec 14, 2024
5 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.

4 participants