Skip to content

Commit

Permalink
Refactor license checking (#52118) (#52859)
Browse files Browse the repository at this point in the history
Improve code resuse and readility. Add convenience checking method which
covers most use cases without having to pass many boolean arguments.
  • Loading branch information
ywangd authored Feb 27, 2020
1 parent bc9c3f0 commit f5c4e92
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ && isProductionMode(settings, clusterService.localNode())) {
throw new IllegalStateException("Cannot install a [" + newLicense.operationMode() +
"] license unless TLS is configured or security is disabled");
} else if (XPackSettings.FIPS_MODE_ENABLED.get(settings)
&& newLicense.operationMode() != License.OperationMode.PLATINUM
&& newLicense.operationMode() != License.OperationMode.ENTERPRISE
&& newLicense.operationMode() != License.OperationMode.TRIAL) {
&& false == XPackLicenseState.isFipsAllowedForOperationMode(newLicense.operationMode())) {
throw new IllegalStateException("Cannot install a [" + newLicense.operationMode() +
"] license unless FIPS mode is disabled");
}
Expand Down
Loading

0 comments on commit f5c4e92

Please sign in to comment.