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

[8.11] [Cloud Security] Enable credential fields in integration edit (#169365) #169451

Merged
merged 1 commit into from
Oct 19, 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
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ export const AwsCredentialsForm = ({
{setupFormat === 'manual' && (
<>
<AwsCredentialTypeSelector
disabled={disabled}
type={awsCredentialsType}
onChange={(optionId) => {
updatePolicy(
Expand All @@ -271,7 +270,6 @@ export const AwsCredentialsForm = ({
<ReadDocumentation url={integrationLink} />
<EuiSpacer size="l" />
<AwsInputVarFields
disabled={disabled}
fields={fields}
onChange={(key, value) => {
updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } }));
Expand All @@ -286,11 +284,9 @@ export const AwsCredentialsForm = ({
const AwsCredentialTypeSelector = ({
type,
onChange,
disabled,
}: {
onChange(type: AwsCredentialsType): void;
type: AwsCredentialsType;
disabled: boolean;
}) => (
<EuiFormRow
fullWidth
Expand All @@ -299,7 +295,6 @@ const AwsCredentialTypeSelector = ({
})}
>
<EuiSelect
disabled={disabled}
fullWidth
options={getAwsCredentialsFormManualOptions()}
value={type}
Expand All @@ -313,19 +308,16 @@ const AwsCredentialTypeSelector = ({
const AwsInputVarFields = ({
fields,
onChange,
disabled,
}: {
fields: Array<AwsOptions[keyof AwsOptions]['fields'][number] & { value: string; id: string }>;
onChange: (key: string, value: string) => void;
disabled: boolean;
}) => (
<div>
{fields.map((field) => (
<EuiFormRow key={field.id} label={field.label} fullWidth hasChildLabel={true} id={field.id}>
<>
{field.type === 'password' && (
<EuiFieldPassword
disabled={disabled}
id={field.id}
type="dual"
fullWidth
Expand All @@ -335,7 +327,6 @@ const AwsInputVarFields = ({
)}
{field.type === 'text' && (
<EuiFieldText
disabled={disabled}
id={field.id}
fullWidth
value={field.value || ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ const GcpInputVarFields = ({
{credentialsTypeFields && credentialFilesFields && credentialJSONFields && (
<EuiFormRow fullWidth label={gcpField.fields['gcp.credentials.type'].label}>
<EuiSelect
disabled={disabled}
data-test-subj={CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.CREDENTIALS_TYPE}
fullWidth
options={credentialOptionsList}
Expand All @@ -557,7 +556,6 @@ const GcpInputVarFields = ({
{credentialsTypeValue === credentialFieldValue && credentialFilesFields && (
<EuiFormRow fullWidth label={gcpField.fields['gcp.credentials.file'].label}>
<EuiFieldText
disabled={disabled}
data-test-subj={CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.CREDENTIALS_FILE}
id={credentialFilesFields.id}
fullWidth
Expand All @@ -569,7 +567,6 @@ const GcpInputVarFields = ({
{credentialsTypeValue === credentialJSONValue && credentialJSONFields && (
<EuiFormRow fullWidth label={gcpField.fields['gcp.credentials.json'].label}>
<EuiTextArea
disabled={disabled}
data-test-subj={CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.CREDENTIALS_JSON}
id={credentialJSONFields.id}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,15 @@ export const CspPolicyTemplateForm = memo<PackagePolicyReplaceDefineStepExtensio
<>
<EuiCallOut
title={i18n.translate('xpack.csp.fleetIntegration.editWarning.calloutTitle', {
defaultMessage: 'Agent Installation Required for Changes',
defaultMessage: 'Modifying Integration Details',
})}
color="warning"
iconType="warning"
>
<p>
<FormattedMessage
id="xpack.csp.fleetIntegration.editWarning.calloutDescription"
defaultMessage="In order to change the cloud service provider (CSP) you want to monitor, add more accounts or change where CSPM is deployed (Organization vs Single Account), please install a new CSPM integration."
defaultMessage="In order to change the cloud service provider (CSP) you want to monitor, add more accounts, or change where CSPM is deployed (Organization vs Single Account), please add a new CSPM integration."
/>
</p>
</EuiCallOut>
Expand Down