Compare commits

...

9 Commits

Author SHA1 Message Date
Vladyslav Matsiiako
8f39f953f8 fix PR review comments for databricks integration 2024-10-04 16:04:00 -07:00
Vladyslav Matsiiako
2d2f27ea46 accounted for not scopes in databricks use case 2024-10-04 00:27:17 -07:00
Vladyslav Matsiiako
4aeb2bf65e fix pr review for databricks integration 2024-10-04 00:09:33 -07:00
Vladyslav Matsiiako
2fc562ff2d update image for databricks integartion 2024-10-03 16:36:07 -07:00
Vladyslav Matsiiako
b5c83fea4d fixed databricks integration docs 2024-10-03 16:28:19 -07:00
Vladyslav Matsiiako
b586f98926 fixed databricks integration docs 2024-10-03 16:26:38 -07:00
Vladyslav Matsiiako
e6205c086f fix license changes 2024-10-03 16:23:39 -07:00
Vladyslav Matsiiako
2ca34099ed added custom instance URLs to databricks 2024-10-03 16:21:47 -07:00
Vladyslav Matsiiako
25b55087cf added databricks integration 2024-10-02 22:49:02 -07:00
39 changed files with 516 additions and 162 deletions

View File

@@ -455,6 +455,31 @@ const getAppsCircleCI = async ({ accessToken }: { accessToken: string }) => {
return apps;
};
/**
* Return list of projects for Databricks integration
*/
const getAppsDatabricks = async ({ url, accessToken }: { url?: string | null; accessToken: string }) => {
const databricksApiUrl = `${url}/api`;
const res = await request.get<{ scopes: { name: string; backend_type: string }[] }>(
`${databricksApiUrl}/2.0/secrets/scopes/list`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
"Accept-Encoding": "application/json"
}
}
);
const scopes =
res.data?.scopes?.map((a) => ({
name: a.name, // name maps to unique scope name in Databricks
backend_type: a.backend_type
})) ?? [];
return scopes;
};
const getAppsTravisCI = async ({ accessToken }: { accessToken: string }) => {
const res = (
await request.get<{ id: string; slug: string }[]>(`${IntegrationUrls.TRAVISCI_API_URL}/repos`, {
@@ -1104,6 +1129,12 @@ export const getApps = async ({
accessToken
});
case Integrations.DATABRICKS:
return getAppsDatabricks({
url,
accessToken
});
case Integrations.LARAVELFORGE:
return getAppsLaravelForge({
accessToken,

View File

@@ -15,6 +15,7 @@ export enum Integrations {
FLYIO = "flyio",
LARAVELFORGE = "laravel-forge",
CIRCLECI = "circleci",
DATABRICKS = "databricks",
TRAVISCI = "travisci",
TEAMCITY = "teamcity",
SUPABASE = "supabase",
@@ -73,6 +74,7 @@ export enum IntegrationUrls {
RAILWAY_API_URL = "https://backboard.railway.app/graphql/v2",
FLYIO_API_URL = "https://api.fly.io/graphql",
CIRCLECI_API_URL = "https://circleci.com/api",
DATABRICKS_API_URL = "https:/xxxx.com/api",
TRAVISCI_API_URL = "https://api.travis-ci.com",
SUPABASE_API_URL = "https://api.supabase.com",
LARAVELFORGE_API_URL = "https://forge.laravel.com",
@@ -210,6 +212,15 @@ export const getIntegrationOptions = async () => {
clientId: "",
docsLink: ""
},
{
name: "Databricks",
slug: "databricks",
image: "Databricks.png",
isAvailable: true,
type: "pat",
clientId: "",
docsLink: ""
},
{
name: "GitLab",
slug: "gitlab",

View File

@@ -2085,6 +2085,80 @@ const syncSecretsCircleCI = async ({
);
};
/**
* Sync/push [secrets] to Databricks project
*/
const syncSecretsDatabricks = async ({
integration,
integrationAuth,
secrets,
accessToken
}: {
integration: TIntegrations;
integrationAuth: TIntegrationAuths;
secrets: Record<string, { value: string; comment?: string }>;
accessToken: string;
}) => {
const databricksApiUrl = `${integrationAuth.url}/api`;
// sync secrets to Databricks
await Promise.all(
Object.keys(secrets).map(async (key) =>
request.post(
`${databricksApiUrl}/2.0/secrets/put`,
{
scope: integration.app,
key,
string_value: secrets[key].value
},
{
headers: {
Authorization: `Bearer ${accessToken}`,
"Accept-Encoding": "application/json"
}
}
)
)
);
// get secrets from Databricks
const getSecretsRes = (
await request.get<{ secrets: { key: string; last_updated_timestamp: number }[] }>(
`${databricksApiUrl}/2.0/secrets/list`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json"
},
params: {
scope: integration.app
}
}
)
).data.secrets;
// delete secrets from Databricks
await Promise.all(
getSecretsRes.map(async (sec) => {
if (!(sec.key in secrets)) {
return request.post(
`${databricksApiUrl}/2.0/secrets/delete`,
{
scope: integration.app,
key: sec.key
},
{
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json"
}
}
);
}
})
);
};
/**
* Sync/push [secrets] to TravisCI project
*/
@@ -4021,6 +4095,14 @@ export const syncIntegrationSecrets = async ({
accessToken
});
break;
case Integrations.DATABRICKS:
await syncSecretsDatabricks({
integration,
integrationAuth,
secrets,
accessToken
});
break;
case Integrations.LARAVELFORGE:
await syncSecretsLaravelForge({
integration,

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

View File

@@ -21,12 +21,6 @@ Prerequisites:
![integrations circleci authorization](../../images/integrations/circleci/integrations-circleci-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which CircleCI project and press create integration to start syncing secrets to CircleCI.

View File

@@ -22,12 +22,6 @@ Prerequisites:
![integrations codefresh authorization](../../images/integrations/codefresh/integrations-codefresh-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Codefresh service and press create integration to start syncing secrets to Codefresh.

View File

@@ -27,10 +27,6 @@ Prerequisites:
![integrations github authorization](../../images/integrations/github/integrations-github-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant Infisical access to your project's environment variables.
Although this step breaks E2EE, it's necessary for Infisical to sync the environment variables to the cloud platform.
</Info>
</Step>
<Step title="Configure Infisical GitHub integration">
Select which Infisical environment secrets you want to sync to which GitHub organization, repository, or repository environment.

View File

@@ -20,12 +20,6 @@ description: "How to sync secrets from Infisical to GitLab"
![integrations gitlab authorization](../../images/integrations/gitlab/integrations-gitlab-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which GitLab repository and press create integration to start syncing secrets to GitLab.

View File

@@ -21,13 +21,6 @@ Prerequisites:
![integrations rundeck authorization](../../images/integrations/rundeck/integrations-rundeck-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to a Rundeck Key Storage Path and press create integration to start syncing secrets to Rundeck.

View File

@@ -21,12 +21,6 @@ Prerequisites:
![integrations travis ci authorization](../../images/integrations/travis-ci/integrations-travisci-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Travis CI repository and press create integration to start syncing secrets to Travis CI.

View File

@@ -60,13 +60,6 @@ Prerequisites:
![integration auth](../../images/integrations/aws/integrations-aws-parameter-store-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which AWS Parameter Store region and indicate the path for your secrets. Then, press create integration to start syncing secrets to AWS Parameter Store.

View File

@@ -22,12 +22,6 @@ Prerequisites:
![integrations checkly authorization](../../images/integrations/checkly/integrations-checkly-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to Checkly and press create integration to start syncing secrets.

View File

@@ -31,13 +31,6 @@ Copy and save your token.
Click on the Cloud 66 tile and enter your API token to grant Infisical access to your Cloud 66 account.
![integrations cloud 66 tile in infisical dashboard](../../images/integrations/cloud-66/integrations-cloud-66-infisical-dashboard.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
Enter your Cloud 66 Personal Access Token here. Then click "Connect to Cloud 66".
![integrations cloud 66 tile in infisical dashboard](../../images/integrations/cloud-66/integrations-cloud-66-paste-pat.png)

View File

@@ -29,12 +29,6 @@ Prerequisites:
![integrations cloudflare authorization](../../images/integrations/cloudflare/integrations-cloudflare-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to Cloudflare and press create integration to start syncing secrets.

View File

@@ -29,13 +29,6 @@ Prerequisites:
![integrations cloudflare authorization](../../images/integrations/cloudflare/integration-cloudflare-workers-connect.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to Cloudflare Workers and press create integration to start syncing secrets.

View File

@@ -0,0 +1,31 @@
---
title: "Databricks"
description: "Learn how to sync secrets from Infisical to Databricks."
---
Prerequisites:
- Set up and add secrets to [Infisical Cloud](https://app.infisical.com)
<Steps>
<Step title="Authorize Infisical for Databricks">
Obtain a Personal Access Token in **User Settings** > **Developer** > **Access Tokens**.
![integrations databricks token](../../images/integrations/databricks/pat-token.png)
Navigate to your project's integrations tab in Infisical.
![integrations](../../images/integrations.png)
Press on the Databricks tile and enter your Databricks instance URL in the following format: `https://xxx.cloud.databricks.com`. Then, input your Databricks Access Token to grant Infisical the necessary permissions in your Databricks account.
![integrations databricks authorization](../../images/integrations/databricks/integrations-databricks-auth.png)
</Step>
<Step title="Start integration">
Select which Infisical environment and secret path you want to sync to which Databricks scope. Then, press create integration to start syncing secrets to Databricks.
![create integration Databricks](../../images/integrations/databricks/integrations-databricks-create.png)
![integrations Databricks](../../images/integrations/databricks/integrations-databricks.png)
</Step>
</Steps>

View File

@@ -20,13 +20,6 @@ Name it **infisical**, choose **No expiry**, and make sure to check **Write (opt
Click on the **Digital Ocean App Platform** tile and enter your API token to grant Infisical access to your Digital Ocean account.
![integrations](../../images/integrations.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
Then enter your Digital Ocean Personal Access Token here. Then click "Connect to Digital Ocean App Platform".
![integrations infisical dashboard digital ocean integration](../../images/integrations/digital-ocean/integrations-do-enter-token.png)

View File

@@ -22,12 +22,6 @@ Prerequisites:
![integrations fly authorization](../../images/integrations/flyio/integrations-flyio-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Fly.io app and press create integration to start syncing secrets to Fly.io.

View File

@@ -24,12 +24,6 @@ description: "How to sync secrets from Infisical to GCP Secret Manager"
![integrations GCP authorization](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
In the **Connection** tab, select which Infisical environment secrets you want to sync to which GCP secret manager project. Lastly, press create integration to start syncing secrets to GCP secret manager.
@@ -85,12 +79,6 @@ description: "How to sync secrets from Infisical to GCP Secret Manager"
![integrations GCP authorization options](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager-auth-options.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
In the **Connection** tab, select which Infisical environment secrets you want to sync to the GCP secret manager project. Lastly, press create integration to start syncing secrets to GCP secret manager.

View File

@@ -21,12 +21,6 @@ Prerequisites:
![integrations hasura cloud authorization](../../images/integrations/hasura-cloud/integrations-hasura-cloud-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Hasura Cloud project and press create integration to start syncing secrets to Hasura Cloud.

View File

@@ -19,12 +19,6 @@ description: "How to sync secrets from Infisical to Heroku"
![integrations heroku authorization](../../images/integrations/heroku/integrations-heroku-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Heroku app and press create integration to start syncing secrets to Heroku.

View File

@@ -27,12 +27,6 @@ Prerequisites:
![integrations laravel forge authorization](../../images/integrations/laravel-forge/integrations-laravelforge-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Laravel Forge site and press create integration to start syncing secrets to Laravel Forge.

View File

@@ -25,12 +25,6 @@ description: "How to sync secrets from Infisical to Netlify"
![integrations netlify authorization](../../images/integrations/netlify/integrations-netlify-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Netlify app and context. Lastly, press create integration to start syncing secrets to Netlify.

View File

@@ -23,12 +23,6 @@ Prerequisites:
![integrations northflank authorization](../../images/integrations/northflank/integrations-northflank-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Northflank project and secret group. Finally, press create integration to start syncing secrets to Northflank.

View File

@@ -21,12 +21,6 @@ Prerequisites:
![integrations qovery authorization](../../images/integrations/qovery/integrations-qovery-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it is necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to Qovery and press create integration to start syncing secrets.

View File

@@ -30,12 +30,6 @@ Prerequisites:
![integrations railway authorization](../../images/integrations/railway/integrations-railway-authorization.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Railway project and environment (and optionally service). Lastly, press create integration to start syncing secrets to Railway.

View File

@@ -22,12 +22,6 @@ Prerequisites:
![integrations render authorization](../../images/integrations/render/integrations-render-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Render service and press create integration to start syncing secrets to Render.

View File

@@ -28,12 +28,6 @@ Prerequisites:
![integrations supabase authorization](../../images/integrations/supabase/integrations-supabase-authorization.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Supabase project. Lastly, press create integration to start syncing secrets to Supabase.

View File

@@ -28,12 +28,6 @@ Prerequisites:
![integrations teamcity authorization](../../images/integrations/teamcity/integrations-teamcity-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which TeamCity project (and optionally build configuration) and press create integration to start syncing secrets to TeamCity.

View File

@@ -22,12 +22,6 @@ Prerequisites:
![integrations windmill authorization](../../images/integrations/windmill/integrations-windmill-auth.png)
<Info>
If this is your project's first cloud integration, then you'll have to grant
Infisical access to your project's environment variables. Although this step
breaks E2EE, it's necessary for Infisical to sync the environment variables to
the cloud platform.
</Info>
</Step>
<Step title="Start integration">
Select which Infisical environment secrets you want to sync to which Windmill workspace and press create integration to start syncing secrets to Windmill.

View File

@@ -354,20 +354,21 @@
"integrations/cloud/cloudflare-workers"
]
},
"integrations/cloud/heroku",
"integrations/cloud/render",
"integrations/cloud/terraform-cloud",
"integrations/cloud/databricks",
{
"group": "View more",
"pages": [
"integrations/cloud/digital-ocean-app-platform",
"integrations/cloud/heroku",
"integrations/cloud/netlify",
"integrations/cloud/railway",
"integrations/cloud/flyio",
"integrations/cloud/render",
"integrations/cloud/laravel-forge",
"integrations/cloud/supabase",
"integrations/cloud/northflank",
"integrations/cloud/hasura-cloud",
"integrations/cloud/terraform-cloud",
"integrations/cloud/qovery",
"integrations/cloud/hashicorp-vault",
"integrations/cloud/cloud-66",

View File

@@ -16,6 +16,7 @@ const integrationSlugNameMapping: Mapping = {
railway: "Railway",
flyio: "Fly.io",
circleci: "CircleCI",
databricks: "Databricks",
travisci: "TravisCI",
supabase: "Supabase",
checkly: "Checkly",

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -0,0 +1,114 @@
import { useState } from "react";
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import { faArrowUpRightFromSquare, faBookOpen } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useSaveIntegrationAccessToken } from "@app/hooks/api";
import { Button, Card, CardTitle, FormControl, Input } from "../../../components/v2";
export default function DatabricksCreateIntegrationPage() {
const router = useRouter();
const { mutateAsync, isLoading } = useSaveIntegrationAccessToken();
const [apiKey, setApiKey] = useState("");
const [instanceURL, setInstanceURL] = useState("");
const [apiKeyErrorText, setApiKeyErrorText] = useState("");
const [instanceURLErrorText, setInstanceURLErrorText] = useState("");
const handleButtonClick = async () => {
try {
setApiKeyErrorText("");
setInstanceURLErrorText("");
if (apiKey.length === 0) {
setApiKeyErrorText("API Key cannot be blank");
return;
}
if (instanceURL.length === 0) {
setInstanceURLErrorText("Instance URL cannot be blank");
return;
}
const integrationAuth = await mutateAsync({
workspaceId: localStorage.getItem("projectData.id"),
integration: "databricks",
url: instanceURL.replace(/\/$/, ""),
accessToken: apiKey
});
router.push(`/integrations/databricks/create?integrationAuthId=${integrationAuth.id}`);
} catch (err) {
console.error(err);
}
};
return (
<div className="flex h-full w-full items-center justify-center">
<Head>
<title>Authorize Databricks Integration</title>
<link rel="icon" href="/infisical.ico" />
</Head>
<Card className="mb-12 max-w-lg rounded-md border border-mineshaft-600">
<CardTitle
className="px-6 text-left text-xl"
subTitle="After adding your Access Token, you will be prompted to set up an integration for a particular Infisical project and environment."
>
<div className="flex flex-row items-center">
<div className="inline flex items-center pb-0.5">
<Image
src="/images/integrations/Databricks.png"
height={30}
width={30}
alt="Databricks logo"
/>
</div>
<span className="ml-1.5">Databricks Integration </span>
<Link href="https://infisical.com/docs/integrations/cloud/databricks" passHref>
<a target="_blank" rel="noopener noreferrer">
<div className="ml-2 mb-1 inline-block cursor-default rounded-md bg-yellow/20 px-1.5 pb-[0.03rem] pt-[0.04rem] text-sm text-yellow opacity-80 hover:opacity-100">
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
Docs
<FontAwesomeIcon
icon={faArrowUpRightFromSquare}
className="ml-1.5 mb-[0.07rem] text-xxs"
/>
</div>
</a>
</Link>
</div>
</CardTitle>
<FormControl
label="Databricks Instance URL"
errorText={instanceURLErrorText}
isError={instanceURLErrorText !== "" ?? false}
className="px-6"
>
<Input value={instanceURL} onChange={(e) => setInstanceURL(e.target.value)} placeholder="https://xxxx.cloud.databricks.com" />
</FormControl>
<FormControl
label="Access Token"
errorText={apiKeyErrorText}
isError={apiKeyErrorText !== "" ?? false}
className="px-6"
>
<Input placeholder="" value={apiKey} onChange={(e) => setApiKey(e.target.value)} type="password" />
</FormControl>
<Button
onClick={handleButtonClick}
colorSchema="primary"
variant="outline_bg"
className="mb-6 mt-2 ml-auto mr-6 w-min"
isLoading={isLoading}
isDisabled={isLoading}
>
Connect to Databricks
</Button>
</Card>
</div>
);
}
DatabricksCreateIntegrationPage.requireAuth = true;

View File

@@ -0,0 +1,239 @@
import { useEffect, useState } from "react";
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import {
faArrowUpRightFromSquare,
faBookOpen,
faBugs,
faCircleInfo
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import queryString from "query-string";
import { createNotification } from "@app/components/notifications";
import { useCreateIntegration } from "@app/hooks/api";
import {
Button,
Card,
CardTitle,
FormControl,
Input,
Select,
SelectItem
} from "../../../components/v2";
import {
useGetIntegrationAuthApps,
useGetIntegrationAuthById
} from "../../../hooks/api/integrationAuth";
import { useGetWorkspaceById } from "../../../hooks/api/workspace";
export default function DatabricksCreateIntegrationPage() {
const router = useRouter();
const { mutateAsync, isLoading } = useCreateIntegration();
const { integrationAuthId } = queryString.parse(router.asPath.split("?")[1]);
const { data: workspace } = useGetWorkspaceById(localStorage.getItem("projectData.id") ?? "");
const { data: integrationAuth, isLoading: isintegrationAuthLoading } = useGetIntegrationAuthById(
(integrationAuthId as string) ?? ""
);
const { data: integrationAuthScopes, isLoading: isIntegrationAuthScopesLoading } =
useGetIntegrationAuthApps({
integrationAuthId: (integrationAuthId as string) ?? ""
});
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
const [targetScope, setTargetScope] = useState("");
const [secretPath, setSecretPath] = useState("/");
useEffect(() => {
if (workspace) {
setSelectedSourceEnvironment(workspace.environments[0].slug);
}
}, [workspace]);
const handleButtonClick = async () => {
try {
if (!integrationAuth?.id) return;
if (!targetScope) {
createNotification({
type: "error",
text: "Please select a scope"
});
return;
}
const selectedScope = integrationAuthScopes?.find(
(integrationAuthScope) => integrationAuthScope.name === targetScope
);
if (!selectedScope) {
createNotification({
type: "error",
text: "Invalid scope selected"
});
return;
}
await mutateAsync({
integrationAuthId: integrationAuth?.id,
isActive: true,
app: selectedScope.name, // scope name
sourceEnvironment: selectedSourceEnvironment,
secretPath
});
router.push(`/integrations/${localStorage.getItem("projectData.id")}`);
} catch (err) {
console.error(err);
}
};
return integrationAuth && workspace && selectedSourceEnvironment && integrationAuthScopes ? (
<div className="flex h-full w-full flex-col items-center justify-center">
<Head>
<title>Set Up Databricks Integration</title>
<link rel="icon" href="/infisical.ico" />
</Head>
<Card className="max-w-lg rounded-md border border-mineshaft-600">
<CardTitle
className="px-6 text-left text-xl"
subTitle="Choose which environment or folder in Infisical you want to sync to which Databricks secrets scope."
>
<div className="flex flex-row items-center">
<div className="flex items-center pb-0.5">
<Image
src="/images/integrations/Databricks.png"
height={30}
width={30}
alt="Databricks logo"
/>
</div>
<span className="ml-1.5">Databricks Integration </span>
<Link href="https://infisical.com/docs/integrations/cloud/databricks" passHref>
<a target="_blank" rel="noopener noreferrer">
<div className="ml-2 mb-1 inline-block cursor-default rounded-md bg-yellow/20 px-1.5 pb-[0.03rem] pt-[0.04rem] text-sm text-yellow opacity-80 hover:opacity-100">
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
Docs
<FontAwesomeIcon
icon={faArrowUpRightFromSquare}
className="ml-1.5 mb-[0.07rem] text-xxs"
/>
</div>
</a>
</Link>
</div>
</CardTitle>
<FormControl label="Project Environment" className="px-6">
<Select
value={selectedSourceEnvironment}
onValueChange={(val) => setSelectedSourceEnvironment(val)}
className="w-full border border-mineshaft-500"
>
{workspace?.environments.map((sourceEnvironment) => (
<SelectItem
value={sourceEnvironment.slug}
key={`source-environment-${sourceEnvironment.slug}`}
>
{sourceEnvironment.name}
</SelectItem>
))}
</Select>
</FormControl>
<FormControl label="Secrets Path" className="px-6">
<Input
value={secretPath}
onChange={(evt) => setSecretPath(evt.target.value)}
placeholder="Provide a path, default is /"
/>
</FormControl>
{integrationAuthScopes && (
<FormControl label="Databricks Scope" className="px-6">
<Select
value={targetScope}
onValueChange={(val) => {
setTargetScope(val);
}}
className="w-full border border-mineshaft-500"
placeholder={integrationAuthScopes.length === 0 ? "No scopes found." : "Select scope..."}
isDisabled={integrationAuthScopes.length === 0}
>
{integrationAuthScopes.length > 0 ? (
integrationAuthScopes.map((scope) => (
<SelectItem value={scope.name!} key={`target-scope-${scope.name}`}>
{scope.name}
</SelectItem>
))
) : (
<SelectItem value="none" key="target-app-none">
No scopes found
</SelectItem>
)}
</Select>
</FormControl>
)}
<Button
onClick={handleButtonClick}
colorSchema="primary"
variant="outline_bg"
className="mb-6 mt-2 ml-auto mr-6 w-min"
isLoading={isLoading}
isDisabled={integrationAuthScopes.length === 0 || isLoading}
>
Create Integration
</Button>
</Card>
<div className="mt-6 w-full max-w-md border-t border-mineshaft-800" />
<div className="mt-6 flex w-full max-w-lg flex-col rounded-md border border-mineshaft-600 bg-mineshaft-800 p-4">
<div className="flex flex-row items-center">
<FontAwesomeIcon icon={faCircleInfo} className="text-xl text-mineshaft-200" />{" "}
<span className="text-md ml-3 text-mineshaft-100">Pro Tip</span>
</div>
<span className="mt-4 text-sm text-mineshaft-300">
After creating an integration, your secrets will start syncing immediately. This might
cause an unexpected override of current secrets in Databricks with secrets from Infisical.
</span>
</div>
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
<Head>
<title>Set Up Databricks Integration</title>
<link rel="icon" href="/infisical.ico" />
</Head>
{isIntegrationAuthScopesLoading || isintegrationAuthLoading ? (
<img
src="/images/loading/loading.gif"
height={70}
width={120}
alt="infisical loading indicator"
/>
) : (
<div className="flex h-max max-w-md flex-col rounded-md border border-mineshaft-600 bg-mineshaft-800 p-6 text-center text-mineshaft-200">
<FontAwesomeIcon icon={faBugs} className="inlineli my-2 text-6xl" />
<p>
Something went wrong. Please contact{" "}
<a
className="inline cursor-pointer text-mineshaft-100 underline decoration-primary-500 underline-offset-4 opacity-80 duration-200 hover:opacity-100"
target="_blank"
rel="noopener noreferrer"
href="mailto:support@infisical.com"
>
support@infisical.com
</a>{" "}
if the issue persists.
</p>
</div>
)}
</div>
);
}
DatabricksCreateIntegrationPage.requireAuth = true;

View File

@@ -74,6 +74,9 @@ export const redirectForProviderAuth = (integrationOption: TCloudIntegration) =>
case "circleci":
link = `${window.location.origin}/integrations/circleci/authorize`;
break;
case "databricks":
link = `${window.location.origin}/integrations/databricks/authorize`;
break;
case "laravel-forge":
link = `${window.location.origin}/integrations/laravel-forge/authorize`;
break;