Skip to content

Commit

Permalink
[Cloud Security] Enable credential fields in integration edit (elasti…
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanSh authored Oct 19, 2023
1 parent b8ecaa2 commit 44f3910
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
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 @@ -548,7 +548,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 @@ -562,7 +561,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 @@ -574,7 +572,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 @@ -644,15 +644,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

0 comments on commit 44f3910

Please sign in to comment.