Add validation to ensure maximum vault timeout is larger than 0 (#1215)

This commit is contained in:
Oscar Hinton 2021-10-06 17:27:55 +02:00 committed by GitHub
parent 998d36a5d1
commit 4ff38c7148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -60,6 +60,11 @@ export class MaximumVaultTimeoutPolicyComponent extends BasePolicyComponent {
throw new Error(this.i18nService.t('requireSsoPolicyReqError'));
}
const data = this.buildRequestData();
if (data?.minutes == null || data?.minutes <= 0) {
throw new Error(this.i18nService.t('invalidMaximumVaultTimeout'));
}
return super.buildRequest(policiesEnabledMap);
}
}

View File

@ -4290,6 +4290,9 @@
"maximumVaultTimeoutLabel": {
"message": "Maximum Vault Timeout"
},
"invalidMaximumVaultTimeout": {
"message": "Invalid Maximum Vault Timeout."
},
"hours": {
"message": "Hours"
},