mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
feat(lighthouse): Support Amazon Bedrock Long-Term API Key (#9343)
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com>
This commit is contained in:
co-authored by
Chandrapal Badshah
parent
cb84bd0f94
commit
26fd7d3adc
@@ -4,18 +4,42 @@ import { useSearchParams } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
|
||||
import { ConnectLLMProvider } from "@/components/lighthouse/connect-llm-provider";
|
||||
import { SelectBedrockAuthMethod } from "@/components/lighthouse/select-bedrock-auth-method";
|
||||
import type { LighthouseProvider } from "@/types/lighthouse";
|
||||
|
||||
const BEDROCK_AUTH_MODES = {
|
||||
IAM: "iam",
|
||||
API_KEY: "api_key",
|
||||
} as const;
|
||||
|
||||
type BedrockAuthMode =
|
||||
(typeof BEDROCK_AUTH_MODES)[keyof typeof BEDROCK_AUTH_MODES];
|
||||
|
||||
function ConnectContent() {
|
||||
const searchParams = useSearchParams();
|
||||
const provider = searchParams.get("provider") as LighthouseProvider | null;
|
||||
const mode = searchParams.get("mode") || "create";
|
||||
const auth = searchParams.get("auth") as BedrockAuthMode | null;
|
||||
|
||||
if (!provider) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <ConnectLLMProvider provider={provider} mode={mode} />;
|
||||
const isBedrockCreateMode = provider === "bedrock" && mode !== "edit";
|
||||
|
||||
if (isBedrockCreateMode && !auth) {
|
||||
return <SelectBedrockAuthMethod />;
|
||||
}
|
||||
|
||||
const initialAuthMode = isBedrockCreateMode && auth ? auth : undefined;
|
||||
|
||||
return (
|
||||
<ConnectLLMProvider
|
||||
provider={provider}
|
||||
mode={mode}
|
||||
initialAuthMode={initialAuthMode}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function ConnectLLMProviderPage() {
|
||||
|
||||
Reference in New Issue
Block a user