[Security solution] Rename connector from AWS Bedrock to Amazon Bedrock (#169025)

This commit is contained in:
Steph Milovic 2023-10-17 12:24:03 -06:00 committed by GitHub
parent 930b440c9b
commit 9b73b87d5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Before After
Before After

View file

@ -18,6 +18,7 @@ import {
} from '@elastic/eui';
import { ActionType } from '@kbn/actions-plugin/common';
import { ActionTypeRegistryContract } from '@kbn/triggers-actions-ui-plugin/public';
import { css } from '@emotion/css/dist/emotion-css.cjs';
import * as i18n from '../translations';
interface Props {
@ -26,6 +27,12 @@ interface Props {
onClose: () => void;
onSelect: (actionType: ActionType) => void;
}
const itemClassName = css`
.euiKeyPadMenuItem__label {
white-space: nowrap;
overflow: hidden;
}
`;
export const ActionTypeSelectorModal = ({
actionTypes,
@ -46,6 +53,7 @@ export const ActionTypeSelectorModal = ({
return (
<EuiFlexItem data-test-subj="action-option" key={actionType.id} grow={false}>
<EuiKeyPadMenuItem
className={itemClassName}
key={actionType.id}
isDisabled={!actionType.enabled}
label={actionType.name}

View file

@ -19,7 +19,7 @@ export const WELCOME_GENERAL_2 = i18n.translate(
'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt',
{
defaultMessage:
"First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an AWS Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉",
"First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an Amazon Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉",
}
);

View file

@ -23,7 +23,7 @@ export const getLlmType = (connectorId: string, connectors: ActionResult[]): str
// See: https://github.com/langchain-ai/langchainjs/blob/fb699647a310c620140842776f4a7432c53e02fa/langchain/src/agents/openai/index.ts#L185
return 'openai';
}
// TODO: Add support for AWS Bedrock Connector once merged
// TODO: Add support for Amazon Bedrock Connector once merged
// Note: Doesn't appear to be a difference between Azure and OpenAI LLM types, so TBD for functions agent on Azure
// See: https://github.com/langchain-ai/langchainjs/blob/fb699647a310c620140842776f4a7432c53e02fa/langchain/src/llms/openai.ts#L539

View file

@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
export const BEDROCK_TITLE = i18n.translate(
'xpack.stackConnectors.components.bedrock.connectorTypeTitle',
{
defaultMessage: 'AWS Bedrock',
defaultMessage: 'Amazon Bedrock',
}
);
export const BEDROCK_CONNECTOR_ID = '.bedrock';

View file

@ -26,8 +26,8 @@ beforeAll(() => {
describe('actionTypeRegistry.get() works', () => {
test('connector type static data is as expected', () => {
expect(actionTypeModel.id).toEqual(ACTION_TYPE_ID);
expect(actionTypeModel.selectMessage).toBe('Send a request to AWS Bedrock.');
expect(actionTypeModel.actionTypeTitle).toBe('AWS Bedrock');
expect(actionTypeModel.selectMessage).toBe('Send a request to Amazon Bedrock.');
expect(actionTypeModel.actionTypeTitle).toBe('Amazon Bedrock');
});
});

View file

@ -21,7 +21,7 @@ export function getConnectorType(): BedrockConnector {
id: BEDROCK_CONNECTOR_ID,
iconClass: lazy(() => import('./logo')),
selectMessage: i18n.translate('xpack.stackConnectors.components.bedrock.selectMessageText', {
defaultMessage: 'Send a request to AWS Bedrock.',
defaultMessage: 'Send a request to Amazon Bedrock.',
}),
actionTypeTitle: BEDROCK_TITLE,
validateParams: async (

View file

@ -33,7 +33,7 @@ export const bedrockConfig: ConfigFieldSchema[] = [
defaultValue: DEFAULT_BEDROCK_URL,
helpText: (
<FormattedMessage
defaultMessage="The AWS Bedrock API endpoint URL. For more information on the URL, refer to the {bedrockAPIUrlDocs}."
defaultMessage="The Amazon Bedrock API endpoint URL. For more information on the URL, refer to the {bedrockAPIUrlDocs}."
id="xpack.stackConnectors.components.bedrock.bedrockDocumentation"
values={{
bedrockAPIUrlDocs: (

View file

@ -40,7 +40,7 @@ export const SECRET = i18n.translate('xpack.stackConnectors.components.bedrock.s
});
export const BEDROCK = i18n.translate('xpack.stackConnectors.components.bedrock.title', {
defaultMessage: 'AWS Bedrock',
defaultMessage: 'Amazon Bedrock',
});
export const DOCUMENTATION = i18n.translate(

View file

@ -33,9 +33,9 @@ describe('Bedrock Connector', () => {
configurationUtilities = actionsConfigMock.create();
connectorType = getConnectorType();
});
test('exposes the connector as `AWS Bedrock` with id `.bedrock`', () => {
test('exposes the connector as `Amazon Bedrock` with id `.bedrock`', () => {
expect(connectorType.id).toEqual('.bedrock');
expect(connectorType.name).toEqual('AWS Bedrock');
expect(connectorType.name).toEqual('Amazon Bedrock');
});
describe('config validation', () => {
test('config validation passes when only required fields are provided', () => {
@ -55,7 +55,7 @@ describe('Bedrock Connector', () => {
expect(() => {
configValidator(config, { configurationUtilities });
}).toThrowErrorMatchingInlineSnapshot(
'"Error configuring AWS Bedrock action: Error: URL Error: Invalid URL: example.com/do-something"'
'"Error configuring Amazon Bedrock action: Error: URL Error: Invalid URL: example.com/do-something"'
);
});
@ -75,7 +75,7 @@ describe('Bedrock Connector', () => {
expect(() => {
configValidator(config, { configurationUtilities: configUtils });
}).toThrowErrorMatchingInlineSnapshot(
`"Error configuring AWS Bedrock action: Error: error validating url: target url is not present in allowedHosts"`
`"Error configuring Amazon Bedrock action: Error: error validating url: target url is not present in allowedHosts"`
);
});
});

View file

@ -43,7 +43,7 @@ export const configValidator = (configObject: Config, validatorServices: Validat
} catch (err) {
throw new Error(
i18n.translate('xpack.stackConnectors.bedrock.configurationErrorApiProvider', {
defaultMessage: 'Error configuring AWS Bedrock action: {err}',
defaultMessage: 'Error configuring Amazon Bedrock action: {err}',
values: {
err,
},

View file

@ -164,7 +164,7 @@ describe('Stack Connectors Plugin', () => {
4,
expect.objectContaining({
id: '.bedrock',
name: 'AWS Bedrock',
name: 'Amazon Bedrock',
})
);
expect(actionsSetup.registerSubActionConnectorType).toHaveBeenNthCalledWith(

View file

@ -160,7 +160,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) {
statusCode: 400,
error: 'Bad Request',
message:
'error validating action type config: Error configuring AWS Bedrock action: Error: error validating url: target url "http://bedrock.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts',
'error validating action type config: Error configuring Amazon Bedrock action: Error: error validating url: target url "http://bedrock.mynonexistent.com" is not added to the Kibana config xpack.actions.allowedHosts',
});
});
});
@ -280,7 +280,7 @@ export default function bedrockTest({ getService }: FtrProviderContext) {
status: 'error',
retry: true,
message: 'an error occurred while running the action',
service_message: `Sub action "invalidAction" is not registered. Connector id: ${bedrockActionId}. Connector name: AWS Bedrock. Connector type: .bedrock`,
service_message: `Sub action "invalidAction" is not registered. Connector id: ${bedrockActionId}. Connector name: Amazon Bedrock. Connector type: .bedrock`,
});
});
});