Skip to content

Conversation

@ywangd
Copy link
Member

@ywangd ywangd commented Feb 9, 2020

Add enterprise operation mode to properly map enterprise license.

Aslo refactor XPackLicenstate class to consolidate license status and mode checks.
This class has many sychronised methods to check basically three things:

  • Minimum operation mode required
  • Whether security is enabled
  • Whether current license needs to be active

Depends on the actual feature, either 1, 2 or all of above checks are performed.
These are now consolidated in to 3 helper methods (2 of them are new).
The synchronization is pushed down to the helper methods so actual checking
methods no longer need to worry about it.

resolves: #51081

Add enterprise operation mode to properly map enterprise license.

Aslo refactor XPackLicenstate class to consolidate license status and mode checks.
This class has many sychronised methods to check basically three things:
* Minimum operation mode required
* Whether security is enabled
* Whether current license needs to be active

Depends on the actual feature, either 1, 2 or all of above checks are performed.
These are now consolidated in to 3 helper methods (2 of them are new).
The synchronization is pushed down to the helper methods so actual checking
methods no longer need to worry about it.

resolves: elastic#51081
@ywangd ywangd added :Security/License License functionality for commercial features backport labels Feb 9, 2020
@ywangd ywangd requested review from jkakavas and tvernum February 9, 2020 23:50
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (:Security/License)

@ywangd ywangd changed the title Add enterprise mode and refactor license check (#51864) (#51864) Add enterprise mode and refactor license check (#51864) Feb 9, 2020
ClusterStatsMonitoringDocTests setup was incorrect because of the
operationMode name is uppercase and does not match any license type.
@ywangd
Copy link
Member Author

ywangd commented Feb 19, 2020

@tvernum Would it be possible to let this backport go through first while we keep working on the other refactor (#52118)?

Tim Brooks has merged his refactoring which replaced synchronized with volatile and has a PR (#52492) for backport. It would be helpful if I could get this change in first to keep things in order.
Also due to his change, my other refactor needs a fair bit rework. So I don't want it blocking this backport given the refactor does not change any functionality. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Security/License License functionality for commercial features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants