Skip to content

Commit

Permalink
fix: add validation to ensure ca-cert is always populated
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdibi committed Jan 9, 2024
1 parent 5c8b984 commit 0d44149
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,19 @@ private void initCaCertNameTextBox() {
});

this.caCertName.addBlurHandler(e -> this.caCertName.validate());
this.caCertName.setAllowBlank(true);
this.caCertName.setAllowBlank(false);
this.caCertName.addMouseOutHandler(event -> resetHelpText());

this.caCertName.addChangeHandler(event -> setDirty(true));
this.keystorePid.addChangeHandler(event -> {
setDirty(true);

if (this.keystorePid.getValue().isEmpty() && this.keystorePid.isEnabled()) {
this.identityCaCertName.setValidationState(ValidationState.ERROR);
} else {
this.identityCaCertName.setValidationState(ValidationState.NONE);
}

});
}

private void initPrivateKeyNameTextBox() {
Expand Down Expand Up @@ -461,7 +470,7 @@ public boolean isValid() {
result = false;
}

if (isNonEmptyString(this.publicPrivateKeyPairName)) {
if (isNonEmptyString(this.publicPrivateKeyPairName) && !isNonEmptyString(caCertName)) {
this.identityPublicPrivateKeyPairName.setValidationState(ValidationState.ERROR);
result = false;
}
Expand Down

0 comments on commit 0d44149

Please sign in to comment.