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

Feature - Rule-based password expiry #841

Conversation

PasinduYeshan
Copy link
Contributor

@PasinduYeshan PasinduYeshan commented Jul 29, 2024

Proposed changes in this pull request

  • Updated the getConnectorListWithConfigs method to include properties whose names start with the connector name, even if there is no explicit mapping in the connector.
  • Added a new configuration passwordExpiry.skipIfNoApplicableRules to change the fallback behavior of rule-based password expiry. This configuration allows admin to choose whether to skip password expiration or apply the default password expiry days to all users if no specific rules are applicable.
  • Introduce rule-based password expiration.
    • Rule format: {priority},{expiryDays},{attribute},{operator},{comma separated values}

Sample Response:

{
        "id": "cGFzc3dvcmRFeHBpcnk",
        "name": "passwordExpiry",
        "category": "Password Policies",
        "friendlyName": "Password Expiry",
        "order": 0,
        "subCategory": "DEFAULT",
        "properties": [
            {
                "name": "passwordExpiry.rule1",
                "value": "1,0,groups,ne,9180e57a-ebf3-4594-b8bd-c8212c12d14f,75a823ae-a82c-428d-a068-7e17a08c720e",
                "description": "",
                "meta": {
                    "groupID": 0
                }
            },
            {
                "name": "passwordExpiry.rule2",
                "value": "3,40,roles,eq,12ec01e1-31e5-4a7d-aa45-8a485d10c8fa,cc40ad49-efdc-454b-8435-75fa1b627332",
                "description": "",
                "meta": {
                    "groupID": 0
                }
            },
            {
                "name": "passwordExpiry.skipIfNoApplicableRules",
                "value": "false",
                "displayName": "Skip password expiry if no applicable rules",
                "description": "Skip password expiry if no applicable rules are found for the user",
                "meta": {
                    "groupID": 0
                }
            },
            {
                "name": "passwordExpiry.passwordExpiryInDays",
                "value": "25",
                "displayName": "Password Expiry In Days",
                "description": "Number of days after which the password will expire",
                "meta": {
                    "groupID": 0
                }
            },
            {
                "name": "passwordExpiry.enablePasswordExpiry",
                "value": "true",
                "displayName": "Enable Password Expiry",
                "description": "Allow users to reset the password after configured number of days",
                "meta": {
                    "groupID": 0
                }
            }
        ]
    }

Related Issues

@PasinduYeshan PasinduYeshan marked this pull request as ready for review August 6, 2024 09:37
@jenkins-is-staging
Copy link

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

@PasinduYeshan
Copy link
Contributor Author

Issue mentioned in wso2/product-is#20865 is also addressed by this fix.

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@jenkins-is-staging
Copy link

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

@PasinduYeshan PasinduYeshan merged commit 0d6e57d into wso2-extensions:master Aug 20, 2024
3 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