Skip to content

Commit 646f7e6

Browse files
authored
Merge pull request #125 from FlowTestAI/authorized-upload
upload flow scans as authorized users
2 parents 08398ef + c245e2f commit 646f7e6

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/flowtest-cli/bin/axiosClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const axios = require('axios');
33
const axiosRetry = require('axios-retry').default;
44

5-
const baseUrl = 'http://localhost:3000';
5+
const baseUrl = 'https://flowtest-ai.vercel.app';
66

77
const axiosClient = axios.create({
88
baseURL: `${baseUrl}/api`,

packages/flowtest-cli/bin/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const { cloneDeep } = require('lodash');
1010
const dotenv = require('dotenv');
1111
const { GraphLogger, LogLevel } = require('../graph/GraphLogger');
1212
const { baseUrl, axiosClient } = require('./axiosClient');
13+
require('dotenv').config();
1314

1415
const getEnvVariables = (pathname) => {
1516
const content = readFile(pathname);
@@ -108,10 +109,14 @@ const argv = yargs(hideBin(process.argv))
108109
},
109110
scan: bytesToBase64(new TextEncoder().encode(JSON.stringify(logger.get()))),
110111
};
112+
const accessId = process.env.FLOWTEST_ACCESS_ID;
113+
const accessKey = process.env.FLOWTEST_ACCESS_KEY;
111114
try {
112115
const response = await axiosClient.post('/upload', data, {
113116
headers: {
114117
'Content-Type': 'application/json',
118+
'x-access-id': accessId,
119+
'x-access-key': accessKey,
115120
},
116121
});
117122
console.log(chalk.bold('Flow Scan: ') + chalk.dim(`${baseUrl}/scan/${response.data.data[0].id}`));

packages/flowtest-electron/src/ipc/axiosClient.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const axiosClient = (baseUrl, accessId, accessKey) => {
77
baseURL: `${baseUrl}/api`,
88
headers: {
99
'Content-Type': 'application/json',
10+
'x-access-id': accessId,
11+
'x-access-key': accessKey,
1012
},
1113
});
1214

src/components/molecules/modals/SettingsModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const SettingsModal = ({ closeFn = () => null, open = false, initialTab = 0 }) =
4242

4343
const onFormSubmit = async (data) => {
4444
try {
45-
await addLogSyncConfig(data.enabled, 'http://localhost:3000', data.accessId, data.accessKey);
45+
await addLogSyncConfig(data.enabled, 'https://flowtest-ai.vercel.app', data.accessId, data.accessKey);
4646
// send the form data as a request
4747
showSuccessFullSubmissionMessage(true);
4848
closeFn();

0 commit comments

Comments
 (0)