Skip to content

Commit

Permalink
Update security acknowledgement messages for basic (elastic#41826)
Browse files Browse the repository at this point in the history
When applying a license update, we provide "acknowledgement messages"
that indicate which features will be affected by the change in license.

This commit updates the messages that are provided when installing a
basic license, so that they reflect the changes made to the security
features that are included in that license type.

Backport of: elastic#41776
  • Loading branch information
tvernum authored May 6, 2019
1 parent c2923c1 commit b9ab5bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,18 @@ private static String[] securityAcknowledgementMessages(OperationMode currentMod
switch (newMode) {
case BASIC:
switch (currentMode) {
case TRIAL:
case STANDARD:
return new String[] {
"Security will default to disabled (set " + XPackSettings.SECURITY_ENABLED.getKey() + " to enable security).",
};
case TRIAL:
case GOLD:
case PLATINUM:
return new String[] {
"The following X-Pack security functionality will be disabled: authentication, authorization, " +
"ip filtering, and auditing. Please restart your node after applying the license.",
"Security will default to disabled (set " + XPackSettings.SECURITY_ENABLED.getKey() + " to enable security).",
"Authentication will be limited to the native and file realms.",
"Security tokens and API keys will not be supported.",
"IP filtering and auditing will be disabled.",
"Field and document level access control will be disabled.",
"Custom realms will be ignored.",
"A custom authorization engine will be ignored."
Expand All @@ -125,7 +130,7 @@ private static String[] securityAcknowledgementMessages(OperationMode currentMod
case STANDARD:
switch (currentMode) {
case BASIC:
// ^^ though technically it was already disabled, it's not bad to remind them
// ^^ though technically it doesn't change the feature set, it's not bad to remind them
case GOLD:
case PLATINUM:
case TRIAL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public static OperationMode randomTrialOrPlatinumMode() {
return randomFrom(TRIAL, PLATINUM);
}

public static OperationMode randomTrialGoldOrPlatinumMode() {
return randomFrom(TRIAL, GOLD, PLATINUM);
}

public static OperationMode randomTrialBasicStandardGoldOrPlatinumMode() {
return randomFrom(TRIAL, BASIC, STANDARD, GOLD, PLATINUM);
}
Expand Down Expand Up @@ -263,8 +267,12 @@ public void testSecurityAckAnyToTrialOrPlatinum() {
assertAckMesssages(XPackField.SECURITY, randomMode(), randomTrialOrPlatinumMode(), 0);
}

public void testSecurityAckTrialStandardGoldOrPlatinumToBasic() {
assertAckMesssages(XPackField.SECURITY, randomTrialStandardGoldOrPlatinumMode(), BASIC, 4);
public void testSecurityAckTrialGoldOrPlatinumToBasic() {
assertAckMesssages(XPackField.SECURITY, randomTrialGoldOrPlatinumMode(), BASIC, 7);
}

public void testSecurityAckStandardToBasic() {
assertAckMesssages(XPackField.SECURITY, STANDARD, BASIC, 1);
}

public void testSecurityAckAnyToStandard() {
Expand Down

0 comments on commit b9ab5bf

Please sign in to comment.