Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HZ-820] Persist license key and support configuration update #20446

Merged
merged 12 commits into from
Jan 28, 2022

Conversation

ramizdundar
Copy link
Contributor

@ramizdundar ramizdundar commented Jan 20, 2022

License key changes now can be persisted. Also users can set their licenses via configuration update & reloading.

EE PR: https://github.com/hazelcast/hazelcast-enterprise/pull/4579

Checklist:

  • Labels (Team:, Type:, Source:, Module:) and Milestone set
  • Label Add to Release Notes or Not Release Notes content set
  • Request reviewers if possible

@ramizdundar ramizdundar self-assigned this Jan 21, 2022
@ramizdundar ramizdundar requested review from frant-hartm and removed request for frant-hartm January 21, 2022 13:21
@ramizdundar ramizdundar added this to the 5.1 milestone Jan 21, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Jan 21, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Jan 21, 2022
@ramizdundar ramizdundar changed the title Persist license key Persist license key and support update Jan 24, 2022
@ramizdundar ramizdundar changed the title Persist license key and support update Persist license key and support configuration update Jan 24, 2022
@ramizdundar ramizdundar marked this pull request as ready for review January 24, 2022 12:54
Now users can reload from default xml if they want to. Since we don't include default xml as file, this makes sense.

This commit also changes how reload is looked. Now we only look at the configurationFile field of the Config object. This also makes sense because otherwise user cloud accidentally reload from a different file which he started the cluster.

Also set configurationFile field where it didn't set previously.
# Conflicts:
#	hazelcast/src/main/java/com/hazelcast/instance/impl/DefaultNodeExtension.java
@hazelcast hazelcast deleted a comment from hz-devops-test Jan 27, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Jan 27, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Jan 27, 2022
@hz-devops-test
Copy link

The job Hazelcast-pr-builder of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
--------------------------
---------SUMMARY----------
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.2:checkstyle (default) on project hazelcast: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There are 3 errors reported by Checkstyle 8.38 with /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder_2/checkstyle/checkstyle.xml ruleset. -> [Help 1]
--------------------------
---------ERRORS-----------
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder_2/hazelcast/src/main/java/com/hazelcast/internal/config/LicenseKey.java:54:101: '8' is a magic number. [MagicNumber]
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder_2/hazelcast/src/main/java/com/hazelcast/internal/config/LicenseKey.java:55:30: '+' should be on a new line. [OperatorWrap]
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder_2/hazelcast/src/main/java/com/hazelcast/internal/config/LicenseKey.java:56:55: '+' should be on a new line. [OperatorWrap]
--------------------------

Copy link
Contributor

@vbekiaris vbekiaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, a minor suggestion

@SuppressWarnings("checkstyle:MagicNumber")
public String toString() {
// last 8 characters are visible
String maskedLicense = MASK_FOR_SENSITIVE_DATA + licenseKey.substring(licenseKey.length() - 8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: reuse existing license masking code from

String[] licenceKeyParts = e.getValue().split("#");
String originalKeyPart = licenceKeyParts[licenceKeyParts.length - 1];
return e.getKey() + "=" + originalKeyPart.substring(0, LICENSE_KEY_VISIBLE_CHAR_COUNT) + "*********"
+ originalKeyPart.substring(originalKeyPart.length() - LICENSE_KEY_VISIBLE_CHAR_COUNT);
?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramizdundar ramizdundar merged commit d1dc50e into hazelcast:master Jan 28, 2022
@ramizdundar ramizdundar changed the title Persist license key and support configuration update [HZ-820] Persist license key and support configuration update Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants