mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 15:29:46 +00:00
Move CLIENT_ID envars to be fetched from backend for (cloud) integration options
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import SecurityClient from '~/utilities/SecurityClient';
|
||||
|
||||
const getIntegrationOptions = () => {
|
||||
return SecurityClient.fetchCall(
|
||||
'/api/v1/integration-auth/integration-options',
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
).then(async (res) => {
|
||||
if (res && res.status == 200) {
|
||||
return (await res.json()).integrationOptions;
|
||||
} else {
|
||||
console.log('Failed to get (cloud) integration options');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export default getIntegrationOptions;
|
||||
@@ -8,10 +8,9 @@ import FrameworkIntegrationSection from "~/components/integrations/FrameworkInte
|
||||
import CloudIntegrationSection from "~/components/integrations/CloudIntegrationSection";
|
||||
import IntegrationSection from "~/components/integrations/IntegrationSection";
|
||||
import frameworkIntegrationOptions from "../../public/json/frameworkIntegrations.json";
|
||||
// import cloudIntegrationOptions from "../../public/json/cloudIntegrations.json";
|
||||
import { cloudIntegrationOptions } from "../../public/data/cloudIntegrations";
|
||||
import getWorkspaceAuthorizations from "../api/integrations/getWorkspaceAuthorizations";
|
||||
import getWorkspaceIntegrations from "../api/integrations/getWorkspaceIntegrations";
|
||||
import getIntegrationOptions from "../api/integrations/GetIntegrationOptions";
|
||||
import getBot from "../api/bot/getBot";
|
||||
import setBotActiveStatus from "../api/bot/setBotActiveStatus";
|
||||
import getLatestFileKey from "../api/workspace/getLatestFileKey";
|
||||
@@ -26,6 +25,7 @@ const crypto = require("crypto");
|
||||
import axios from "axios";
|
||||
|
||||
export default function Integrations() {
|
||||
const [cloudIntegrationOptions, setCloudIntegrationOptions] = useState([]);
|
||||
const [integrationAuths, setIntegrationAuths] = useState([]);
|
||||
const [integrations, setIntegrations] = useState([]);
|
||||
const [bot, setBot] = useState(null);
|
||||
@@ -37,6 +37,11 @@ export default function Integrations() {
|
||||
|
||||
useEffect(async () => {
|
||||
try {
|
||||
// get cloud integration options
|
||||
setCloudIntegrationOptions(
|
||||
await getIntegrationOptions()
|
||||
);
|
||||
|
||||
// get project integration authorizations
|
||||
setIntegrationAuths(
|
||||
await getWorkspaceAuthorizations({
|
||||
@@ -201,12 +206,16 @@ export default function Integrations() {
|
||||
handleIntegrationOption={handleIntegrationOption}
|
||||
/> */}
|
||||
<IntegrationSection integrations={integrations} />
|
||||
<CloudIntegrationSection
|
||||
cloudIntegrationOptions={cloudIntegrationOptions}
|
||||
setSelectedIntegrationOption={setSelectedIntegrationOption}
|
||||
integrationOptionPress={integrationOptionPress}
|
||||
integrationAuths={integrationAuths}
|
||||
/>
|
||||
{cloudIntegrationOptions.length > 0 ? (
|
||||
<CloudIntegrationSection
|
||||
cloudIntegrationOptions={cloudIntegrationOptions}
|
||||
setSelectedIntegrationOption={setSelectedIntegrationOption}
|
||||
integrationOptionPress={integrationOptionPress}
|
||||
integrationAuths={integrationAuths}
|
||||
/>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
<FrameworkIntegrationSection
|
||||
frameworks={frameworkIntegrationOptions}
|
||||
/>
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
import {
|
||||
CLIENT_ID_HEROKU,
|
||||
CLIENT_ID_NETLIFY
|
||||
} from '../../components/utilities/config';
|
||||
|
||||
const cloudIntegrationOptions = [
|
||||
{
|
||||
name: 'Heroku',
|
||||
slug: 'heroku',
|
||||
image: 'Heroku',
|
||||
isAvailable: true,
|
||||
type: 'oauth2',
|
||||
clientId: CLIENT_ID_HEROKU,
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Vercel',
|
||||
slug: 'vercel',
|
||||
image: 'Vercel',
|
||||
isAvailable: true,
|
||||
type: 'vercel',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Netlify',
|
||||
slug: 'netlify',
|
||||
image: 'Netlify',
|
||||
isAvailable: true,
|
||||
type: 'oauth2',
|
||||
clientId: CLIENT_ID_NETLIFY,
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Google Cloud Platform',
|
||||
slug: 'gcp',
|
||||
image: 'Google Cloud Platform',
|
||||
isAvailable: false,
|
||||
type: '',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Amazon Web Services',
|
||||
slug: 'aws',
|
||||
image: 'Amazon Web Services',
|
||||
isAvailable: false,
|
||||
type: '',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Microsoft Azure',
|
||||
slug: 'azure',
|
||||
image: 'Microsoft Azure',
|
||||
isAvailable: false,
|
||||
type: '',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Travis CI',
|
||||
slug: 'travisci',
|
||||
image: 'Travis CI',
|
||||
isAvailable: false,
|
||||
type: '',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
},
|
||||
{
|
||||
name: 'Circle CI',
|
||||
slug: 'circleci',
|
||||
image: 'Circle CI',
|
||||
isAvailable: false,
|
||||
type: '',
|
||||
clientId: '',
|
||||
docsLink: ''
|
||||
}
|
||||
]
|
||||
|
||||
export { cloudIntegrationOptions };
|
||||
@@ -1,75 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Heroku",
|
||||
"slug": "heroku",
|
||||
"image": "Heroku",
|
||||
"isAvailable": true,
|
||||
"type": "oauth2",
|
||||
"clientId": "7b1311a1-1cb2-4938-8adf-f37a399ec41b",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Vercel",
|
||||
"slug": "vercel",
|
||||
"image": "Vercel",
|
||||
"isAvailable": true,
|
||||
"type": "vercel",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Netlify",
|
||||
"slug": "netlify",
|
||||
"image": "Netlify",
|
||||
"isAvailable": true,
|
||||
"type": "oauth2",
|
||||
"clientId": "fYWBhD3gt0pT62UIwYrlGRcy--pPVLYIQad6ORrES9o",
|
||||
"redirectURL": "http://localhost:8080/netlify",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Google Cloud Platform",
|
||||
"slug": "gcp",
|
||||
"image": "Google Cloud Platform",
|
||||
"isAvailable": false,
|
||||
"type": "",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Amazon Web Services",
|
||||
"slug": "aws",
|
||||
"image": "Amazon Web Services",
|
||||
"isAvailable": false,
|
||||
"type": "",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Microsoft Azure",
|
||||
"slug": "azure",
|
||||
"image": "Microsoft Azure",
|
||||
"isAvailable": false,
|
||||
"type": "",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Travis CI",
|
||||
"slug": "travisci",
|
||||
"image": "Travis CI",
|
||||
"isAvailable": false,
|
||||
"type": "",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
},
|
||||
{
|
||||
"name": "Circle CI",
|
||||
"slug": "circleci",
|
||||
"image": "Circle CI",
|
||||
"isAvailable": false,
|
||||
"type": "",
|
||||
"clientId": "",
|
||||
"docsLink": ""
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user