Skip to content
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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/autokitteh
Submodule autokitteh updated 38 files
+1 −5 cmd/ak/cmd/deploy.go
+2 −2 cmd/ak/cmd/events/dispatch.go
+1 −2 cmd/ak/cmd/manifest/apply.go
+1 −2 cmd/ak/cmd/manifest/deploy.go
+3 −5 cmd/ak/cmd/manifest/plan.go
+1 −13 internal/backend/auth/authloginhttpsvc/config.go
+2 −8 internal/backend/auth/authloginhttpsvc/descope.go
+5 −13 internal/backend/auth/authloginhttpsvc/redir.go
+11 −32 internal/backend/auth/authloginhttpsvc/svc.go
+1 −2 internal/backend/auth/authusers/internal.go
+2 −2 internal/backend/dashboardsvc/projects.go
+0 −2 internal/backend/db/db.go
+1 −90 internal/backend/db/dbgorm/connections.go
+36 −0 internal/backend/db/dbgorm/connections_test.go
+5 −16 internal/backend/db/dbgorm/events.go
+3 −3 internal/backend/db/dbgorm/scheme/records.go
+1 −2 internal/backend/db/dbgorm/sessions.go
+4 −7 internal/backend/db/dbgorm/vars.go
+0 −25 internal/backend/db/dbgorm/vars_test.go
+8 −49 internal/backend/dispatcher/dispatcher.go
+1 −6 internal/backend/svc/svc.go
+1 −1 internal/backend/users/users.go
+1 −13 internal/manifest/plan.go
+6 −8 internal/manifest/plan_opts.go
+0 −19 migrations/postgres/20251222172329_simplify-connection-indexes.sql
+1 −2 migrations/postgres/atlas.sum
+0 −19 migrations/postgres/enterprise/20251222172334_simplify-connection-indexes.sql
+1 −2 migrations/postgres/enterprise/atlas.sum
+0 −19 migrations/sqlite/20251222172325_simplify-connection-indexes.sql
+1 −2 migrations/sqlite/atlas.sum
+2 −2 proto/autokitteh/dispatcher/v1/svc.proto
+60 −58 proto/gen/go/autokitteh/dispatcher/v1/svc.pb.go
+12 −8 proto/gen/py/autokitteh_pb/dispatcher/v1/svc_pb2.py
+2 −2 runtimes/pythonrt/dockerize_user_code.go
+50 −55 runtimes/pythonrt/local_runner.go
+7 −29 runtimes/pythonrt/runner_manager_local.go
+3 −52 tests/system/testdata/manifest/reapply.txtar
+1 −1 web/webplatform/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ export {
NotionIntegrationAddForm,
NotionIntegrationEditForm,
} from "@components/organisms/configuration/connections/integrations/notion";
export {
PydanticGatewayIntegrationAddForm,
PydanticGatewayIntegrationEditForm,
} from "@components/organisms/configuration/connections/integrations/pydanticgw";
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React, { useEffect } from "react";

import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";

import { IntegrationAddFormProps } from "@interfaces/components";
import { ConnectionAuthType } from "@src/enums";
import { Integrations } from "@src/enums/components";
import { useConnectionForm } from "@src/hooks";
import { pydanticgwIntegrationSchema } from "@validations";

import { Button, ErrorMessage, Input, Spinner } from "@components/atoms";
import { Accordion } from "@components/molecules";

import { ExternalLinkIcon, FloppyDiskIcon } from "@assets/image/icons";

export const PydanticGatewayIntegrationAddForm = ({
connectionId,
triggerParentFormSubmit,
onSuccess,
isOrgConnection,
}: IntegrationAddFormProps) => {
const { t } = useTranslation("integrations");

const { createConnection, errors, handleSubmit, isLoading, register } = useConnectionForm(
pydanticgwIntegrationSchema,
"create",
undefined,
onSuccess,
isOrgConnection
);

useEffect(() => {
if (connectionId) {
createConnection(connectionId, ConnectionAuthType.ApiKey, Integrations.pydanticgw);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [connectionId]);

return (
<form className="flex flex-col gap-6" onSubmit={handleSubmit(triggerParentFormSubmit)}>
<div className="relative">
<Input
{...register("api_key")}
aria-label={t("pydanticgw.placeholders.apiKey")}
disabled={isLoading}
isError={!!errors.api_key}
isRequired
isSensitive
label={t("pydanticgw.placeholders.apiKey")}
/>

<ErrorMessage>{errors.api_key?.message as string}</ErrorMessage>
</div>

<Accordion title={t("information")}>
<Link
className="group inline-flex items-center gap-2.5 text-green-800"
target="_blank"
to="https://docs.pydantic.dev/"
>
{t("pydanticgw.information.documentation")}

<ExternalLinkIcon className="size-3.5 fill-green-800 duration-200" />
</Link>
</Accordion>

<Button
aria-label={t("buttons.saveConnection")}
className="ml-auto w-fit border-white px-3 font-medium text-white hover:bg-black"
disabled={isLoading}
type="submit"
variant="outline"
>
{isLoading ? <Spinner /> : <FloppyDiskIcon className="size-5 fill-white transition" />}

{t("buttons.saveConnection")}
</Button>
</form>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React, { useState } from "react";

import { useWatch } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";

import { useConnectionForm } from "@src/hooks";
import { pydanticgwIntegrationSchema } from "@validations";

import { Button, ErrorMessage, SecretInput, Spinner } from "@components/atoms";
import { Accordion } from "@components/molecules";

import { ExternalLinkIcon, FloppyDiskIcon } from "@assets/image/icons";

export const PydanticGatewayIntegrationEditForm = () => {
const { t } = useTranslation("integrations");
const [lockState, setLockState] = useState(true);
const { control, errors, handleSubmit, isLoading, onSubmitEdit, register, setValue } = useConnectionForm(
pydanticgwIntegrationSchema,
"edit"
);

const apiKey = useWatch({ control, name: "api_key" });

return (
<form className="flex flex-col gap-6" onSubmit={handleSubmit(onSubmitEdit)}>
<div className="relative">
<SecretInput
type="password"
{...register("api_key")}
aria-label={t("pydanticgw.placeholders.apiKey")}
disabled={isLoading}
handleInputChange={(newValue) => setValue("api_key", newValue)}
handleLockAction={setLockState}
isError={!!errors.api_key}
isLocked={lockState}
isRequired
label={t("pydanticgw.placeholders.apiKey")}
value={apiKey}
/>

<ErrorMessage>{errors.api_key?.message as string}</ErrorMessage>
</div>

<Accordion title={t("information")}>
<Link
className="group inline-flex items-center gap-2.5 text-green-800"
target="_blank"
to="https://docs.pydantic.dev/"
>
{t("pydanticgw.information.documentation")}

<ExternalLinkIcon className="size-3.5 fill-green-800 duration-200" />
</Link>
</Accordion>

<Button
aria-label={t("buttons.saveConnection")}
className="ml-auto w-fit border-white px-3 font-medium text-white hover:bg-black"
disabled={isLoading}
type="submit"
variant="outline"
>
{isLoading ? <Spinner /> : <FloppyDiskIcon className="size-5 fill-white transition" />}

{t("buttons.saveConnection")}
</Button>
</form>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { PydanticGatewayIntegrationAddForm } from "./add";
export { PydanticGatewayIntegrationEditForm } from "./edit";
2 changes: 2 additions & 0 deletions src/constants/connections/addComponentsMapping.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
RedditIntegrationAddForm,
PipedriveIntegrationAddForm,
NotionIntegrationAddForm,
PydanticGatewayIntegrationAddForm,
} from "@components/organisms/configuration/connections/integrations";
import { MicrosoftTeamsIntegrationAddForm } from "@components/organisms/configuration/connections/integrations/microsoft/teams";

Expand Down Expand Up @@ -57,4 +58,5 @@ export const integrationAddFormComponents: Partial<Record<keyof typeof Integrati
reddit: RedditIntegrationAddForm,
pipedrive: PipedriveIntegrationAddForm,
notion: NotionIntegrationAddForm,
pydanticgw: PydanticGatewayIntegrationAddForm,
};
2 changes: 2 additions & 0 deletions src/constants/connections/editComponentsMapping.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
RedditIntegrationEditForm,
PipedriveIntegrationEditForm,
NotionIntegrationEditForm,
PydanticGatewayIntegrationEditForm,
} from "@components/organisms/configuration/connections/integrations";
import { MicrosoftTeamsIntegrationEditForm } from "@components/organisms/configuration/connections/integrations/microsoft/teams";

Expand Down Expand Up @@ -57,4 +58,5 @@ export const integrationToEditComponent: Partial<Record<keyof typeof Integration
[Integrations.reddit]: RedditIntegrationEditForm,
[Integrations.pipedrive]: PipedriveIntegrationEditForm,
[Integrations.notion]: NotionIntegrationEditForm,
[Integrations.pydanticgw]: PydanticGatewayIntegrationEditForm,
};
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const integrationVariablesMapping = {
[Integrations.anthropic]: {
api_key: "api_key",
},
[Integrations.pydanticgw]: {
api_key: "api_key",
},
[Integrations.salesforce]: {
client_id: "client_id",
client_secret: "client_secret",
Expand Down
6 changes: 6 additions & 0 deletions src/enums/components/connection.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export enum Integrations {
reddit = "reddit",
pipedrive = "pipedrive",
notion = "notion",
pydanticgw = "pydanticgw",
}

export const defaultGoogleConnectionName = "google";
Expand Down Expand Up @@ -254,6 +255,11 @@ export const IntegrationsMap: Record<Integrations, IntegrationSelectOption> = {
label: "Notion",
value: Integrations.notion,
},
pydanticgw: {
icon: HttpIcon,
label: "Pydantic Gateway",
value: Integrations.pydanticgw,
},
};

const shouldHideIntegration: Partial<Record<Integrations, boolean>> = {
Expand Down
8 changes: 8 additions & 0 deletions src/locales/en/integrations/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@
"devPlatform": "Anthropic developer platform"
}
},
"pydanticgw": {
"placeholders": {
"apiKey": "API Key"
},
"information": {
"documentation": "Pydantic Gateway documentation"
}
},
"gemini": {
"placeholders": {
"key": "Secret API Key"
Expand Down
5 changes: 5 additions & 0 deletions src/validations/connection.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ export const anthropicIntegrationSchema = z.object({
auth_type: z.literal(ConnectionAuthType.ApiKey).default(ConnectionAuthType.ApiKey),
});

export const pydanticgwIntegrationSchema = z.object({
api_key: z.string().min(1, "API Key is required"),
auth_type: z.literal(ConnectionAuthType.ApiKey).default(ConnectionAuthType.ApiKey),
});

export const linearPrivateAuthIntegrationSchema = z.object({
client_id: z.string().min(1, "Client ID is required"),
client_secret: z.string().min(1, "Client secret is required"),
Expand Down
1 change: 1 addition & 0 deletions src/validations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export {
googleFormsIntegrationSchema,
asanaIntegrationSchema,
anthropicIntegrationSchema,
pydanticgwIntegrationSchema,
auth0IntegrationSchema,
githubPrivateAuthIntegrationSchema,
linearPrivateAuthIntegrationSchema,
Expand Down
Loading