Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

initial work

Matheus Nogueira0ec79f4ddb4a
diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/fireworks-api-key-rotation-router.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/fireworks-api-key-rotation-router.ts
new file mode 100644
index 0000000000..76c5f30d28
--- /dev/null
+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/fireworks-api-key-rotation-router.ts
@@ -0,0 +1,19 @@
+import {
+ CreateFireworksApiKeyRotationSchema,
+ FireworksApiKeyRotationGeneratedCredentialsSchema,
+ FireworksApiKeyRotationSchema,
+ UpdateFireworksApiKeyRotationSchema
+} from "@app/ee/services/secret-rotation-v2/fireworks-api-key";
+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
+
+import { registerSecretRotationEndpoints } from "./secret-rotation-v2-endpoints";
+
+export const registerFireworksApiKeyRotationRouter = async (server: FastifyZodProvider) =>
+ registerSecretRotationEndpoints({
+ type: SecretRotation.FireworksApiKey,
+ server,
+ responseSchema: FireworksApiKeyRotationSchema,
+ createSchema: CreateFireworksApiKeyRotationSchema,
+ updateSchema: UpdateFireworksApiKeyRotationSchema,
+ generatedCredentialsSchema: FireworksApiKeyRotationGeneratedCredentialsSchema
+ });
diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts
index 8ac3c19cfd..46cb60ecff 100644
--- a/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts
+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/index.ts
@@ -7,6 +7,7 @@ import { registerConvexAccessKeyRotationRouter } from "./convex-access-key-rotat
import { registerDatabricksServicePrincipalSecretRotationRouter } from "./databricks-service-principal-secret-rotation-router";
import { registerDatadogApplicationKeySecretRotationRouter } from "./datadog-application-key-secret-rotation-router";
import { registerDbtServiceTokenRotationRouter } from "./dbt-service-token-rotation-router";
+import { registerFireworksApiKeyRotationRouter } from "./fireworks-api-key-rotation-router";
import { registerHpIloRotationRouter } from "./hp-ilo-rotation-router";
import { registerLdapPasswordRotationRouter } from "./ldap-password-rotation-router";
import { registerMongoDBCredentialsRotationRouter } from "./mongodb-credentials-rotation-router";
@@ -48,5 +49,6 @@ export const SECRET_ROTATION_REGISTER_ROUTER_MAP: Record<
[SecretRotation.SupabaseApiKey]: registerSupabaseApiKeyRotationRouter,
[SecretRotation.SalesforceOauthCredentials]: registerSalesforceOauthCredentialsRotationRouter,
[SecretRotation.DatadogApplicationKeySecret]: registerDatadogApplicationKeySecretRotationRouter,
- [SecretRotation.ConvexAccessKey]: registerConvexAccessKeyRotationRouter
+ [SecretRotation.ConvexAccessKey]: registerConvexAccessKeyRotationRouter,
+ [SecretRotation.FireworksApiKey]: registerFireworksApiKeyRotationRouter
};
diff --git a/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts b/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts
index 17a41bafe5..152475bc78 100644
--- a/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts
+++ b/backend/src/ee/routes/v2/secret-rotation-v2-routers/secret-rotation-v2-router.ts
@@ -8,6 +8,7 @@ import { ConvexAccessKeyRotationListItemSchema } from "@app/ee/services/secret-r
import { DatabricksServicePrincipalSecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/databricks-service-principal-secret";
import { DatadogApplicationKeySecretRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/datadog-application-key-secret";
import { DbtServiceTokenRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/dbt-service-token";
+import { FireworksApiKeyRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/fireworks-api-key";
import { HpIloRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/hp-ilo-rotation";
import { LdapPasswordRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/ldap-password";
import { MongoDBCredentialsRotationListItemSchema } from "@app/ee/services/secret-rotation-v2/mongodb-credentials";
@@ -49,7 +50,8 @@ const SecretRotationV2OptionsSchema = z.discriminatedUnion("type", [
SupabaseApiKeyRotationListItemSchema,
SalesforceOauthCredentialsRotationListItemSchema,
DatadogApplicationKeySecretRotationListItemSchema,
- ConvexAccessKeyRotationListItemSchema
+ ConvexAccessKeyRotationListItemSchema,
+ FireworksApiKeyRotationListItemSchema
]);
export const registerSecretRotationV2Router = async (server: FastifyZodProvider) => {
diff --git a/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-constants.ts b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-constants.ts
new file mode 100644
index 0000000000..150d1672e0
--- /dev/null
+++ b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-constants.ts
@@ -0,0 +1,14 @@
+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
+import { TSecretRotationV2ListItem } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+
+export const FIREWORKS_API_KEY_ROTATION_LIST_OPTION: TSecretRotationV2ListItem = {
+ name: "Fireworks Secret",
+ type: SecretRotation.FireworksApiKey,
+ connection: AppConnection.Fireworks,
+ template: {
+ secretsMapping: {
+ secretValue: "FIREWORKS_SECRET"
+ }
+ }
+};
diff --git a/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-fns.ts
new file mode 100644
index 0000000000..6e1b2bb6a5
--- /dev/null
+++ b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-fns.ts
@@ -0,0 +1,147 @@
+import crypto from "node:crypto";
+
+import { AxiosError } from "axios";
+
+import {
+ TRotationFactory,
+ TRotationFactoryGetSecretsPayload,
+ TRotationFactoryIssueCredentials,
+ TRotationFactoryRevokeCredentials,
+ TRotationFactoryRotateCredentials
+} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";
+import { request } from "@app/lib/config/request";
+import { BadRequestError } from "@app/lib/errors";
+import { logger } from "@app/lib/logger";
+import { FIREWORKS_API_BASE_URL } from "@app/services/app-connection/fireworks/fireworks-connection-fns";
+
+import {
+ TFireworksApiKeyRotationGeneratedCredentials,
+ TFireworksApiKeyRotationWithConnection
+} from "./fireworks-api-key-rotation-types";
+
+const $createSecret = async (
+ apiKey: string,
+ accountId: string,
+ keyName: string
+): Promise<{ secretName: string; secretValue: string }> => {
+ const secretValue = crypto.randomBytes(32).toString("base64url");
+
+ try {
+ const { data } = await request.post<{ name: string }>(
+ `${FIREWORKS_API_BASE_URL}/v1/accounts/${accountId}/secrets`,
+ { keyName, value: secretValue },
+ {
+ headers: {
+ Authorization: `Bearer ${apiKey}`,
+ "Content-Type": "application/json"
+ }
+ }
+ );
+
+ if (!data?.name) {
+ throw new Error("Invalid response from Fireworks: missing 'name'.");
+ }
+
+ return {
+ secretName: data.name,
+ secretValue
+ };
+ } catch (error: unknown) {
+ if (error instanceof BadRequestError) throw error;
+ throw new BadRequestError({
+ message: `Failed to create Fireworks secret: ${error instanceof AxiosError ? error.message : "Unknown error"}`
+ });
+ }
+};
+
+const $deleteSecret = async (apiKey: string, accountId: string, secretName: string): Promise<void> => {
+ const secretId = secretName.split("/").pop();
+
+ try {
+ await request.delete(`${FIREWORKS_API_BASE_URL}/v1/accounts/${accountId}/secrets/${secretId}`, {
+ headers: {
+ Authorization: `Bearer ${apiKey}`,
+ "Content-Type": "application/json"
+ }
+ });
+ } catch (error: unknown) {
+ if (error instanceof AxiosError && error.response?.status === 404) return;
+ throw new BadRequestError({
+ message: `Failed to delete Fireworks secret: ${error instanceof AxiosError ? error.message : "Unknown error"}`
+ });
+ }
+};
+
+export const fireworksApiKeyRotationFactory: TRotationFactory<
+ TFireworksApiKeyRotationWithConnection,
+ TFireworksApiKeyRotationGeneratedCredentials
+> = (secretRotation) => {
+ const {
+ id: rotationId,
+ connection,
+ parameters: { keyName },
+ secretsMapping
+ } = secretRotation;
+
+ const { apiKey, accountId } = connection.credentials;
+
+ const issueCredentials: TRotationFactoryIssueCredentials<TFireworksApiKeyRotationGeneratedCredentials> = async (
+ callback
+ ) => {
+ const credentials = await $createSecret(apiKey, accountId, keyName);
+ return callback(credentials);
+ };
+
+ const revokeCredentials: TRotationFactoryRevokeCredentials<TFireworksApiKeyRotationGeneratedCredentials> = async (
+ generatedCredentials,
+ callback
+ ) => {
+ if (!generatedCredentials?.length) return callback();
+
+ const results = await Promise.allSettled(
+ generatedCredentials.map((credential) => $deleteSecret(apiKey, accountId, credential.secretName))
+ );
+
+ results.forEach((result, index) => {
+ if (result.status === "rejected") {
+ logger.error(
+ result.reason,
+ `fireworksApiKeyRotation: failed to revoke secret during cleanup [rotationId=${rotationId}] [secretName=${generatedCredentials[index].secretName}]`
+ );
+ }
+ });
+
+ return callback();
+ };
+
+ const rotateCredentials: TRotationFactoryRotateCredentials<TFireworksApiKeyRotationGeneratedCredentials> = async (
+ credentialsToRevoke,
+ callback
+ ) => {
+ const credentials = await $createSecret(apiKey, accountId, keyName);
+
+ if (credentialsToRevoke?.secretName) {
+ try {
+ await $deleteSecret(apiKey, accountId, credentialsToRevoke.secretName);
+ } catch (revokeError) {
+ logger.error(
+ revokeError,
+ `fireworksApiKeyRotation: failed to revoke previous secret after rotation [rotationId=${rotationId}] [secretName=${credentialsToRevoke.secretName}]`
+ );
+ }
+ }
+
+ return callback(credentials);
+ };
+
+ const getSecretsPayload: TRotationFactoryGetSecretsPayload<TFireworksApiKeyRotationGeneratedCredentials> = (
+ generatedCredentials
+ ) => [{ key: secretsMapping.secretValue, value: generatedCredentials.secretValue }];
+
+ return {
+ issueCredentials,
+ revokeCredentials,
+ rotateCredentials,
+ getSecretsPayload
+ };
+};
diff --git a/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-schemas.ts b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-schemas.ts
new file mode 100644
index 0000000000..f16e2ed8e6
--- /dev/null
+++ b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-schemas.ts
@@ -0,0 +1,61 @@
+import { z } from "zod";
+
+import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
+import {
+ BaseCreateSecretRotationSchema,
+ BaseSecretRotationSchema,
+ BaseUpdateSecretRotationSchema
+} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-schemas";
+import { SecretRotations } from "@app/lib/api-docs";
+import { SecretNameSchema } from "@app/server/lib/schemas";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+
+export const FireworksApiKeyRotationGeneratedCredentialsSchema = z
+ .object({
+ secretName: z.string(),
+ secretValue: z.string()
+ })
+ .array()
+ .min(1)
+ .max(2);
+
+const FireworksApiKeyRotationParametersSchema = z.object({
+ keyName: z.string().trim().min(1, "Key name required").describe(SecretRotations.PARAMETERS.FIREWORKS_API_KEY.keyName)
+});
+
+const FireworksApiKeyRotationSecretsMappingSchema = z.object({
+ secretValue: SecretNameSchema.describe(SecretRotations.SECRETS_MAPPING.FIREWORKS_API_KEY.secretValue)
+});
+
+export const FireworksApiKeyRotationTemplateSchema = z.object({
+ secretsMapping: z.object({
+ secretValue: z.string()
+ })
+});
+
+export const FireworksApiKeyRotationSchema = BaseSecretRotationSchema(SecretRotation.FireworksApiKey).extend({
+ type: z.literal(SecretRotation.FireworksApiKey),
+ parameters: FireworksApiKeyRotationParametersSchema,
+ secretsMapping: FireworksApiKeyRotationSecretsMappingSchema
+});
+
+export const CreateFireworksApiKeyRotationSchema = BaseCreateSecretRotationSchema(
+ SecretRotation.FireworksApiKey
+).extend({
+ parameters: FireworksApiKeyRotationParametersSchema,
+ secretsMapping: FireworksApiKeyRotationSecretsMappingSchema
+});
+
+export const UpdateFireworksApiKeyRotationSchema = BaseUpdateSecretRotationSchema(
+ SecretRotation.FireworksApiKey
+).extend({
+ parameters: FireworksApiKeyRotationParametersSchema.optional(),
+ secretsMapping: FireworksApiKeyRotationSecretsMappingSchema.optional()
+});
+
+export const FireworksApiKeyRotationListItemSchema = z.object({
+ name: z.literal("Fireworks Secret"),
+ connection: z.literal(AppConnection.Fireworks),
+ type: z.literal(SecretRotation.FireworksApiKey),
+ template: FireworksApiKeyRotationTemplateSchema
+});
diff --git a/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-types.ts b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-types.ts
new file mode 100644
index 0000000000..2c421d5248
--- /dev/null
+++ b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-types.ts
@@ -0,0 +1,24 @@
+import { z } from "zod";
+
+import { TFireworksConnection } from "@app/services/app-connection/fireworks";
+
+import {
+ CreateFireworksApiKeyRotationSchema,
+ FireworksApiKeyRotationGeneratedCredentialsSchema,
+ FireworksApiKeyRotationListItemSchema,
+ FireworksApiKeyRotationSchema
+} from "./fireworks-api-key-rotation-schemas";
+
+export type TFireworksApiKeyRotation = z.infer<typeof FireworksApiKeyRotationSchema>;
+
+export type TFireworksApiKeyRotationInput = z.infer<typeof CreateFireworksApiKeyRotationSchema>;
+
+export type TFireworksApiKeyRotationListItem = z.infer<typeof FireworksApiKeyRotationListItemSchema>;
+
+export type TFireworksApiKeyRotationWithConnection = TFireworksApiKeyRotation & {
+ connection: TFireworksConnection;
+};
+
+export type TFireworksApiKeyRotationGeneratedCredentials = z.infer<
+ typeof FireworksApiKeyRotationGeneratedCredentialsSchema
+>;
diff --git a/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/index.ts b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/index.ts
new file mode 100644
index 0000000000..be12a31b49
--- /dev/null
+++ b/backend/src/ee/services/secret-rotation-v2/fireworks-api-key/index.ts
@@ -0,0 +1,3 @@
+export * from "./fireworks-api-key-rotation-constants";
+export * from "./fireworks-api-key-rotation-schemas";
+export * from "./fireworks-api-key-rotation-types";
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts
index cc89c95193..36ee30956a 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-enums.ts
@@ -19,7 +19,8 @@ export enum SecretRotation {
SupabaseApiKey = "supabase-api-key",
SalesforceOauthCredentials = "salesforce-oauth-credentials",
DatadogApplicationKeySecret = "datadog-application-key-secret",
- ConvexAccessKey = "convex-access-key"
+ ConvexAccessKey = "convex-access-key",
+ FireworksApiKey = "fireworks-api-key"
}
export enum SecretRotationStatus {
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts
index 6f8345ff81..239d7bdd71 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-fns.ts
@@ -16,6 +16,7 @@ import {
TDatadogApplicationKeySecretRotation
} from "./datadog-application-key-secret";
import { DBT_SERVICE_TOKEN_ROTATION_LIST_OPTION } from "./dbt-service-token";
+import { FIREWORKS_API_KEY_ROTATION_LIST_OPTION } from "./fireworks-api-key";
import { HP_ILO_ROTATION_LIST_OPTION, THpIloRotation } from "./hp-ilo-rotation";
import { LDAP_PASSWORD_ROTATION_LIST_OPTION, TLdapPasswordRotation } from "./ldap-password";
import { MONGODB_CREDENTIALS_ROTATION_LIST_OPTION } from "./mongodb-credentials";
@@ -69,7 +70,8 @@ const SECRET_ROTATION_LIST_OPTIONS: Record<SecretRotation, TSecretRotationV2List
[SecretRotation.SupabaseApiKey]: SUPABASE_API_KEY_ROTATION_LIST_OPTION,
[SecretRotation.SalesforceOauthCredentials]: SALESFORCE_OAUTH_CREDENTIALS_ROTATION_LIST_OPTION,
[SecretRotation.DatadogApplicationKeySecret]: DATADOG_APPLICATION_KEY_SECRET_ROTATION_LIST_OPTION,
- [SecretRotation.ConvexAccessKey]: CONVEX_ACCESS_KEY_ROTATION_LIST_OPTION
+ [SecretRotation.ConvexAccessKey]: CONVEX_ACCESS_KEY_ROTATION_LIST_OPTION,
+ [SecretRotation.FireworksApiKey]: FIREWORKS_API_KEY_ROTATION_LIST_OPTION
};
export const listSecretRotationOptions = () => {
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts
index ccc913fc69..c786cd678c 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-maps.ts
@@ -22,7 +22,8 @@ export const SECRET_ROTATION_NAME_MAP: Record<SecretRotation, string> = {
[SecretRotation.SupabaseApiKey]: "Supabase API Key",
[SecretRotation.SalesforceOauthCredentials]: "Salesforce OAuth Credentials",
[SecretRotation.DatadogApplicationKeySecret]: "Datadog Application Key",
- [SecretRotation.ConvexAccessKey]: "Convex Access Key"
+ [SecretRotation.ConvexAccessKey]: "Convex Access Key",
+ [SecretRotation.FireworksApiKey]: "Fireworks Secret"
};
export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnection> = {
@@ -46,5 +47,6 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio
[SecretRotation.SupabaseApiKey]: AppConnection.Supabase,
[SecretRotation.SalesforceOauthCredentials]: AppConnection.Salesforce,
[SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog,
- [SecretRotation.ConvexAccessKey]: AppConnection.Convex
+ [SecretRotation.ConvexAccessKey]: AppConnection.Convex,
+ [SecretRotation.FireworksApiKey]: AppConnection.Fireworks
};
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
index 2f900d8cb0..e763bcc61e 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
@@ -18,6 +18,7 @@ import { azureClientSecretRotationFactory } from "@app/ee/services/secret-rotati
import { convexAccessKeyRotationFactory } from "@app/ee/services/secret-rotation-v2/convex-access-key/convex-access-key-rotation-fns";
import { databricksServicePrincipalSecretRotationFactory } from "@app/ee/services/secret-rotation-v2/databricks-service-principal-secret/databricks-service-principal-secret-rotation-fns";
import { datadogApplicationKeySecretRotationFactory } from "@app/ee/services/secret-rotation-v2/datadog-application-key-secret/datadog-application-key-secret-rotation-fns";
+import { fireworksApiKeyRotationFactory } from "@app/ee/services/secret-rotation-v2/fireworks-api-key/fireworks-api-key-rotation-fns";
import { ldapPasswordRotationFactory } from "@app/ee/services/secret-rotation-v2/ldap-password/ldap-password-rotation-fns";
import { salesforceOauthCredentialsRotationFactory } from "@app/ee/services/secret-rotation-v2/salesforce-oauth-credentials/salesforce-oauth-credentials-rotation-fns";
import { SecretRotation, SecretRotationStatus } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
@@ -204,7 +205,8 @@ const SECRET_ROTATION_FACTORY_MAP: Record<SecretRotation, TRotationFactoryImplem
salesforceOauthCredentialsRotationFactory as TRotationFactoryImplementation,
[SecretRotation.DatadogApplicationKeySecret]:
datadogApplicationKeySecretRotationFactory as TRotationFactoryImplementation,
- [SecretRotation.ConvexAccessKey]: convexAccessKeyRotationFactory as TRotationFactoryImplementation
+ [SecretRotation.ConvexAccessKey]: convexAccessKeyRotationFactory as TRotationFactoryImplementation,
+ [SecretRotation.FireworksApiKey]: fireworksApiKeyRotationFactory as TRotationFactoryImplementation
};
export const secretRotationV2ServiceFactory = ({
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
index 2b7da37159..cb638e9d04 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-types.ts
@@ -58,6 +58,13 @@ import {
TDbtServiceTokenRotationListItem,
TDbtServiceTokenRotationWithConnection
} from "./dbt-service-token/dbt-service-token-rotation-types";
+import {
+ TFireworksApiKeyRotation,
+ TFireworksApiKeyRotationGeneratedCredentials,
+ TFireworksApiKeyRotationInput,
+ TFireworksApiKeyRotationListItem,
+ TFireworksApiKeyRotationWithConnection
+} from "./fireworks-api-key";
import {
THpIloRotation,
THpIloRotationGeneratedCredentials,
@@ -175,7 +182,8 @@ export type TSecretRotationV2 =
| TSupabaseApiKeyRotation
| TSalesforceOauthCredentialsRotation
| TDatadogApplicationKeySecretRotation
- | TConvexAccessKeyRotation;
+ | TConvexAccessKeyRotation
+ | TFireworksApiKeyRotation;
export type TSecretRotationV2WithConnection =
| TPostgresCredentialsRotationWithConnection
@@ -198,7 +206,8 @@ export type TSecretRotationV2WithConnection =
| TSupabaseApiKeyRotationWithConnection
| TSalesforceOauthCredentialsRotationWithConnection
| TDatadogApplicationKeySecretRotationWithConnection
- | TConvexAccessKeyRotationWithConnection;
+ | TConvexAccessKeyRotationWithConnection
+ | TFireworksApiKeyRotationWithConnection;
export type TSecretRotationV2GeneratedCredentials =
| TSqlCredentialsRotationGeneratedCredentials
@@ -217,7 +226,8 @@ export type TSecretRotationV2GeneratedCredentials =
| TSupabaseApiKeyRotationGeneratedCredentials
| TSalesforceOauthCredentialsRotationGeneratedCredentials
| TDatadogApplicationKeySecretRotationGeneratedCredentials
- | TConvexAccessKeyRotationGeneratedCredentials;
+ | TConvexAccessKeyRotationGeneratedCredentials
+ | TFireworksApiKeyRotationGeneratedCredentials;
export type TSecretRotationV2Input =
| TPostgresCredentialsRotationInput
@@ -240,7 +250,8 @@ export type TSecretRotationV2Input =
| TSupabaseApiKeyRotationInput
| TSalesforceOauthCredentialsRotationInput
| TDatadogApplicationKeySecretRotationInput
- | TConvexAccessKeyRotationInput;
+ | TConvexAccessKeyRotationInput
+ | TFireworksApiKeyRotationInput;
export type TSecretRotationV2ListItem =
| TPostgresCredentialsRotationListItem
@@ -263,7 +274,8 @@ export type TSecretRotationV2ListItem =
| TSupabaseApiKeyRotationListItem
| TSalesforceOauthCredentialsRotationListItem
| TDatadogApplicationKeySecretRotationListItem
- | TConvexAccessKeyRotationListItem;
+ | TConvexAccessKeyRotationListItem
+ | TFireworksApiKeyRotationListItem;
export type TSecretRotationV2TemporaryParameters =
| TLdapPasswordRotationInput["temporaryParameters"]
diff --git a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts
index d1cfa6cfc2..a902e2c7fb 100644
--- a/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts
+++ b/backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema.ts
@@ -20,6 +20,7 @@ import { WindowsLocalAccountRotationSchema } from "@app/ee/services/secret-rotat
import { ConvexAccessKeyRotationSchema } from "./convex-access-key";
import { DbtServiceTokenRotationSchema } from "./dbt-service-token";
+import { FireworksApiKeyRotationSchema } from "./fireworks-api-key";
import { HpIloRotationSchema } from "./hp-ilo-rotation";
import { SupabaseApiKeyRotationSchema } from "./supabase-api-key";
@@ -44,5 +45,6 @@ export const SecretRotationV2Schema = z.discriminatedUnion("type", [
SupabaseApiKeyRotationSchema,
SalesforceOauthCredentialsRotationSchema,
DatadogApplicationKeySecretRotationSchema,
- ConvexAccessKeyRotationSchema
+ ConvexAccessKeyRotationSchema,
+ FireworksApiKeyRotationSchema
]);
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 5518bb22ff..af74f84963 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -2925,6 +2925,10 @@ export const AppConnections = {
ANTHROPIC: {
apiKey: "The Anthropic API key used to authenticate with the Anthropic API."
},
+ FIREWORKS: {
+ apiKey: "The Fireworks API key used to authenticate with the Fireworks API.",
+ accountId: "The Fireworks account ID used to identify the Fireworks account."
+ },
CLOUD66: {
accessToken: "The Personal Access Token used to authenticate with the Cloud 66 API."
},
@@ -3467,6 +3471,9 @@ export const SecretRotations = {
},
CONVEX_ACCESS_KEY: {
namePrefix: "A prefix to use when naming the generated Convex access key."
+ },
+ FIREWORKS_API_KEY: {
+ keyName: "The key name identifier for the secret on Fireworks."
}
},
SECRETS_MAPPING: {
@@ -3541,6 +3548,9 @@ export const SecretRotations = {
},
CONVEX_ACCESS_KEY: {
accessKey: "The name of the secret that the rotated Convex access key will be mapped to."
+ },
+ FIREWORKS_API_KEY: {
+ secretValue: "The name of the secret that the rotated Fireworks secret value will be mapped to."
}
}
};
diff --git a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
index 7e991ffdd1..ef5d65a283 100644
--- a/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
+++ b/backend/src/server/routes/v1/app-connection-routers/app-connection-router.ts
@@ -108,6 +108,10 @@ import {
F5BigIpConnectionListItemSchema,
SanitizedF5BigIpConnectionSchema
} from "@app/services/app-connection/f5-big-ip";
+import {
+ FireworksConnectionListItemSchema,
+ SanitizedFireworksConnectionSchema
+} from "@app/services/app-connection/fireworks";
import { FlyioConnectionListItemSchema, SanitizedFlyioConnectionSchema } from "@app/services/app-connection/flyio";
import { GcpConnectionListItemSchema, SanitizedGcpConnectionSchema } from "@app/services/app-connection/gcp";
import { GitHubConnectionListItemSchema, SanitizedGitHubConnectionSchema } from "@app/services/app-connection/github";
@@ -298,7 +302,8 @@ const SanitizedAppConnectionSchema = z.union([
...SanitizedDatadogConnectionSchema.options,
...SanitizedF5BigIpConnectionSchema.options,
...SanitizedConvexConnectionSchema.options,
- ...SanitizedQoveryConnectionSchema.options
+ ...SanitizedQoveryConnectionSchema.options,
+ ...SanitizedFireworksConnectionSchema.options
]);
const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
@@ -374,7 +379,8 @@ const AppConnectionOptionsSchema = z.discriminatedUnion("app", [
DatadogConnectionListItemSchema,
F5BigIpConnectionListItemSchema,
ConvexConnectionListItemSchema,
- QoveryConnectionListItemSchema
+ QoveryConnectionListItemSchema,
+ FireworksConnectionListItemSchema
]);
export const registerAppConnectionRouter = async (server: FastifyZodProvider) => {
diff --git a/backend/src/server/routes/v1/app-connection-routers/fireworks-connection-router.ts b/backend/src/server/routes/v1/app-connection-routers/fireworks-connection-router.ts
new file mode 100644
index 0000000000..ec7be4826f
--- /dev/null
+++ b/backend/src/server/routes/v1/app-connection-routers/fireworks-connection-router.ts
@@ -0,0 +1,18 @@
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import {
+ CreateFireworksConnectionSchema,
+ SanitizedFireworksConnectionSchema,
+ UpdateFireworksConnectionSchema
+} from "@app/services/app-connection/fireworks";
+
+import { registerAppConnectionEndpoints } from "./app-connection-endpoints";
+
+export const registerFireworksConnectionRouter = async (server: FastifyZodProvider) => {
+ registerAppConnectionEndpoints({
+ app: AppConnection.Fireworks,
+ server,
+ sanitizedResponseSchema: SanitizedFireworksConnectionSchema,
+ createSchema: CreateFireworksConnectionSchema,
+ updateSchema: UpdateFireworksConnectionSchema
+ });
+};
diff --git a/backend/src/server/routes/v1/app-connection-routers/index.ts b/backend/src/server/routes/v1/app-connection-routers/index.ts
index 360015696a..136676aaea 100644
--- a/backend/src/server/routes/v1/app-connection-routers/index.ts
+++ b/backend/src/server/routes/v1/app-connection-routers/index.ts
@@ -31,6 +31,7 @@ import { registerDNSMadeEasyConnectionRouter } from "./dns-made-easy-connection-
import { registerDopplerConnectionRouter } from "./doppler-connection-router";
import { registerExternalInfisicalConnectionRouter } from "./external-infisical-connection-router";
import { registerF5BigIpConnectionRouter } from "./f5-big-ip-connection-router";
+import { registerFireworksConnectionRouter } from "./fireworks-connection-router";
import { registerFlyioConnectionRouter } from "./flyio-connection-router";
import { registerGcpConnectionRouter } from "./gcp-connection-router";
import { registerGitHubConnectionRouter } from "./github-connection-router";
@@ -150,5 +151,6 @@ export const APP_CONNECTION_REGISTER_ROUTER_MAP: Record<AppConnection, (server:
[AppConnection.F5BigIp]: registerF5BigIpConnectionRouter,
[AppConnection.Convex]: registerConvexConnectionRouter,
[AppConnection.HasuraCloud]: registerHasuraCloudConnectionRouter,
- [AppConnection.Qovery]: registerQoveryConnectionRouter
+ [AppConnection.Qovery]: registerQoveryConnectionRouter,
+ [AppConnection.Fireworks]: registerFireworksConnectionRouter
};
diff --git a/backend/src/services/app-connection/app-connection-enums.ts b/backend/src/services/app-connection/app-connection-enums.ts
index 8103a45f21..6791704833 100644
--- a/backend/src/services/app-connection/app-connection-enums.ts
+++ b/backend/src/services/app-connection/app-connection-enums.ts
@@ -71,7 +71,8 @@ export enum AppConnection {
Convex = "convex",
HasuraCloud = "hasura-cloud",
Qovery = "qovery",
- Cloud66 = "cloud-66"
+ Cloud66 = "cloud-66",
+ Fireworks = "fireworks"
}
export enum AWSRegion {
diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.ts
index 167866aa49..bd0d037109 100644
--- a/backend/src/services/app-connection/app-connection-fns.ts
+++ b/backend/src/services/app-connection/app-connection-fns.ts
@@ -148,6 +148,11 @@ import {
getF5BigIpConnectionListItem,
validateF5BigIpConnectionCredentials
} from "./f5-big-ip";
+import {
+ FireworksConnectionMethod,
+ getFireworksConnectionListItem,
+ validateFireworksConnectionCredentials
+} from "./fireworks";
import { FlyioConnectionMethod, getFlyioConnectionListItem, validateFlyioConnectionCredentials } from "./flyio";
import { GcpConnectionMethod, getGcpConnectionListItem, validateGcpConnectionCredentials } from "./gcp";
import {
@@ -377,7 +382,8 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {
getDatadogConnectionListItem(),
getF5BigIpConnectionListItem(),
getConvexConnectionListItem(),
- getQoveryConnectionListItem()
+ getQoveryConnectionListItem(),
+ getFireworksConnectionListItem()
]
.filter((option) => {
switch (projectType) {
@@ -621,7 +627,8 @@ export const validateAppConnectionCredentials = async (
[AppConnection.Datadog]: validateDatadogConnectionCredentials as TAppConnectionCredentialsValidator,
[AppConnection.F5BigIp]: validateF5BigIpConnectionCredentials as TAppConnectionCredentialsValidator,
[AppConnection.Convex]: validateConvexConnectionCredentials as TAppConnectionCredentialsValidator,
- [AppConnection.Qovery]: validateQoveryConnectionCredentials as TAppConnectionCredentialsValidator
+ [AppConnection.Qovery]: validateQoveryConnectionCredentials as TAppConnectionCredentialsValidator,
+ [AppConnection.Fireworks]: validateFireworksConnectionCredentials as TAppConnectionCredentialsValidator
};
return VALIDATE_APP_CONNECTION_CREDENTIALS_MAP[appConnection.app](appConnection, gatewayService, gatewayV2Service);
@@ -715,6 +722,7 @@ export const getAppConnectionMethodName = (method: TAppConnection["method"]) =>
case OctopusDeployConnectionMethod.ApiKey:
case OpenRouterConnectionMethod.ApiKey:
case AnthropicConnectionMethod.ApiKey:
+ case FireworksConnectionMethod.ApiKey:
case DevinConnectionMethod.ApiKey:
case DigiCertConnectionMethod.ApiKey:
case DatadogConnectionMethod.ApiKey:
@@ -870,7 +878,8 @@ export const TRANSITION_CONNECTION_CREDENTIALS_TO_PLATFORM: Record<
[AppConnection.F5BigIp]: platformManagedCredentialsNotSupported,
[AppConnection.GoDaddy]: platformManagedCredentialsNotSupported,
[AppConnection.Convex]: platformManagedCredentialsNotSupported,
- [AppConnection.Qovery]: platformManagedCredentialsNotSupported
+ [AppConnection.Qovery]: platformManagedCredentialsNotSupported,
+ [AppConnection.Fireworks]: platformManagedCredentialsNotSupported
};
export const enterpriseAppCheck = async (
diff --git a/backend/src/services/app-connection/app-connection-maps.ts b/backend/src/services/app-connection/app-connection-maps.ts
index 21e4a9a999..9242737b34 100644
--- a/backend/src/services/app-connection/app-connection-maps.ts
+++ b/backend/src/services/app-connection/app-connection-maps.ts
@@ -73,7 +73,8 @@ export const APP_CONNECTION_NAME_MAP: Record<AppConnection, string> = {
[AppConnection.Convex]: "Convex",
[AppConnection.HasuraCloud]: "Hasura Cloud",
[AppConnection.Qovery]: "Qovery",
- [AppConnection.Cloud66]: "Cloud 66"
+ [AppConnection.Cloud66]: "Cloud 66",
+ [AppConnection.Fireworks]: "Fireworks"
};
export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanType> = {
@@ -149,5 +150,6 @@ export const APP_CONNECTION_PLAN_MAP: Record<AppConnection, AppConnectionPlanTyp
[AppConnection.Convex]: AppConnectionPlanType.Regular,
[AppConnection.HasuraCloud]: AppConnectionPlanType.Regular,
[AppConnection.Qovery]: AppConnectionPlanType.Regular,
- [AppConnection.Cloud66]: AppConnectionPlanType.Regular
+ [AppConnection.Cloud66]: AppConnectionPlanType.Regular,
+ [AppConnection.Fireworks]: AppConnectionPlanType.Regular
};
diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.ts
index 780eafcd80..26a432059b 100644
--- a/backend/src/services/app-connection/app-connection-service.ts
+++ b/backend/src/services/app-connection/app-connection-service.ts
@@ -108,6 +108,7 @@ import { dopplerConnectionService } from "./doppler/doppler-connection-service";
import { ValidateExternalInfisicalConnectionCredentialsSchema } from "./external-infisical";
import { externalInfisicalConnectionService } from "./external-infisical/external-infisical-connection-service";
import { ValidateF5BigIpConnectionCredentialsSchema } from "./f5-big-ip";
+import { ValidateFireworksConnectionCredentialsSchema } from "./fireworks";
import { ValidateFlyioConnectionCredentialsSchema } from "./flyio";
import { flyioConnectionService } from "./flyio/flyio-connection-service";
import { ValidateGcpConnectionCredentialsSchema } from "./gcp";
@@ -275,7 +276,8 @@ const VALIDATE_APP_CONNECTION_CREDENTIALS_MAP: Record<AppConnection, TValidateAp
[AppConnection.Datadog]: ValidateDatadogConnectionCredentialsSchema,
[AppConnection.F5BigIp]: ValidateF5BigIpConnectionCredentialsSchema,
[AppConnection.Convex]: ValidateConvexConnectionCredentialsSchema,
- [AppConnection.Qovery]: ValidateQoveryConnectionCredentialsSchema
+ [AppConnection.Qovery]: ValidateQoveryConnectionCredentialsSchema,
+ [AppConnection.Fireworks]: ValidateFireworksConnectionCredentialsSchema
};
export const appConnectionServiceFactory = ({
diff --git a/backend/src/services/app-connection/app-connection-types.ts b/backend/src/services/app-connection/app-connection-types.ts
index 4cf6b7375b..e745134495 100644
--- a/backend/src/services/app-connection/app-connection-types.ts
+++ b/backend/src/services/app-connection/app-connection-types.ts
@@ -190,6 +190,12 @@ import {
TF5BigIpConnectionInput,
TValidateF5BigIpConnectionCredentialsSchema
} from "./f5-big-ip";
+import {
+ TFireworksConnection,
+ TFireworksConnectionConfig,
+ TFireworksConnectionInput,
+ TValidateFireworksConnectionCredentialsSchema
+} from "./fireworks";
import {
TFlyioConnection,
TFlyioConnectionConfig,
@@ -508,6 +514,7 @@ export type TAppConnection = { id: string; configuration?: TAppConnectionConfigu
| TConvexConnection
| THasuraCloudConnection
| TQoveryConnection
+ | TFireworksConnection
);
export type TAppConnectionRaw = NonNullable<Awaited<ReturnType<TAppConnectionDALFactory["findById"]>>>;
@@ -592,6 +599,7 @@ export type TAppConnectionInput = { id: string } & (
| TConvexConnectionInput
| THasuraCloudConnectionInput
| TQoveryConnectionInput
+ | TFireworksConnectionInput
);
export type TSqlConnectionInput =
@@ -707,7 +715,8 @@ export type TAppConnectionConfig =
| TF5BigIpConnectionConfig
| TConvexConnectionConfig
| THasuraCloudConnectionConfig
- | TQoveryConnectionConfig;
+ | TQoveryConnectionConfig
+ | TFireworksConnectionConfig;
export type TValidateAppConnectionCredentialsSchema =
| TValidateAwsConnectionCredentialsSchema
@@ -782,7 +791,8 @@ export type TValidateAppConnectionCredentialsSchema =
| TValidateF5BigIpConnectionCredentialsSchema
| TValidateConvexConnectionCredentialsSchema
| TValidateHasuraCloudConnectionCredentialsSchema
- | TValidateQoveryConnectionCredentialsSchema;
+ | TValidateQoveryConnectionCredentialsSchema
+ | TValidateFireworksConnectionCredentialsSchema;
export type TListAwsConnectionKmsKeys = {
connectionId: string;
diff --git a/backend/src/services/app-connection/fireworks/fireworks-connection-enums.ts b/backend/src/services/app-connection/fireworks/fireworks-connection-enums.ts
new file mode 100644
index 0000000000..99325de604
--- /dev/null
+++ b/backend/src/services/app-connection/fireworks/fireworks-connection-enums.ts
@@ -0,0 +1,3 @@
+export enum FireworksConnectionMethod {
+ ApiKey = "api-key"
+}
diff --git a/backend/src/services/app-connection/fireworks/fireworks-connection-fns.ts b/backend/src/services/app-connection/fireworks/fireworks-connection-fns.ts
new file mode 100644
index 0000000000..d07f0cbc72
--- /dev/null
+++ b/backend/src/services/app-connection/fireworks/fireworks-connection-fns.ts
@@ -0,0 +1,35 @@
+import { request } from "@app/lib/config/request";
+import { UnauthorizedError } from "@app/lib/errors";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+
+import { FireworksConnectionMethod } from "./fireworks-connection-enums";
+import { TFireworksConnectionConfig } from "./fireworks-connection-types";
+
+export const FIREWORKS_API_BASE_URL = "https://api.fireworks.ai";
+
+export const getFireworksConnectionListItem = () => {
+ return {
+ name: "Fireworks" as const,
+ app: AppConnection.Fireworks as const,
+ methods: Object.values(FireworksConnectionMethod) as [FireworksConnectionMethod.ApiKey]
+ };
+};
+
+export const validateFireworksConnectionCredentials = async (config: TFireworksConnectionConfig) => {
+ const { apiKey, accountId } = config.credentials;
+
+ try {
+ await request.get(`${FIREWORKS_API_BASE_URL}/v1/accounts/${accountId}`, {
+ headers: {
+ Authorization: `Bearer ${apiKey}`
+ },
+ validateStatus: (status) => status === 200
+ });
+ } catch {
+ throw new UnauthorizedError({
+ message: "Unable to validate connection: invalid API key or account ID"
+ });
+ }
+
+ return config.credentials;
+};
diff --git a/backend/src/services/app-connection/fireworks/fireworks-connection-schemas.ts b/backend/src/services/app-connection/fireworks/fireworks-connection-schemas.ts
new file mode 100644
index 0000000000..85b5bfc6fe
--- /dev/null
+++ b/backend/src/services/app-connection/fireworks/fireworks-connection-schemas.ts
@@ -0,0 +1,60 @@
+import z from "zod";
+
+import { AppConnections } from "@app/lib/api-docs";
+import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import {
+ BaseAppConnectionSchema,
+ GenericCreateAppConnectionFieldsSchema,
+ GenericUpdateAppConnectionFieldsSchema
+} from "@app/services/app-connection/app-connection-schemas";
+
+import { APP_CONNECTION_NAME_MAP } from "../app-connection-maps";
+import { FireworksConnectionMethod } from "./fireworks-connection-enums";
+
+export const FireworksConnectionApiKeyCredentialsSchema = z.object({
+ accountId: z.string().trim().min(1, "Account ID required").describe(AppConnections.CREDENTIALS.FIREWORKS.accountId),
+ apiKey: z.string().trim().min(1, "API Key required").describe(AppConnections.CREDENTIALS.FIREWORKS.apiKey)
+});
+
+const BaseFireworksConnectionSchema = BaseAppConnectionSchema.extend({ app: z.literal(AppConnection.Fireworks) });
+
+export const FireworksConnectionSchema = BaseFireworksConnectionSchema.extend({
+ method: z.literal(FireworksConnectionMethod.ApiKey),
+ credentials: FireworksConnectionApiKeyCredentialsSchema
+});
+
+export const SanitizedFireworksConnectionSchema = z.discriminatedUnion("method", [
+ BaseFireworksConnectionSchema.extend({
+ method: z.literal(FireworksConnectionMethod.ApiKey),
+ credentials: FireworksConnectionApiKeyCredentialsSchema.pick({ accountId: true })
+ }).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.Fireworks]} (API Key)` }))
+]);
+
+export const ValidateFireworksConnectionCredentialsSchema = z.discriminatedUnion("method", [
+ z.object({
+ method: z.literal(FireworksConnectionMethod.ApiKey).describe(AppConnections.CREATE(AppConnection.Fireworks).method),
+ credentials: FireworksConnectionApiKeyCredentialsSchema.describe(
+ AppConnections.CREATE(AppConnection.Fireworks).credentials
+ )
+ })
+]);
+
+export const CreateFireworksConnectionSchema = ValidateFireworksConnectionCredentialsSchema.and(
+ GenericCreateAppConnectionFieldsSchema(AppConnection.Fireworks)
+);
+
+export const UpdateFireworksConnectionSchema = z
+ .object({
+ credentials: FireworksConnectionApiKeyCredentialsSchema.optional().describe(
+ AppConnections.UPDATE(AppConnection.Fireworks).credentials
+ )
+ })
+ .and(GenericUpdateAppConnectionFieldsSchema(AppConnection.Fireworks));
+
+export const FireworksConnectionListItemSchema = z
+ .object({
+ name: z.literal("Fireworks"),
+ app: z.literal(AppConnection.Fireworks),
+ methods: z.nativeEnum(FireworksConnectionMethod).array()
+ })
+ .describe(JSON.stringify({ title: APP_CONNECTION_NAME_MAP[AppConnection.Fireworks] }));
diff --git a/backend/src/services/app-connection/fireworks/fireworks-connection-types.ts b/backend/src/services/app-connection/fireworks/fireworks-connection-types.ts
new file mode 100644
index 0000000000..cb39d69c9a
--- /dev/null
+++ b/backend/src/services/app-connection/fireworks/fireworks-connection-types.ts
@@ -0,0 +1,25 @@
+import z from "zod";
+
+import { DiscriminativePick } from "@app/lib/types";
+
+import { AppConnection } from "../app-connection-enums";
+import {
+ CreateFireworksConnectionSchema,
+ FireworksConnectionSchema,
+ ValidateFireworksConnectionCredentialsSchema
+} from "./fireworks-connection-schemas";
+
+export type TFireworksConnection = z.infer<typeof FireworksConnectionSchema>;
+
+export type TFireworksConnectionInput = z.infer<typeof CreateFireworksConnectionSchema> & {
+ app: AppConnection.Fireworks;
+};
+
+export type TValidateFireworksConnectionCredentialsSchema = typeof ValidateFireworksConnectionCredentialsSchema;
+
+export type TFireworksConnectionConfig = DiscriminativePick<
+ TFireworksConnectionInput,
+ "method" | "app" | "credentials"
+> & {
+ orgId: string;
+};
diff --git a/backend/src/services/app-connection/fireworks/index.ts b/backend/src/services/app-connection/fireworks/index.ts
new file mode 100644
index 0000000000..ed44c1095e
--- /dev/null
+++ b/backend/src/services/app-connection/fireworks/index.ts
@@ -0,0 +1,4 @@
+export * from "./fireworks-connection-enums";
+export * from "./fireworks-connection-fns";
+export * from "./fireworks-connection-schemas";
+export * from "./fireworks-connection-types";
diff --git a/frontend/public/images/integrations/Fireworks.svg b/frontend/public/images/integrations/Fireworks.svg
new file mode 100644
index 0000000000..86eeba66f9
--- /dev/null
+++ b/frontend/public/images/integrations/Fireworks.svg
@@ -0,0 +1,5 @@
+<svg width="638" height="315" viewBox="0 0 638 315" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M318.563 221.755C300.863 221.755 284.979 211.247 278.206 194.978L196.549 0H244.342L318.842 178.361L393.273 0H441.066L358.92 195.048C352.112 211.247 336.263 221.755 318.563 221.755Z" fill="#6720FF"/>
+<path d="M425.111 314.933C407.481 314.933 391.667 304.494 384.824 288.366C377.947 272.097 381.507 253.524 393.936 240.921L542.657 90.2803L561.229 134.094L425.076 271.748L619.147 270.666L637.72 314.479L425.146 315.003L425.076 314.933H425.111Z" fill="#6720FF"/>
+<path d="M0 314.408L18.5727 270.595L212.643 271.677L76.525 133.988L95.0977 90.1748L243.819 240.816C256.247 253.384 259.843 272.026 252.93 288.26C246.088 304.424 230.203 314.827 212.643 314.827L0.0698221 314.339L0 314.408Z" fill="#6720FF"/>
+</svg>
diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewFireworksApiKeyRotationGeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewFireworksApiKeyRotationGeneratedCredentials.tsx
new file mode 100644
index 0000000000..72ec707e97
--- /dev/null
+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewFireworksApiKeyRotationGeneratedCredentials.tsx
@@ -0,0 +1,31 @@
+import { TFireworksApiKeyRotationGeneratedCredentialsResponse } from "@app/hooks/api/secretRotationsV2/types/fireworks-api-key-rotation";
+
+import { CredentialDisplay, ViewRotationGeneratedCredentialsDisplay } from "./shared";
+
+type Props = {
+ generatedCredentialsResponse: TFireworksApiKeyRotationGeneratedCredentialsResponse;
+};
+
+export const ViewFireworksApiKeyRotationGeneratedCredentials = ({
+ generatedCredentialsResponse: { generatedCredentials, activeIndex }
+}: Props) => {
+ const inactiveIndex = activeIndex === 0 ? 1 : 0;
+
+ const activeCredentials = generatedCredentials[activeIndex];
+ const inactiveCredentials = generatedCredentials[inactiveIndex];
+
+ return (
+ <ViewRotationGeneratedCredentialsDisplay
+ activeCredentials={
+ <CredentialDisplay isSensitive label="Secret Value">
+ {activeCredentials?.secretValue}
+ </CredentialDisplay>
+ }
+ inactiveCredentials={
+ <CredentialDisplay isSensitive label="Secret Value">
+ {inactiveCredentials?.secretValue}
+ </CredentialDisplay>
+ }
+ />
+ );
+};
diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
index 0ecd35e9fe..3bc138d824 100644
--- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
@@ -26,6 +26,7 @@ import { ViewSqlCredentialsRotationGeneratedCredentials } from "./shared";
import { ViewAwsIamUserSecretRotationGeneratedCredentials } from "./ViewAwsIamUserSecretRotationGeneratedCredentials";
import { ViewDatadogApplicationKeySecretRotationGeneratedCredentials } from "./ViewDatadogApplicationKeySecretRotationGeneratedCredentials";
import { ViewDbtServiceTokenRotationGeneratedCredentials } from "./ViewDbtSeviceTokenRotationGeneratedCredentials";
+import { ViewFireworksApiKeyRotationGeneratedCredentials } from "./ViewFireworksApiKeyRotationGeneratedCredentials";
import { ViewHpIloRotationGeneratedCredentials } from "./ViewHpIloRotationGeneratedCredentials";
import { ViewOktaClientSecretRotationGeneratedCredentials } from "./ViewOktaClientSecretRotationGeneratedCredentials";
import { ViewOpenRouterApiKeyRotationGeneratedCredentials } from "./ViewOpenRouterApiKeyRotationGeneratedCredentials";
@@ -196,6 +197,13 @@ const Content = ({ secretRotation }: ContentProps) => {
/>
);
break;
+ case SecretRotation.FireworksApiKey:
+ Component = (
+ <ViewFireworksApiKeyRotationGeneratedCredentials
+ generatedCredentialsResponse={generatedCredentialsResponse}
+ />
+ );
+ break;
default:
throw new Error("Unhandled View Generated Credential Rotation Type");
}
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx
new file mode 100644
index 0000000000..6cc43255bc
--- /dev/null
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/FireworksApiKeyRotationParametersFields.tsx
@@ -0,0 +1,25 @@
+import { Controller, useFormContext } from "react-hook-form";
+
+import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
+import { FormControl, Input } from "@app/components/v2";
+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
+
+export const FireworksApiKeyRotationParametersFields = () => {
+ const { control } = useFormContext<
+ TSecretRotationV2Form & {
+ type: SecretRotation.FireworksApiKey;
+ }
+ >();
+
+ return (
+ <Controller
+ name="parameters.keyName"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl isError={Boolean(error)} errorText={error?.message} label="Key Name">
+ <Input value={value} onChange={onChange} placeholder="e.g. MY_SECRET_KEY" />
+ </FormControl>
+ )}
+ />
+ );
+};
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx
index 7711fb3019..ba5e969547 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ParametersFields/SecretRotationV2ParametersFields.tsx
@@ -10,6 +10,7 @@ import { ConvexAccessKeyRotationParametersFields } from "./ConvexAccessKeyRotati
import { DatabricksServicePrincipalSecretRotationParametersFields } from "./DatabricksServicePrincipalSecretRotationParametersFields";
import { DatadogApplicationKeySecretRotationParametersFields } from "./DatadogApplicationKeySecretRotationParametersFields";
import { DbtServiceTokenRotationParametersFields } from "./DbtServiceTokenRotationParametersFields";
+import { FireworksApiKeyRotationParametersFields } from "./FireworksApiKeyRotationParametersFields";
import { HpIloRotationParametersFields } from "./HpIloRotationParametersFields";
import { LdapPasswordRotationParametersFields } from "./LdapPasswordRotationParametersFields";
import { MongoRotationParametersFields } from "./MongoRotationParametersFields";
@@ -44,7 +45,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {
[SecretRotation.SupabaseApiKey]: SupabaseApiKeyRotationParametersFields,
[SecretRotation.SalesforceOauthCredentials]: SalesforceOauthCredentialsRotationParametersFields,
[SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationParametersFields,
- [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationParametersFields
+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationParametersFields,
+ [SecretRotation.FireworksApiKey]: FireworksApiKeyRotationParametersFields
};
export const SecretRotationV2ParametersFields = () => {
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/FireworksApiKeyRotationReviewFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/FireworksApiKeyRotationReviewFields.tsx
new file mode 100644
index 0000000000..c13355084c
--- /dev/null
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/FireworksApiKeyRotationReviewFields.tsx
@@ -0,0 +1,28 @@
+import { useFormContext } from "react-hook-form";
+
+import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
+import { GenericFieldLabel } from "@app/components/v2";
+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
+
+import { SecretRotationReviewSection } from "./shared";
+
+export const FireworksApiKeyRotationReviewFields = () => {
+ const { watch } = useFormContext<
+ TSecretRotationV2Form & {
+ type: SecretRotation.FireworksApiKey;
+ }
+ >();
+
+ const [parameters, { secretValue }] = watch(["parameters", "secretsMapping"]);
+
+ return (
+ <>
+ <SecretRotationReviewSection label="Parameters">
+ <GenericFieldLabel label="Key Name">{parameters.keyName}</GenericFieldLabel>
+ </SecretRotationReviewSection>
+ <SecretRotationReviewSection label="Secrets Mapping">
+ <GenericFieldLabel label="Secret Value">{secretValue}</GenericFieldLabel>
+ </SecretRotationReviewSection>
+ </>
+ );
+};
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx
index 90b38931de..c10ecaea2e 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2ReviewFields/SecretRotationReviewFields.tsx
@@ -13,6 +13,7 @@ import { ConvexAccessKeyRotationReviewFields } from "./ConvexAccessKeyRotationRe
import { DatabricksServicePrincipalSecretRotationReviewFields } from "./DatabricksServicePrincipalSecretRotationReviewFields";
import { DatadogApplicationKeySecretRotationReviewFields } from "./DatadogApplicationKeySecretRotationReviewFields";
import { DbtServiceTokenRotationReviewFields } from "./DbtServiceTokenRotationReviewFields";
+import { FireworksApiKeyRotationReviewFields } from "./FireworksApiKeyRotationReviewFields";
import { HpIloRotationReviewFields } from "./HpIloRotationReviewFields";
import { LdapPasswordRotationReviewFields } from "./LdapPasswordRotationReviewFields";
import { OktaClientSecretRotationReviewFields } from "./OktaClientSecretRotationReviewFields";
@@ -46,7 +47,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {
[SecretRotation.SupabaseApiKey]: SupabaseApiKeyRotationReviewFields,
[SecretRotation.SalesforceOauthCredentials]: SalesforceOauthCredentialsRotationReviewFields,
[SecretRotation.DatadogApplicationKeySecret]: DatadogApplicationKeySecretRotationReviewFields,
- [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationReviewFields
+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationReviewFields,
+ [SecretRotation.FireworksApiKey]: FireworksApiKeyRotationReviewFields
};
export const SecretRotationV2ReviewFields = () => {
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/FireworksApiKeyRotationSecretsMappingFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/FireworksApiKeyRotationSecretsMappingFields.tsx
new file mode 100644
index 0000000000..3b26218725
--- /dev/null
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/FireworksApiKeyRotationSecretsMappingFields.tsx
@@ -0,0 +1,40 @@
+import { Controller, useFormContext } from "react-hook-form";
+
+import { TSecretRotationV2Form } from "@app/components/secret-rotations-v2/forms/schemas";
+import { FormControl, Input } from "@app/components/v2";
+import { SecretRotation, useSecretRotationV2Option } from "@app/hooks/api/secretRotationsV2";
+
+import { SecretsMappingTable } from "./shared";
+
+export const FireworksApiKeyRotationSecretsMappingFields = () => {
+ const { control } = useFormContext<
+ TSecretRotationV2Form & {
+ type: SecretRotation.FireworksApiKey;
+ }
+ >();
+
+ const { rotationOption } = useSecretRotationV2Option(SecretRotation.FireworksApiKey);
+
+ const items = [
+ {
+ name: "Secret Value",
+ input: (
+ <Controller
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <FormControl isError={Boolean(error)} errorText={error?.message}>
+ <Input
+ value={value}
+ onChange={onChange}
+ placeholder={rotationOption?.template.secretsMapping.secretValue}
+ />
+ </FormControl>
+ )}
+ control={control}
+ name="secretsMapping.secretValue"
+ />
+ )
+ }
+ ];
+
+ return <SecretsMappingTable items={items} />;
+};
diff --git a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx
index 3dc2f925e1..90af188537 100644
--- a/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx
+++ b/frontend/src/components/secret-rotations-v2/forms/SecretRotationV2SecretsMappingFields/SecretRotationV2SecretsMappingFields.tsx
@@ -10,6 +10,7 @@ import { ConvexAccessKeyRotationSecretsMappingFields } from "./ConvexAccessKeyRo
import { DatabricksServicePrincipalSecretRotationSecretsMappingFields } from "./DatabricksServicePrincipalSecretRotationSecretsMappingFields";
import { DatadogApplicationKeySecretRotationSecretsMappingFields } from "./DatadogApplicationKeySecretRotationSecretsMappingFields";
import { DbtServiceTokenRotationSecretsMappingFields } from "./DbtServiceTokenRotationSecretsMappingFields";
+import { FireworksApiKeyRotationSecretsMappingFields } from "./FireworksApiKeyRotationSecretsMappingFields";
import { HpIloRotationSecretsMappingFields } from "./HpIloRotationSecretsMappingFields";
import { LdapPasswordRotationSecretsMappingFields } from "./LdapPasswordRotationSecretsMappingFields";
import { OktaClientSecretRotationSecretsMappingFields } from "./OktaClientSecretRotationSecretsMappingFields";
@@ -45,7 +46,8 @@ const COMPONENT_MAP: Record<SecretRotation, React.FC> = {
SalesforceOauthCredentialsRotationSecretsMappingFields,
[SecretRotation.DatadogApplicationKeySecret]:
DatadogApplicationKeySecretRotationSecretsMappingFields,
- [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationSecretsMappingFields
+ [SecretRotation.ConvexAccessKey]: ConvexAccessKeyRotationSecretsMappingFields,
+ [SecretRotation.FireworksApiKey]: FireworksApiKeyRotationSecretsMappingFields
};
export const SecretRotationV2SecretsMappingFields = () => {
diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/fireworks-api-key-rotation-schema.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/fireworks-api-key-rotation-schema.ts
new file mode 100644
index 0000000000..1f10b1c354
--- /dev/null
+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/fireworks-api-key-rotation-schema.ts
@@ -0,0 +1,16 @@
+import { z } from "zod";
+
+import { BaseSecretRotationSchema } from "@app/components/secret-rotations-v2/forms/schemas/base-secret-rotation-v2-schema";
+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
+
+export const FireworksApiKeyRotationSchema = z
+ .object({
+ type: z.literal(SecretRotation.FireworksApiKey),
+ parameters: z.object({
+ keyName: z.string().trim().min(1, "Key name required")
+ }),
+ secretsMapping: z.object({
+ secretValue: z.string().trim().min(1, "Secret value name required")
+ })
+ })
+ .merge(BaseSecretRotationSchema);
diff --git a/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts b/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts
index 499d876872..ace9df3bd8 100644
--- a/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts
+++ b/frontend/src/components/secret-rotations-v2/forms/schemas/index.ts
@@ -18,6 +18,7 @@ import { WindowsLocalAccountRotationMethod } from "@app/hooks/api/secretRotation
import { ConvexAccessKeyRotationSchema } from "./convex-access-key-rotation-schema";
import { DatadogApplicationKeySecretRotationSchema } from "./datadog-application-key-secret-rotation-schema";
import { DbtServiceTokenRotationSchema } from "./dbt-service-token-rotation-schema";
+import { FireworksApiKeyRotationSchema } from "./fireworks-api-key-rotation-schema";
import { HpIloRotationSchema } from "./hp-ilo-rotation-schema";
import { OktaClientSecretRotationSchema } from "./okta-client-secret-rotation-schema";
import { OpenRouterApiKeyRotationSchema } from "./open-router-api-key-rotation-schema";
@@ -52,7 +53,8 @@ export const SecretRotationV2FormSchema = (isUpdate: boolean) =>
SupabaseApiKeyRotationSchema,
SalesforceOauthCredentialsRotationSchema,
DatadogApplicationKeySecretRotationSchema,
- ConvexAccessKeyRotationSchema
+ ConvexAccessKeyRotationSchema,
+ FireworksApiKeyRotationSchema
]),
z.object({ id: z.string().optional() })
)
diff --git a/frontend/src/helpers/appConnections.ts b/frontend/src/helpers/appConnections.ts
index a63e152398..73c4b4a618 100644
--- a/frontend/src/helpers/appConnections.ts
+++ b/frontend/src/helpers/appConnections.ts
@@ -66,6 +66,7 @@ import { DNSMadeEasyConnectionMethod } from "@app/hooks/api/appConnections/types
import { DopplerConnectionMethod } from "@app/hooks/api/appConnections/types/doppler-connection";
import { ExternalInfisicalConnectionMethod } from "@app/hooks/api/appConnections/types/external-infisical-connection";
import { F5BigIpConnectionMethod } from "@app/hooks/api/appConnections/types/f5-big-ip-connection";
+import { FireworksConnectionMethod } from "@app/hooks/api/appConnections/types/fireworks-connection";
import { GoDaddyConnectionMethod } from "@app/hooks/api/appConnections/types/godaddy-connection";
import { HasuraCloudConnectionMethod } from "@app/hooks/api/appConnections/types/hasura-cloud-connection";
import { HerokuConnectionMethod } from "@app/hooks/api/appConnections/types/heroku-connection";
@@ -467,6 +468,12 @@ export const APP_CONNECTION_MAP: Record<
category: "AI",
description: "Manage Anthropic API access."
},
+ [AppConnection.Fireworks]: {
+ name: "Fireworks",
+ image: "Fireworks.svg",
+ category: "AI",
+ description: "Manage Fireworks API access."
+ },
[AppConnection.HasuraCloud]: {
name: "Hasura Cloud",
image: "Hasura.svg",
@@ -651,6 +658,7 @@ export const getAppConnectionMethodDetails = (method: TAppConnection["method"])
case ChecklyConnectionMethod.ApiKey:
case OpenRouterConnectionMethod.ApiKey:
case AnthropicConnectionMethod.ApiKey:
+ case FireworksConnectionMethod.ApiKey:
case DevinConnectionMethod.ApiKey:
case DigiCertConnectionMethod.ApiKey:
case GoDaddyConnectionMethod.ApiKey:
diff --git a/frontend/src/helpers/secretRotationsV2.ts b/frontend/src/helpers/secretRotationsV2.ts
index f768f4dc25..96a5ecee96 100644
--- a/frontend/src/helpers/secretRotationsV2.ts
+++ b/frontend/src/helpers/secretRotationsV2.ts
@@ -109,6 +109,11 @@ export const SECRET_ROTATION_MAP: Record<
name: "Convex Access Key",
image: "Convex.png",
size: 50
+ },
+ [SecretRotation.FireworksApiKey]: {
+ name: "Fireworks Secret",
+ image: "Fireworks.svg",
+ size: 50
}
};
@@ -133,7 +138,8 @@ export const SECRET_ROTATION_CONNECTION_MAP: Record<SecretRotation, AppConnectio
[SecretRotation.SupabaseApiKey]: AppConnection.Supabase,
[SecretRotation.SalesforceOauthCredentials]: AppConnection.Salesforce,
[SecretRotation.DatadogApplicationKeySecret]: AppConnection.Datadog,
- [SecretRotation.ConvexAccessKey]: AppConnection.Convex
+ [SecretRotation.ConvexAccessKey]: AppConnection.Convex,
+ [SecretRotation.FireworksApiKey]: AppConnection.Fireworks
};
// if a rotation can potentially have downtime due to rotating a single credential set this to false
@@ -158,7 +164,8 @@ export const IS_ROTATION_DUAL_CREDENTIALS: Record<SecretRotation, boolean> = {
[SecretRotation.SupabaseApiKey]: true,
[SecretRotation.SalesforceOauthCredentials]: true,
[SecretRotation.DatadogApplicationKeySecret]: true,
- [SecretRotation.ConvexAccessKey]: true
+ [SecretRotation.ConvexAccessKey]: true,
+ [SecretRotation.FireworksApiKey]: true
};
export const getRotateAtLocal = ({ hours, minutes }: TSecretRotationV2["rotateAtUtc"]) => {
diff --git a/frontend/src/hooks/api/appConnections/enums.ts b/frontend/src/hooks/api/appConnections/enums.ts
index 9a35cf11ee..1fe243bab1 100644
--- a/frontend/src/hooks/api/appConnections/enums.ts
+++ b/frontend/src/hooks/api/appConnections/enums.ts
@@ -71,5 +71,6 @@ export enum AppConnection {
TriggerDev = "trigger-dev",
HasuraCloud = "hasura-cloud",
Qovery = "qovery",
- Cloud66 = "cloud-66"
+ Cloud66 = "cloud-66",
+ Fireworks = "fireworks"
}
diff --git a/frontend/src/hooks/api/appConnections/types/app-options.ts b/frontend/src/hooks/api/appConnections/types/app-options.ts
index 6541fa1c2e..bcb95e6eb9 100644
--- a/frontend/src/hooks/api/appConnections/types/app-options.ts
+++ b/frontend/src/hooks/api/appConnections/types/app-options.ts
@@ -255,6 +255,10 @@ export type TAnthropicConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Anthropic;
};
+export type TFireworksConnectionOption = TAppConnectionOptionBase & {
+ app: AppConnection.Fireworks;
+};
+
export type TOvhConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.OVH;
};
@@ -379,7 +383,8 @@ export type TAppConnectionOption =
| TConvexConnectionOption
| TTriggerDevConnectionOption
| THasuraCloudConnectionOption
- | TQoveryConnectionOption;
+ | TQoveryConnectionOption
+ | TFireworksConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -455,4 +460,5 @@ export type TAppConnectionOptionMap = {
[AppConnection.TriggerDev]: TTriggerDevConnectionOption;
[AppConnection.HasuraCloud]: THasuraCloudConnectionOption;
[AppConnection.Qovery]: TQoveryConnectionOption;
+ [AppConnection.Fireworks]: TFireworksConnectionOption;
};
diff --git a/frontend/src/hooks/api/appConnections/types/fireworks-connection.ts b/frontend/src/hooks/api/appConnections/types/fireworks-connection.ts
new file mode 100644
index 0000000000..5100e8c2d0
--- /dev/null
+++ b/frontend/src/hooks/api/appConnections/types/fireworks-connection.ts
@@ -0,0 +1,14 @@
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
+
+export enum FireworksConnectionMethod {
+ ApiKey = "api-key"
+}
+
+export type TFireworksConnection = TRootAppConnection & { app: AppConnection.Fireworks } & {
+ method: FireworksConnectionMethod.ApiKey;
+ credentials: {
+ accountId: string;
+ apiKey: string;
+ };
+};
diff --git a/frontend/src/hooks/api/appConnections/types/index.ts b/frontend/src/hooks/api/appConnections/types/index.ts
index 956de5365d..2f5e393624 100644
--- a/frontend/src/hooks/api/appConnections/types/index.ts
+++ b/frontend/src/hooks/api/appConnections/types/index.ts
@@ -29,6 +29,7 @@ import { TDNSMadeEasyConnection } from "./dns-made-easy-connection";
import { TDopplerConnection } from "./doppler-connection";
import { TExternalInfisicalConnection } from "./external-infisical-connection";
import { TF5BigIpConnection } from "./f5-big-ip-connection";
+import { TFireworksConnection } from "./fireworks-connection";
import { TFlyioConnection } from "./flyio-connection";
import { TGcpConnection } from "./gcp-connection";
import { TGitHubConnection } from "./github-connection";
@@ -101,6 +102,7 @@ export * from "./dns-made-easy-connection";
export * from "./doppler-connection";
export * from "./external-infisical-connection";
export * from "./f5-big-ip-connection";
+export * from "./fireworks-connection";
export * from "./flyio-connection";
export * from "./gcp-connection";
export * from "./github-connection";
@@ -218,7 +220,8 @@ export type TAppConnection =
| TConvexConnection
| TTriggerDevConnection
| THasuraCloudConnection
- | TQoveryConnection;
+ | TQoveryConnection
+ | TFireworksConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id" | "projectId">;
diff --git a/frontend/src/hooks/api/secretRotationsV2/enums.ts b/frontend/src/hooks/api/secretRotationsV2/enums.ts
index ce3c11c8e5..ed7ad82e25 100644
--- a/frontend/src/hooks/api/secretRotationsV2/enums.ts
+++ b/frontend/src/hooks/api/secretRotationsV2/enums.ts
@@ -19,7 +19,8 @@ export enum SecretRotation {
SupabaseApiKey = "supabase-api-key",
SalesforceOauthCredentials = "salesforce-oauth-credentials",
DatadogApplicationKeySecret = "datadog-application-key-secret",
- ConvexAccessKey = "convex-access-key"
+ ConvexAccessKey = "convex-access-key",
+ FireworksApiKey = "fireworks-api-key"
}
export enum SecretRotationStatus {
diff --git a/frontend/src/hooks/api/secretRotationsV2/types/fireworks-api-key-rotation.ts b/frontend/src/hooks/api/secretRotationsV2/types/fireworks-api-key-rotation.ts
new file mode 100644
index 0000000000..baed953fd8
--- /dev/null
+++ b/frontend/src/hooks/api/secretRotationsV2/types/fireworks-api-key-rotation.ts
@@ -0,0 +1,36 @@
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { SecretRotation } from "@app/hooks/api/secretRotationsV2";
+import {
+ TSecretRotationV2Base,
+ TSecretRotationV2GeneratedCredentialsResponseBase
+} from "@app/hooks/api/secretRotationsV2/types/shared";
+
+export type TFireworksApiKeyRotation = TSecretRotationV2Base & {
+ type: SecretRotation.FireworksApiKey;
+ parameters: {
+ keyName: string;
+ };
+ secretsMapping: {
+ secretValue: string;
+ };
+};
+
+export type TFireworksApiKeyRotationGeneratedCredentials = {
+ secretName: string;
+ secretValue: string;
+};
+
+export type TFireworksApiKeyRotationGeneratedCredentialsResponse =
+ TSecretRotationV2GeneratedCredentialsResponseBase<
+ SecretRotation.FireworksApiKey,
+ TFireworksApiKeyRotationGeneratedCredentials
+ >;
+
+export type TFireworksApiKeyRotationOption = {
+ name: string;
+ type: SecretRotation.FireworksApiKey;
+ connection: AppConnection.Fireworks;
+ template: {
+ secretsMapping: TFireworksApiKeyRotation["secretsMapping"];
+ };
+};
diff --git a/frontend/src/hooks/api/secretRotationsV2/types/index.ts b/frontend/src/hooks/api/secretRotationsV2/types/index.ts
index 3f0370531f..8bfd091a0b 100644
--- a/frontend/src/hooks/api/secretRotationsV2/types/index.ts
+++ b/frontend/src/hooks/api/secretRotationsV2/types/index.ts
@@ -51,6 +51,11 @@ import {
TDbtServiceTokenRotationGeneratedCredentialsResponse,
TDbtServiceTokenRotationOption
} from "./dbt-service-token-rotation";
+import {
+ TFireworksApiKeyRotation,
+ TFireworksApiKeyRotationGeneratedCredentialsResponse,
+ TFireworksApiKeyRotationOption
+} from "./fireworks-api-key-rotation";
import {
THpIloRotation,
THpIloRotationGeneratedCredentialsResponse,
@@ -127,6 +132,7 @@ export type TSecretRotationV2 = (
| TSalesforceOauthCredentialsRotation
| TDatadogApplicationKeySecretRotation
| TConvexAccessKeyRotation
+ | TFireworksApiKeyRotation
) & {
secrets: (SecretV3RawSanitized | null)[];
};
@@ -149,7 +155,8 @@ export type TSecretRotationV2Option =
| TSupabaseApiKeyRotationOption
| TSalesforceOauthCredentialsRotationOption
| TDatadogApplicationKeySecretRotationOption
- | TConvexAccessKeyRotationOption;
+ | TConvexAccessKeyRotationOption
+ | TFireworksApiKeyRotationOption;
export type TListSecretRotationV2Options = { secretRotationOptions: TSecretRotationV2Option[] };
@@ -176,7 +183,8 @@ export type TViewSecretRotationGeneratedCredentialsResponse =
| TSupabaseApiKeyRotationGeneratedCredentialsResponse
| TSalesforceOauthCredentialsRotationGeneratedCredentialsResponse
| TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse
- | TConvexAccessKeyRotationGeneratedCredentialsResponse;
+ | TConvexAccessKeyRotationGeneratedCredentialsResponse
+ | TFireworksApiKeyRotationGeneratedCredentialsResponse;
export type TCreateSecretRotationV2DTO = DiscriminativePick<
TSecretRotationV2,
@@ -252,6 +260,7 @@ export type TSecretRotationOptionMap = {
[SecretRotation.SalesforceOauthCredentials]: TSalesforceOauthCredentialsRotationOption;
[SecretRotation.DatadogApplicationKeySecret]: TDatadogApplicationKeySecretRotationOption;
[SecretRotation.ConvexAccessKey]: TConvexAccessKeyRotationOption;
+ [SecretRotation.FireworksApiKey]: TFireworksApiKeyRotationOption;
};
export type TSecretRotationGeneratedCredentialsResponseMap = {
@@ -276,6 +285,7 @@ export type TSecretRotationGeneratedCredentialsResponseMap = {
[SecretRotation.SalesforceOauthCredentials]: TSalesforceOauthCredentialsRotationGeneratedCredentialsResponse;
[SecretRotation.DatadogApplicationKeySecret]: TDatadogApplicationKeySecretRotationGeneratedCredentialsResponse;
[SecretRotation.ConvexAccessKey]: TConvexAccessKeyRotationGeneratedCredentialsResponse;
+ [SecretRotation.FireworksApiKey]: TFireworksApiKeyRotationGeneratedCredentialsResponse;
};
// Unified type for local account reconciliation (Unix/Linux, Windows, and HP iLO)
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
index 5476e5e78c..dffd7f910a 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx
@@ -44,6 +44,7 @@ import { DNSMadeEasyConnectionForm } from "./DNSMadeEasyConnectionForm";
import { DopplerConnectionForm } from "./DopplerConnectionForm";
import { ExternalInfisicalConnectionForm } from "./ExternalInfisicalConnectionForm";
import { F5BigIpConnectionForm } from "./F5BigIpConnectionForm";
+import { FireworksConnectionForm } from "./FireworksConnectionForm";
import { FlyioConnectionForm } from "./FlyioConnectionForm";
import { GcpConnectionForm } from "./GcpConnectionForm";
import { GitHubConnectionForm } from "./GitHubConnectionForm";
@@ -295,6 +296,8 @@ const CreateForm = ({ app, onComplete, projectId }: CreateFormProps) => {
return <OpenRouterConnectionForm onSubmit={onSubmit} />;
case AppConnection.Anthropic:
return <AnthropicConnectionForm onSubmit={onSubmit} />;
+ case AppConnection.Fireworks:
+ return <FireworksConnectionForm onSubmit={onSubmit} />;
case AppConnection.Devin:
return <DevinConnectionForm onSubmit={onSubmit} />;
case AppConnection.CircleCI:
@@ -550,6 +553,8 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {
return <OpenRouterConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.Anthropic:
return <AnthropicConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
+ case AppConnection.Fireworks:
+ return <FireworksConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.Devin:
return <DevinConnectionForm onSubmit={onSubmit} appConnection={appConnection} />;
case AppConnection.CircleCI:
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/FireworksConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/FireworksConnectionForm.tsx
new file mode 100644
index 0000000000..9b3afebd6d
--- /dev/null
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/FireworksConnectionForm.tsx
@@ -0,0 +1,160 @@
+import { Controller, FormProvider, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { Info } from "lucide-react";
+import { z } from "zod";
+
+import {
+ Field,
+ FieldError,
+ FieldLabel,
+ Input,
+ SecretInput,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import {
+ FireworksConnectionMethod,
+ TFireworksConnection
+} from "@app/hooks/api/appConnections/types/fireworks-connection";
+
+import { AppConnectionFormFooter } from "./AppConnectionFormFooter";
+import {
+ genericAppConnectionFieldsSchema,
+ GenericAppConnectionsFields
+} from "./GenericAppConnectionFields";
+
+type Props = {
+ appConnection?: TFireworksConnection;
+ onSubmit: (formData: FormData) => void;
+};
+
+const rootSchema = genericAppConnectionFieldsSchema.extend({
+ app: z.literal(AppConnection.Fireworks)
+});
+
+const formSchema = z.discriminatedUnion("method", [
+ rootSchema.extend({
+ method: z.literal(FireworksConnectionMethod.ApiKey),
+ credentials: z.object({
+ accountId: z.string().trim().min(1, "Account ID required"),
+ apiKey: z.string().trim().min(1, "API Key required")
+ })
+ })
+]);
+
+type FormData = z.infer<typeof formSchema>;
+
+export const FireworksConnectionForm = ({ appConnection, onSubmit }: Props) => {
+ const isUpdate = Boolean(appConnection);
+
+ const form = useForm<FormData>({
+ resolver: zodResolver(formSchema),
+ defaultValues: appConnection ?? {
+ app: AppConnection.Fireworks,
+ method: FireworksConnectionMethod.ApiKey
+ }
+ });
+
+ const { handleSubmit, control } = form;
+
+ return (
+ <FormProvider {...form}>
+ <form onSubmit={handleSubmit(onSubmit)}>
+ {!isUpdate && <GenericAppConnectionsFields />}
+ <Controller
+ name="method"
+ control={control}
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel>
+ Method
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ {`The method you would like to use to connect with ${
+ APP_CONNECTION_MAP[AppConnection.Fireworks].name
+ }. This field cannot be changed after creation.`}
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Select disabled={isUpdate} value={value} onValueChange={(val) => onChange(val)}>
+ <SelectTrigger className="w-full" isError={Boolean(error)}>
+ <SelectValue placeholder="Select a method..." />
+ </SelectTrigger>
+ <SelectContent position="popper">
+ {Object.values(FireworksConnectionMethod).map((method) => (
+ <SelectItem value={method} key={method}>
+ {getAppConnectionMethodDetails(method).name}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ <Controller
+ name="credentials.accountId"
+ control={control}
+ shouldUnregister
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="account-id">
+ Account ID
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Fireworks account ID used to identify the Fireworks account.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <Input
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ placeholder="Account ID"
+ />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ <Controller
+ name="credentials.apiKey"
+ control={control}
+ shouldUnregister
+ render={({ field: { value, onChange }, fieldState: { error } }) => (
+ <Field className="mb-4">
+ <FieldLabel htmlFor="api-key">
+ API Key
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-sm">
+ The Fireworks API key used to authenticate with the Fireworks API.
+ </TooltipContent>
+ </Tooltip>
+ </FieldLabel>
+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />
+ <FieldError errors={[error]} />
+ </Field>
+ )}
+ />
+ <AppConnectionFormFooter
+ submitLabel={isUpdate ? "Update Credentials" : "Connect to Fireworks"}
+ />
+ </form>
+ </FormProvider>
+ );
+};