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

[Fleet] enable feature flags #172464

Merged
merged 5 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading