Merge pull request #2365 from alberto-art3ch/enhancement/user_password_regular_expression_repeating_characters

User password regular expression to validate consecutive repeating ch…
This commit is contained in:
Jose Alberto Hernandez
2025-03-27 22:19:06 -05:00
committed by GitHub
11 changed files with 17 additions and 82 deletions
+1
View File
@@ -180,6 +180,7 @@ Available languages:
| MIFOS_DEFAULT_CHAR_DELIMITER | Character delimiter for CSV exports | , |
| MIFOS_WAIT_TIME_FOR_NOTIFICATIONS | Wait time in seconds for reading notifications | 60 |
| MIFOS_WAIT_TIME_FOR_CATCHUP | Wait time in seconds for reading COB Catch-Up status | 30 |
| MIFOS_MIN_PASSWORD_LENGTH | WMinimum length for user passwords | 12 |
#### UI Display Settings
@@ -114,38 +114,4 @@ export class AccountTransfersService {
getViewAccountTransferDetails(transferId: any): Observable<any> {
return this.http.get(`/accounttransfers/${transferId}`);
}
getAccountByNumber(accountNumber: string, currency: string): Observable<any> {
const payload = {
partyId: accountNumber,
partyIdType: 'MSISDN',
currencyCode: currency
};
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
return this.http
.post(
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/participant`,
JSON.stringify(payload),
{ headers }
)
.pipe(
switchMap((participant: any) => {
const body = JSON.stringify({ ...payload, ownerFspId: participant.fspId });
return this.http.post(
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/partyinfo`,
body,
{ headers }
);
})
);
}
sendInterbankTransfer(body: any): Observable<any> {
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
return this.http.post(
`${environment.vNextApiUrl}${environment.vNextApiVersion}${environment.vNextApiProvider}/executetransfer`,
body,
{ headers }
);
}
}
@@ -318,31 +318,7 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit {
},
note: this.makeAccountTransferForm.controls.transferDescription.value
};
this.accountTransfersService.sendInterbankTransfer(JSON.stringify(payload)).subscribe(
(trnsfr) => {
if (trnsfr.systemMessage) {
this.isLoading = false;
this.router.navigate(['../../transactions'], { relativeTo: this.route });
}
},
(error) => {
this.isLoading = false;
}
);
}
searchAccountByNumber() {
this.isLoading = true;
this.accountTransfersService
.getAccountByNumber(this.phoneAccount, this.accountTransferTemplateData.currency.code)
.subscribe(
(acc) => {
this.interbankTransferForm = true;
this.createMakeAccountInterbankTransferForm(acc);
},
(error) => {
this.isLoading = false;
}
);
}
searchAccountByNumber() {}
}
@@ -84,7 +84,7 @@
{{ 'labels.commons.Password should include a' | translate }}
<strong>{{ 'labels.commons.numeral' | translate }}</strong> {{ 'labels.commons.and at' | translate }}
<strong>{{ 'labels.commons.least one uppercase' | translate }}</strong>
,<strong>{{ 'labels.commons.lowercase and special character' | translate }}</strong>
, <strong>{{ 'labels.commons.lowercase and special character' | translate }}</strong>
</mat-error>
</mat-form-field>
+3 -2
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { AbstractControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms';
import { environment } from 'environments/environment';
import { Subscription } from 'rxjs';
@Injectable({
@@ -7,14 +8,14 @@ import { Subscription } from 'rxjs';
})
export class PasswordsUtility {
// password regex pattern
public static PASSWORD_REGEX = '^(?!.*(.)\\1)(?!.*\\s)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\\w\\s]).{12,50}$';
public static PASSWORD_REGEX = '^(?!.*(.)\\1{1,})(?!.*\\s)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\\w\\s]).{12,50}$';
public getPasswordValidators(): ValidatorFn[] {
return [
Validators.required,
Validators.pattern(PasswordsUtility.PASSWORD_REGEX),
Validators.maxLength(50),
Validators.minLength(8)];
Validators.minLength(environment.minPasswordLength)];
}
/**
@@ -85,7 +85,7 @@ export class SavingsAccountViewComponent implements OnInit {
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
});
}
if (this.savingsAccountData.externalId && environment.interbankTransfers === 'true') {
if (this.savingsAccountData.externalId) {
this.buttonConfig.addOption({
name: 'Interbank Transfer',
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
@@ -39,9 +39,8 @@
>
{{ 'labels.commons.Password should include a' | translate }}
<strong>{{ 'labels.commons.numeral' | translate }}</strong> {{ 'labels.commons.and at' | translate }}
<strong>{{ 'labels.commons.least one uppercase' | translate }}</strong> ,<strong>{{
'labels.commons.lowercase and special character' | translate
}}</strong>
<strong>{{ 'labels.commons.least one uppercase' | translate }}</strong
>, <strong>{{ 'labels.commons.lowercase and special character' | translate }}</strong>
</mat-error>
</mat-form-field>
+2 -4
View File
@@ -44,9 +44,7 @@
// OAuth Client Id
window['env']['oauthAppId'] = '';
window["env"]["vNextApiUrl"] = '';
window["env"]["vNextApiProvider"] = '';
window["env"]["vNextApiVersion"] = '';
window["env"]["interbankTransfers"] = "false";
// Min Password length
window['env']['minPasswordLength'] = '12';
})(this);
+2 -4
View File
@@ -44,8 +44,6 @@
// OAuth Client Id
window['env']['oauthAppId'] = '$MIFOS_OAUTH_CLIENT_ID';
window['env']['vNextApiUrl'] = '$VNEXT_API_URL';
window['env']['vNextApiProvider'] = '$VNEXT_API_PROVIDER';
window['env']['vNextApiVersion'] = '$VNEXT_API_VERSION';
window['env']['interbankTransfers'] = '$VNEXT_INTERBANK_TRANSFERS';
// Min Password length
window['env']['minPasswordLength'] = '$MIFOS_MIN_PASSWORD_LENGTH';
})(this);
+2 -4
View File
@@ -51,10 +51,8 @@ export const environment = {
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
}
},
vNextApiUrl: window['env']['vNextApiUrl'] || 'https://apis.flexcore.mx',
vNextApiProvider: window['env']['vNextApiProvider'] || '/vnext1',
vNextApiVersion: window['env']['vNextApiVersion'] || '/v1.0',
interbankTransfers: window['env']['interbankTransfers'] || false
minPasswordLength: loadedEnv['minPasswordLength'] || 12
};
// Server URL
+2 -4
View File
@@ -55,10 +55,8 @@ export const environment = {
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
}
},
vNextApiUrl: window['env']['vNextApiUrl'] || 'https://apis.flexcore.mx',
vNextApiProvider: window['env']['vNextApiProvider'] || '/vnext1',
vNextApiVersion: window['env']['vNextApiVersion'] || '/v1.0',
interbankTransfers: window['env']['interbankTransfers'] || false
minPasswordLength: loadedEnv['minPasswordLength'] || 12
};
// Server URL