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

Update the password length validation with Password max allowed length config. #7185

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Malith-19
Copy link
Contributor

@Malith-19 Malith-19 commented Dec 6, 2024

Purpose

With the introduction of new config for the password max allowed length, updated the validations with that config.

Related Issues

Related PRs

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.02%. Comparing base (aeeeed4) to head (95586aa).
Report is 72 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7185   +/-   ##
=======================================
  Coverage   32.02%   32.02%           
=======================================
  Files          41       41           
  Lines         893      893           
  Branches      204      216   +12     
=======================================
  Hits          286      286           
+ Misses        607      557   -50     
- Partials        0       50   +50     
Flag Coverage Δ
@wso2is/core 32.02% <ø> (ø)

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

see 14 files with indirect coverage changes

Comment on lines 6 to 7
"@wso2is/core": minor
"@wso2is/i18n": minor
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the changes to core and i18n are minor, let's add a separate changeset for those modules with patch version upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by 3f33e36

@@ -163,6 +163,7 @@ export class Config {
window["AppUtils"]?.getConfig()?.ui?.isMultipleEmailsAndMobileNumbersEnabled,
isPasswordInputValidationEnabled: window["AppUtils"]?.getConfig()?.ui?.isPasswordInputValidationEnabled,
isProfileUsernameReadonly: window["AppUtils"]?.getConfig()?.ui?.isProfileUsernameReadonly,
passwordPolicyConfigs: window[ "AppUtils" ]?.getConfig()?.ui?.passwordPolicyConfigs,
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't use this value anywhere in myaccount, do we? if it's not used, better not to add it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by 74c5553

.VALIDATION_CONFIGURATION_FORM_FIELD_CONSTRAINTS
.PASSWORD_MAX_LENGTH
}
maxLength={ maxPasswordValueLength }
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we need maxLength to be configured since the input is a number field?

@@ -99,6 +99,9 @@ export const ValidationConfigEditPage: FunctionComponent<MyAccountSettingsEditPa
state?.config?.ui?.features?.loginAndRegistration?.disabledFeatures);
const isRuleBasedPasswordExpiryDisabled: boolean = disabledFeatures?.includes("ruleBasedPasswordExpiry");
const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state?.config?.ui?.features);
const maxPasswordValue: number = useSelector((state: AppState) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const maxPasswordValue: number = useSelector((state: AppState) =>
const maxPasswordLength: number = useSelector((state: AppState) =>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by 00a3218 and renamed according to the support PR suggestion from kayathri.

@Malith-19 Malith-19 self-assigned this Dec 10, 2024
@wso2-jenkins-bot
Copy link
Contributor

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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