Skip to content

Commit

Permalink
[Fleet] enable feature flags (elastic#172464)
Browse files Browse the repository at this point in the history
## Summary

Closes elastic#104986

Enable feature flags for `remoteESOutput` and `outputSecretsStorage`.

The feature is ready when elastic#172181
and elastic/fleet-server#3127 is merged.

Output secret storage
[issues](elastic#157458) are closed, so
I think the feature flag for that should be enabled too. cc
@jillguyonnet
  • Loading branch information
juliaElastic authored Dec 5, 2023
1 parent 44d7c0a commit 9d81996
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/fleet/common/experimental_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const allowedExperimentalValues = Object.freeze<Record<string, boolean>>(
agentTamperProtectionEnabled: true,
secretsStorage: true,
kafkaOutput: true,
outputSecretsStorage: false,
remoteESOutput: false,
outputSecretsStorage: true,
remoteESOutput: true,
});

type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/fleet/cypress/e2e/fleet_settings_outputs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('Outputs', () => {
cy.contains('Name is required');
cy.contains('Host is required');
cy.contains('Username is required');
cy.contains('Password is required');
// cy.contains('Password is required'); // TODO
cy.contains('Default topic is required');
cy.contains('Topic is required');
cy.contains(
Expand All @@ -213,7 +213,7 @@ describe('Outputs', () => {
cy.contains('Must be a key, value pair i.e. "http.response.code: 200"');
shouldDisplayError(SETTINGS_OUTPUTS.NAME_INPUT);
shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_USERNAME_INPUT);
shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_PASSWORD_INPUT);
// shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_PASSWORD_INPUT); // TODO
shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.TOPICS_DEFAULT_TOPIC_INPUT);
shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.TOPICS_CONDITION_INPUT);
shouldDisplayError(SETTINGS_OUTPUTS_KAFKA.TOPICS_TOPIC_INPUT);
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('Outputs', () => {
it('saves the output', () => {
selectKafkaOutput();

fillInKafkaOutputForm();
fillInKafkaOutputForm(true);

cy.intercept('POST', '**/api/fleet/outputs').as('saveOutput');

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/cypress/screens/fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const SETTINGS_OUTPUTS_KAFKA = {
AUTHENTICATION_SSL_OPTION: 'kafkaAuthenticationSSLRadioButton',
AUTHENTICATION_KERBEROS_OPTION: 'kafkaAuthenticationKerberosRadioButton',
AUTHENTICATION_USERNAME_INPUT: 'settingsOutputsFlyout.kafkaUsernameInput',
AUTHENTICATION_PASSWORD_INPUT: 'settingsOutputsFlyout.kafkaPasswordInput',
AUTHENTICATION_PASSWORD_INPUT: 'settingsOutputsFlyout.kafkaPasswordSecretInput',
AUTHENTICATION_VERIFICATION_MODE_INPUT: 'settingsOutputsFlyout.kafkaVerificationModeInput',
AUTHENTICATION_CONNECTION_TYPE_SELECT: 'settingsOutputsFlyout.kafkaConnectionTypeRadioInput',
AUTHENTICATION_CONNECTION_TYPE_PLAIN_OPTION: 'kafkaConnectionTypePlaintextRadioButton',
Expand Down
12 changes: 8 additions & 4 deletions x-pack/plugins/fleet/cypress/screens/fleet_outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,17 @@ export const resetKafkaOutputForm = () => {
cy.getBySel(kafkaOutputFormValues.name.selector).clear();
cy.get('[placeholder="Specify host"').clear();
cy.getBySel(kafkaOutputFormValues.username.selector).clear();
cy.getBySel(kafkaOutputFormValues.password.selector).clear();
cy.getBySel(kafkaOutputFormValues.defaultTopic.selector).clear();
cy.getBySel(SETTINGS_OUTPUTS_KAFKA.COMPRESSION_SWITCH).click();
};

export const fillInKafkaOutputForm = () => {
export const fillInKafkaOutputForm = (create?: boolean) => {
cy.getBySel(kafkaOutputFormValues.name.selector).type(kafkaOutputFormValues.name.value);
cy.get('[placeholder="Specify host"').clear().type('localhost:5000');
cy.getBySel(kafkaOutputFormValues.username.selector).type(kafkaOutputFormValues.username.value);
cy.getBySel(kafkaOutputFormValues.password.selector).type(kafkaOutputFormValues.password.value);
if (create) {
cy.getBySel(kafkaOutputFormValues.password.selector).type(kafkaOutputFormValues.password.value);
}
cy.getBySel(kafkaOutputFormValues.verificationMode.selector).select(
kafkaOutputFormValues.verificationMode.value
);
Expand Down Expand Up @@ -263,6 +264,9 @@ export const fillInKafkaOutputForm = () => {
export const validateSavedKafkaOutputForm = () => {
Object.keys(kafkaOutputFormValues).forEach((key: string) => {
const { selector, value } = kafkaOutputFormValues[key as keyof typeof kafkaOutputFormValues];
if (selector === SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_PASSWORD_INPUT) {
return;
}
cy.getBySel(selector).should('have.value', value);
});

Expand All @@ -289,7 +293,7 @@ export const validateOutputTypeChangeToKafka = (outputId: string) => {
cy.getBySel(SETTINGS_OUTPUTS.TYPE_INPUT).select('kafka');
cy.getBySel(SETTINGS_OUTPUTS_KAFKA.AUTHENTICATION_USERNAME_PASSWORD_OPTION).click();

fillInKafkaOutputForm();
fillInKafkaOutputForm(true);
cy.intercept('PUT', '**/api/fleet/outputs/**').as('saveOutput');

cy.getBySel(SETTINGS_SAVE_BTN).click();
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ export function registerEncryptedSavedObjects(
'timeout',
'broker_timeout',
'required_acks',
'secrets',
]),
});
// Encrypted saved objects
Expand Down

0 comments on commit 9d81996

Please sign in to comment.