From dd2756b570697b0fcf1426ca5203f6f9e0938d0c Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Tue, 29 Oct 2024 16:34:52 -0700 Subject: [PATCH] add `sessionToken` validation connection auth for AWSbedrock (#2554) --- .../AwsBedrockLLMOptions/index.jsx | 61 +++++++++++++++++++ server/models/systemSettings.js | 3 + server/utils/AiProviders/bedrock/index.js | 25 ++++++++ .../utils/agents/aibitat/providers/bedrock.js | 16 +++++ server/utils/helpers/updateENV.js | 11 ++++ 5 files changed, 116 insertions(+) diff --git a/frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx b/frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx index 00f44a35ff..569ec4395b 100644 --- a/frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx +++ b/frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx @@ -1,7 +1,12 @@ import { ArrowSquareOut, Info } from "@phosphor-icons/react"; import { AWS_REGIONS } from "./regions"; +import { useState } from "react"; export default function AwsBedrockLLMOptions({ settings }) { + const [useSessionToken, setUseSessionToken] = useState( + settings?.AwsBedrockLLMConnectionMethod === "sessionToken" + ); + return (
{!settings?.credentialsOnly && ( @@ -24,6 +29,43 @@ export default function AwsBedrockLLMOptions({ settings }) {
)} +
+ +
+ +

+ Select the method to authenticate with AWS Bedrock. +

+
+
+ + IAM + + + + Session Token + +
+
+
+ {useSessionToken && ( +
+ + +
+ )}