diff --git a/packages/bruno-cli/src/runner/run-single-request.js b/packages/bruno-cli/src/runner/run-single-request.js
index 8c98ff5e35..b0cffb9002 100644
--- a/packages/bruno-cli/src/runner/run-single-request.js
+++ b/packages/bruno-cli/src/runner/run-single-request.js
@@ -87,22 +87,22 @@ const runSingleRequest = async function (
const httpsAgentRequestFields = {};
if (insecure) {
httpsAgentRequestFields['rejectUnauthorized'] = false;
- }
-
- const caCertArray = [options['cacert'], process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
- const caCert = caCertArray.find((el) => el);
- if (caCert && caCert.length > 1) {
- try {
- httpsAgentRequestFields['ca'] = fs.readFileSync(caCert);
- } catch (err) {
- console.log('Error reading CA cert file:' + caCert, err);
+ } else {
+ const caCertArray = [options['cacert'], process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
+ const caCert = caCertArray.find((el) => el);
+ if (caCert && caCert.length > 1) {
+ try {
+ httpsAgentRequestFields['ca'] = fs.readFileSync(caCert);
+ } catch (err) {
+ console.log('Error reading CA cert file:' + caCert, err);
+ }
}
}
// set proxy if enabled
const proxyEnabled = get(brunoConfig, 'proxy.enabled', false);
- const proxyByPass = shouldUseProxy(request.url, get(brunoConfig, 'proxy.noProxy', ''));
- if (proxyEnabled && !proxyByPass) {
+ const shouldProxy = shouldUseProxy(request.url, get(brunoConfig, 'proxy.noProxy', ''));
+ if (proxyEnabled && shouldProxy) {
let proxyUri;
const interpolationOptions = {
envVars: envVariables,
diff --git a/packages/bruno-electron/src/ipc/application.js b/packages/bruno-electron/src/ipc/application.js
deleted file mode 100644
index 396de498ab..0000000000
--- a/packages/bruno-electron/src/ipc/application.js
+++ /dev/null
@@ -1,72 +0,0 @@
-const { ipcMain } = require('electron');
-const chokidar = require('chokidar');
-const stores = require('../store');
-
-const registerApplicationIpc = (mainWindow, preferences) => {
- const change = async (pathname, store) => {
- if (store === stores.PREFERENCES) {
- mainWindow.webContents.send('main:preferences-read', preferences.getAll());
- }
- };
-
- class StoreWatcher {
- constructor() {
- this.watchers = {};
- }
-
- addWatcher(watchPath, store) {
- console.log(`watcher add: ${watchPath} for store ${store}`);
-
- if (this.watchers[watchPath]) {
- this.watchers[watchPath].close();
- }
-
- const self = this;
- setTimeout(() => {
- const watcher = chokidar.watch(watchPath, {
- ignoreInitial: false,
- usePolling: false,
- persistent: true,
- ignorePermissionErrors: true,
- awaitWriteFinish: {
- stabilityThreshold: 80,
- pollInterval: 10
- },
- depth: 20
- });
-
- watcher.on('change', (pathname) => change(pathname, store));
-
- self.watchers[watchPath] = watcher;
- }, 100);
- }
-
- hasWatcher(watchPath) {
- return this.watchers[watchPath];
- }
-
- removeWatcher(watchPath) {
- if (this.watchers[watchPath]) {
- this.watchers[watchPath].close();
- this.watchers[watchPath] = null;
- }
- }
- }
-
- const storeWatcher = new StoreWatcher();
- storeWatcher.addWatcher(preferences.getPath(), stores.PREFERENCES);
-
- ipcMain.handle('renderer:ready-application', async () => {
- mainWindow.webContents.send('main:preferences-read', preferences.getAll());
- });
-
- ipcMain.handle('renderer:set-preferences', async (event, newPreferences) => {
- preferences.setPreferences(newPreferences);
- });
-
- ipcMain.handle('renderer:migrate-preferences', async (event, sslVerification) => {
- preferences.migrateSslVerification(sslVerification);
- });
-};
-
-module.exports = registerApplicationIpc;
diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js
index 1a6f609251..a63aba0dca 100644
--- a/packages/bruno-electron/src/ipc/network/index.js
+++ b/packages/bruno-electron/src/ipc/network/index.js
@@ -16,7 +16,7 @@ const { uuid } = require('../../utils/common');
const interpolateVars = require('./interpolate-vars');
const { interpolateString } = require('./interpolate-string');
const { sortFolder, getAllRequestsInFolderRecursively } = require('./helper');
-const preferences = require('../../store/preferences');
+const { preferences } = require('../../store/preferences');
const { getProcessEnvVars } = require('../../store/process-env');
const { getBrunoConfig } = require('../../store/bruno-config');
const { HttpsProxyAgent } = require('https-proxy-agent');
@@ -84,23 +84,81 @@ const getSize = (data) => {
return 0;
};
-function getHttpsAgentRequestFields() {
+const configureRequest = async (collectionUid, request, envVars, collectionVariables, processEnvVars) => {
const httpsAgentRequestFields = {};
if (!preferences.isTlsVerification()) {
httpsAgentRequestFields['rejectUnauthorized'] = false;
+ } else {
+ const cacCrtArray = [preferences.getCaCert(), process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
+ let caCertFile = cacCrtArray.find((el) => el);
+ if (caCertFile && caCertFile.length > 1) {
+ try {
+ httpsAgentRequestFields['ca'] = fs.readFileSync(caCertFile);
+ } catch (err) {
+ console.log('Error reading CA cert file:' + caCertFile, err);
+ }
+ }
}
- const cacCrtArray = [preferences.getCaCert(), process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
- let caCertFile = cacCrtArray.find((el) => el);
- if (caCertFile && caCertFile.length > 1) {
- try {
- httpsAgentRequestFields['ca'] = fs.readFileSync(caCertFile);
- } catch (err) {
- console.log('Error reading CA cert file:' + caCertFile, err);
+ // proxy configuration
+ const brunoConfig = getBrunoConfig(collectionUid);
+ let proxyConfig = get(brunoConfig, 'proxy', {});
+ let proxyEnabled = get(proxyConfig, 'enabled', 'disabled');
+ if (proxyEnabled === 'global') {
+ proxyConfig = preferences.getProxyConfig();
+ proxyEnabled = get(proxyConfig, 'enabled', false);
+ }
+ const shouldProxy = shouldUseProxy(request.url, get(proxyConfig, 'noProxy', ''));
+ if ((proxyEnabled === true || proxyEnabled === 'enabled') && shouldProxy) {
+ let proxyUri;
+ const interpolationOptions = {
+ envVars,
+ collectionVariables,
+ processEnvVars
+ };
+
+ const proxyProtocol = interpolateString(get(proxyConfig, 'protocol'), interpolationOptions);
+ const proxyHostname = interpolateString(get(proxyConfig, 'hostname'), interpolationOptions);
+ const proxyPort = interpolateString(get(proxyConfig, 'port'), interpolationOptions);
+ const proxyAuthEnabled = get(proxyConfig, 'auth.enabled', false);
+ const socksEnabled = proxyProtocol.includes('socks');
+
+ if (proxyAuthEnabled) {
+ const proxyAuthUsername = interpolateString(get(proxyConfig, 'auth.username'), interpolationOptions);
+ const proxyAuthPassword = interpolateString(get(proxyConfig, 'auth.password'), interpolationOptions);
+
+ proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`;
+ } else {
+ proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`;
+ }
+
+ if (socksEnabled) {
+ const socksProxyAgent = new SocksProxyAgent(proxyUri);
+ request.httpsAgent = socksProxyAgent;
+ request.httpAgent = socksProxyAgent;
+ } else {
+ request.httpsAgent = new HttpsProxyAgent(
+ proxyUri,
+ Object.keys(httpsAgentRequestFields).length > 0 ? { ...httpsAgentRequestFields } : undefined
+ );
+ request.httpAgent = new HttpProxyAgent(proxyUri);
}
+ } else if (Object.keys(httpsAgentRequestFields).length > 0) {
+ request.httpsAgent = new https.Agent({
+ ...httpsAgentRequestFields
+ });
}
- return httpsAgentRequestFields;
-}
+
+ const axiosInstance = makeAxiosInstance();
+
+ if (request.awsv4config) {
+ request.awsv4config = await resolveCredentials(request);
+ addAwsV4Interceptor(axiosInstance, request);
+ delete request.awsv4config;
+ }
+
+ return axiosInstance;
+};
const registerNetworkIpc = (mainWindow) => {
// handler for sending http request
@@ -224,64 +282,13 @@ const registerNetworkIpc = (mainWindow) => {
cancelTokenUid
});
- const httpsAgentRequestFields = getHttpsAgentRequestFields();
-
- // proxy configuration
- const brunoConfig = getBrunoConfig(collectionUid);
- let proxyConfig = get(brunoConfig, 'proxy', {});
- let proxyEnabled = get(proxyConfig, 'enabled', 'disabled');
- if (proxyEnabled === 'global') {
- proxyConfig = preferences.getProxyConfig();
- proxyEnabled = get(proxyConfig, 'enabled', false);
- }
- const proxyByPass = shouldUseProxy(request.url, get(proxyConfig, 'noProxy', ''));
- if ((proxyEnabled === true || proxyEnabled === 'enabled') && !proxyByPass) {
- let proxyUri;
- const interpolationOptions = {
- envVars,
- collectionVariables,
- processEnvVars
- };
-
- const proxyProtocol = interpolateString(get(proxyConfig, 'protocol'), interpolationOptions);
- const proxyHostname = interpolateString(get(proxyConfig, 'hostname'), interpolationOptions);
- const proxyPort = interpolateString(get(proxyConfig, 'port'), interpolationOptions);
- const proxyAuthEnabled = get(proxyConfig, 'auth.enabled', false);
- const socksEnabled = proxyProtocol.includes('socks');
-
- if (proxyAuthEnabled) {
- const proxyAuthUsername = interpolateString(get(proxyConfig, 'auth.username'), interpolationOptions);
- const proxyAuthPassword = interpolateString(get(proxyConfig, 'auth.password'), interpolationOptions);
-
- proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`;
- } else {
- proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`;
- }
-
- if (socksEnabled) {
- const socksProxyAgent = new SocksProxyAgent(proxyUri);
- request.httpsAgent = socksProxyAgent;
- request.httpAgent = socksProxyAgent;
- } else {
- request.httpsAgent = new HttpsProxyAgent(
- proxyUri,
- Object.keys(httpsAgentRequestFields).length > 0 ? { ...httpsAgentRequestFields } : undefined
- );
- request.httpAgent = new HttpProxyAgent(proxyUri);
- }
- } else if (Object.keys(httpsAgentRequestFields).length > 0) {
- request.httpsAgent = new https.Agent({
- ...httpsAgentRequestFields
- });
- }
-
- const axiosInstance = makeAxiosInstance();
-
- if (request.awsv4config) {
- request.awsv4config = await resolveCredentials(request);
- addAwsV4Interceptor(axiosInstance, request);
- delete request.awsv4config;
- }
+ const axiosInstance = await configureRequest(
+ collectionUid,
+ request,
+ envVars,
+ collectionVariables,
+ processEnvVars
+ );
/** @type {import('axios').AxiosResponse} */
const response = await axiosInstance(request);
@@ -684,60 +691,17 @@ const registerNetworkIpc = (mainWindow) => {
...eventData
});
- const httpsAgentRequestFields = getHttpsAgentRequestFields();
-
- // proxy configuration
- const brunoConfig = getBrunoConfig(collectionUid);
- let proxyConfig = get(brunoConfig, 'proxy', {});
- let proxyEnabled = get(proxyConfig, 'enabled', 'disabled');
- if (proxyEnabled === 'global') {
- proxyConfig = preferences.getProxyConfig();
- proxyEnabled = get(proxyConfig, 'enabled', false);
- }
- const proxyByPass = shouldUseProxy(request.url, get(proxyConfig, 'noProxy', ''));
- if ((proxyEnabled === true || proxyEnabled === 'enabled') && !proxyByPass) {
- let proxyUri;
- const interpolationOptions = {
- envVars,
- collectionVariables,
- processEnvVars
- };
-
- const proxyProtocol = interpolateString(get(proxyConfig, 'protocol'), interpolationOptions);
- const proxyHostname = interpolateString(get(proxyConfig, 'hostname'), interpolationOptions);
- const proxyPort = interpolateString(get(proxyConfig, 'port'), interpolationOptions);
- const proxyAuthEnabled = get(proxyConfig, 'auth.enabled', false);
- const socksEnabled = proxyProtocol.includes('socks');
-
- if (proxyAuthEnabled) {
- const proxyAuthUsername = interpolateString(get(proxyConfig, 'auth.username'), interpolationOptions);
- const proxyAuthPassword = interpolateString(get(proxyConfig, 'auth.password'), interpolationOptions);
-
- proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`;
- } else {
- proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`;
- }
-
- if (socksEnabled) {
- const socksProxyAgent = new SocksProxyAgent(proxyUri);
- request.httpsAgent = socksProxyAgent;
- request.httpAgent = socksProxyAgent;
- } else {
- request.httpsAgent = new HttpsProxyAgent(
- proxyUri,
- Object.keys(httpsAgentRequestFields).length > 0 ? { ...httpsAgentRequestFields } : undefined
- );
- request.httpAgent = new HttpProxyAgent(proxyUri);
- }
- } else if (Object.keys(httpsAgentRequestFields).length > 0) {
- request.httpsAgent = new https.Agent({
- ...httpsAgentRequestFields
- });
- }
+ const axiosInstance = await configureRequest(
+ collectionUid,
+ request,
+ envVars,
+ collectionVariables,
+ processEnvVars
+ );
- // send request
timeStart = Date.now();
- const response = await axios(request);
+ /** @type {import('axios').AxiosResponse} */
+ const response = await axiosInstance(request);
timeEnd = Date.now();
// run post-response vars
diff --git a/packages/bruno-electron/src/ipc/preferences.js b/packages/bruno-electron/src/ipc/preferences.js
index f93ec5e6fc..602de92b9e 100644
--- a/packages/bruno-electron/src/ipc/preferences.js
+++ b/packages/bruno-electron/src/ipc/preferences.js
@@ -1,9 +1,64 @@
const { ipcMain } = require('electron');
-const { getPreferences, savePreferences } = require('../store/preferences');
+const { getPreferences, savePreferences, getPath } = require('../store/preferences');
const { isDirectory } = require('../utils/filesystem');
const { openCollection } = require('../app/collections');
+const stores = require('../store');
+const chokidar = require('chokidar');
const registerPreferencesIpc = (mainWindow, watcher, lastOpenedCollections) => {
+ const change = async (pathname, store) => {
+ if (store === stores.PREFERENCES) {
+ mainWindow.webContents.send('main:load-preferences', getPreferences());
+ }
+ };
+
+ class StoreWatcher {
+ constructor() {
+ this.watchers = {};
+ }
+
+ addWatcher(watchPath, store) {
+ console.log(`watcher add: ${watchPath} for store ${store}`);
+
+ if (this.watchers[watchPath]) {
+ this.watchers[watchPath].close();
+ }
+
+ const self = this;
+ setTimeout(() => {
+ const watcher = chokidar.watch(watchPath, {
+ ignoreInitial: false,
+ usePolling: false,
+ persistent: true,
+ ignorePermissionErrors: true,
+ awaitWriteFinish: {
+ stabilityThreshold: 80,
+ pollInterval: 10
+ },
+ depth: 20
+ });
+
+ watcher.on('change', (pathname) => change(pathname, store));
+
+ self.watchers[watchPath] = watcher;
+ }, 100);
+ }
+
+ hasWatcher(watchPath) {
+ return this.watchers[watchPath];
+ }
+
+ removeWatcher(watchPath) {
+ if (this.watchers[watchPath]) {
+ this.watchers[watchPath].close();
+ this.watchers[watchPath] = null;
+ }
+ }
+ }
+
+ const storeWatcher = new StoreWatcher();
+ storeWatcher.addWatcher(getPath(), stores.PREFERENCES);
+
ipcMain.handle('renderer:ready', async (event) => {
// load preferences
const preferences = getPreferences();
@@ -15,7 +70,7 @@ const registerPreferencesIpc = (mainWindow, watcher, lastOpenedCollections) => {
if (lastOpened && lastOpened.length) {
for (let collectionPath of lastOpened) {
if (isDirectory(collectionPath)) {
- openCollection(mainWindow, watcher, collectionPath, {
+ await openCollection(mainWindow, watcher, collectionPath, {
dontSendDisplayErrors: true
});
}
diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js
index 62e17a564d..93fa3b80e4 100644
--- a/packages/bruno-electron/src/store/preferences.js
+++ b/packages/bruno-electron/src/store/preferences.js
@@ -47,6 +47,18 @@ const preferencesSchema = Yup.object().shape({
}),
font: Yup.object().shape({
codeFont: Yup.string().nullable()
+ }),
+ proxy: Yup.object({
+ enabled: Yup.boolean(),
+ protocol: Yup.string().oneOf(['http', 'https', 'socks4', 'socks5']),
+ hostname: Yup.string().max(1024),
+ port: Yup.number().min(1).max(65535),
+ auth: Yup.object({
+ enabled: Yup.boolean(),
+ username: Yup.string().max(1024),
+ password: Yup.string().max(1024)
+ }).optional(),
+ noProxy: Yup.string().optional().max(1024)
})
});
@@ -58,9 +70,13 @@ class PreferencesStore {
});
}
+ getPath() {
+ return this.store.path;
+ }
+
getPreferences() {
return {
- defaultPreferences,
+ ...defaultPreferences,
...this.store.get('preferences')
};
}
@@ -90,17 +106,13 @@ const savePreferences = async (newPreferences) => {
});
};
-const preferences = {
- getAll() {
- return getPreferences();
- },
-
- getPath() {
- return preferencesStore.getPath();
- },
+const getPath = () => {
+ return preferencesStore.getPath();
+};
+const preferences = {
isTlsVerification: () => {
- return get(getPreferences(), 'request.tlsVerification', true);
+ return get(getPreferences(), 'request.sslVerification', true);
},
getCaCert: () => {
@@ -115,5 +127,6 @@ const preferences = {
module.exports = {
getPreferences,
savePreferences,
+ getPath,
preferences
};
From 43c5b4cf53f2aac30b6d3a191aaa01780c56548c Mon Sep 17 00:00:00 2001
From: Mirko Golze
Date: Sun, 15 Oct 2023 20:30:13 +0200
Subject: [PATCH 28/65] proxy settings global and collection level
---
packages/bruno-electron/src/store/preferences.js | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js
index 93fa3b80e4..ae462f646f 100644
--- a/packages/bruno-electron/src/store/preferences.js
+++ b/packages/bruno-electron/src/store/preferences.js
@@ -6,17 +6,6 @@ const { get } = require('lodash');
* The preferences are stored in the electron store 'preferences.json'.
* The electron process uses this module to get the preferences.
*
- * {
- * preferences {
- * request: {
- * tlsVerification: boolean,
- * cacert: String (yet not implemented in front end)
- * }
- * proxy: { (yet not implemented in front end)
- * ...
- * }
- * }
- * }
*/
const defaultPreferences = {
From 353be75d9cf840cc7fb374e1b3dd1729ff7808ab Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 00:45:54 +0530
Subject: [PATCH 29/65] fix: fixed bug in loading preferences
---
packages/bruno-electron/src/store/preferences.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js
index 869895cd83..20bc1d4d5e 100644
--- a/packages/bruno-electron/src/store/preferences.js
+++ b/packages/bruno-electron/src/store/preferences.js
@@ -29,7 +29,7 @@ class PreferencesStore {
getPreferences() {
return {
- defaultPreferences,
+ ...defaultPreferences,
...this.store.get('preferences')
};
}
From 0e1869139ba9bafe1ed0c53a1fcf2009b1f03419 Mon Sep 17 00:00:00 2001
From: Dipin Jagadish
Date: Sun, 15 Oct 2023 20:19:08 +0100
Subject: [PATCH 30/65] fix: fixing merge conflicts
---
.../components/Preferences/General/index.js | 40 +++++++++----------
.../bruno-electron/src/store/preferences.js | 6 ++-
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/packages/bruno-app/src/components/Preferences/General/index.js b/packages/bruno-app/src/components/Preferences/General/index.js
index 1c99e54568..b6719b69c2 100644
--- a/packages/bruno-app/src/components/Preferences/General/index.js
+++ b/packages/bruno-app/src/components/Preferences/General/index.js
@@ -15,7 +15,8 @@ const General = ({ close }) => {
savePreferences({
...preferences,
request: {
- sslVerification
+ sslVerification,
+ timeout
}
})
).then(() => {
@@ -24,37 +25,34 @@ const General = ({ close }) => {
};
const handleTimeoutChange = (value) => {
- const timeout = value === '' ? 0 : value;
- const updatedPreferences = {
- ...preferences,
- request: {
- ...preferences.request,
- timeout
- }
- };
-
- setPreferences(updatedPreferences)
- .then(() => {
- setTimeout(timeout);
- })
- .catch((err) => {
- console.error(err);
- });
+ const validTimeout = isNaN(Number(value)) ? timeout : Number(value);
+ setTimeout(validTimeout);
};
return (
+
+ SSL Certificate Verification
+
setSslVerification(!sslVerification)}
- className="mr-3 mousetrap"
+ className="mousetrap h-4 w-4 mr-0"
/>
-
- SSL Certificate Verification
+
+
+
+ Request Timeout (in ms)
+ handleTimeoutChange(e.target.value)}
+ type="text"
+ className="block textbox w-1/6"
+ />
diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js
index 869895cd83..7238ce7cc5 100644
--- a/packages/bruno-electron/src/store/preferences.js
+++ b/packages/bruno-electron/src/store/preferences.js
@@ -3,7 +3,8 @@ const Store = require('electron-store');
const defaultPreferences = {
request: {
- sslVerification: true
+ sslVerification: true,
+ timeout: 0
},
font: {
codeFont: 'default'
@@ -12,7 +13,8 @@ const defaultPreferences = {
const preferencesSchema = Yup.object().shape({
request: Yup.object().shape({
- sslVerification: Yup.boolean()
+ sslVerification: Yup.boolean(),
+ timeout: Yup.number()
}),
font: Yup.object().shape({
codeFont: Yup.string().nullable()
From 333564f687b2e6f05dff90f5abe3184d850cd091 Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 02:07:15 +0530
Subject: [PATCH 31/65] feat(#275): polish client certificate support
---
.../ClientCertSettings/StyledWrapper.js | 14 +++++++++-
.../ClientCertSettings/index.js | 28 +++++++++++++------
.../components/CollectionSettings/index.js | 19 +++++++++----
3 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/StyledWrapper.js
index bc5ad1565c..625bc98e6e 100644
--- a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/StyledWrapper.js
+++ b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/StyledWrapper.js
@@ -2,13 +2,25 @@ import styled from 'styled-components';
const StyledWrapper = styled.div`
.settings-label {
- width: 80px;
+ width: 90px;
+ }
+
+ .certificate-icon {
+ color: ${(props) => props.theme.colors.text.yellow};
}
input {
width: 300px;
}
+ .available-certificates {
+ background-color: ${(props) => props.theme.requestTabPanel.url.bg};
+
+ button.remove-certificate {
+ color: ${(props) => props.theme.colors.text.danger};
+ }
+ }
+
.textbox {
border: 1px solid #ccc;
padding: 0.15rem 0.45rem;
diff --git a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js
index 280e0f4bb5..235e274f5e 100644
--- a/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js
+++ b/packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js
@@ -1,5 +1,7 @@
-import React, { useEffect } from 'react';
+import React from 'react';
+import { IconCertificate, IconTrash, IconWorld } from '@tabler/icons';
import { useFormik } from 'formik';
+import { uuid } from 'utils/common';
import * as Yup from 'yup';
import StyledWrapper from './StyledWrapper';
@@ -29,20 +31,28 @@ const ClientCertSettings = ({ clientCertConfig, onUpdate, onRemove }) => {
return (
- Current client certificates
-
+
+ Client Certificates
+
+
{!clientCertConfig.length
? 'None'
: clientCertConfig.map((clientCert) => (
-
- Domain: {clientCert.domain}
- onRemove(clientCert)} className="submit btn btn-sm btn-secondary ml-2">
- Delete
-
+
+
+
+
+ {clientCert.domain}
+
+
onRemove(clientCert)} className="remove-certificate ml-2">
+
+
+
))}
- New client certicate
+
+ Add Client Certicate
-
+
);
};
From 58fbe2e64b7d7f9f1b9e696f67bd4bb5a7dccf9a Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 02:10:18 +0530
Subject: [PATCH 32/65] chore: cleanup
---
.../CollectionSettings/Auth/AwsV4Auth/index.js | 1 -
.../components/RequestPane/Auth/AwsV4Auth/index.js | 1 -
packages/bruno-electron/src/ipc/network/index.js | 11 -----------
3 files changed, 13 deletions(-)
diff --git a/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js b/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js
index 1fe35eea08..bc9cb67b58 100644
--- a/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js
+++ b/packages/bruno-app/src/components/CollectionSettings/Auth/AwsV4Auth/index.js
@@ -12,7 +12,6 @@ const AwsV4Auth = ({ collection }) => {
const { storedTheme } = useTheme();
const awsv4Auth = get(collection, 'root.request.auth.awsv4', {});
- console.log('saved auth', awsv4Auth);
const handleSave = () => dispatch(saveCollectionRoot(collection.uid));
diff --git a/packages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.js b/packages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.js
index 9ed29ac073..7c144fbf86 100644
--- a/packages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.js
+++ b/packages/bruno-app/src/components/RequestPane/Auth/AwsV4Auth/index.js
@@ -13,7 +13,6 @@ const AwsV4Auth = ({ onTokenChange, item, collection }) => {
const { storedTheme } = useTheme();
const awsv4Auth = item.draft ? get(item, 'draft.request.auth.awsv4', {}) : get(item, 'request.auth.awsv4', {});
- console.log('saved auth', awsv4Auth);
const handleRun = () => dispatch(sendRequest(item, collection.uid));
const handleSave = () => dispatch(saveRequest(item.uid, collection.uid));
diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js
index 9d308faf7f..405ca7b73f 100644
--- a/packages/bruno-electron/src/ipc/network/index.js
+++ b/packages/bruno-electron/src/ipc/network/index.js
@@ -210,17 +210,6 @@ const registerNetworkIpc = (mainWindow) => {
const httpsAgentRequestFields = {};
if (!sslVerification) {
httpsAgentRequestFields['rejectUnauthorized'] = false;
- } else {
- const cacertArray = [preferences['cacert'], process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
- cacertFile = cacertArray.find((el) => el);
- if (cacertFile && cacertFile.length > 1) {
- try {
- caCrt = fs.readFileSync(cacertFile);
- httpsAgentRequestFields['ca'] = caCrt;
- } catch (err) {
- console.log('Error reading CA cert file:' + cacertFile, err);
- }
- }
}
const brunoConfig = getBrunoConfig(collectionUid);
From 1f8c4431e06eaccd1b85462995eb8869c790d0dc Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 03:13:06 +0530
Subject: [PATCH 33/65] feat(#589): polish importing postman env
---
.../CreateEnvironment/index.js | 4 +-
.../EnvironmentList/StyledWrapper.js | 8 ++-
.../EnvironmentList/index.js | 17 +++--
.../ImportEnvironment/index.js | 62 ++++++++++---------
.../Environments/EnvironmentSettings/index.js | 18 ++++--
.../GenerateCodeItem/StyledWrapper.js | 1 +
.../ReduxStore/slices/collections/actions.js | 28 ++++-----
packages/bruno-electron/src/ipc/collection.js | 52 +++-------------
8 files changed, 93 insertions(+), 97 deletions(-)
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js
index c0ca7f5ec6..e6947bd3ad 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js
@@ -1,6 +1,6 @@
import React, { useEffect, useRef } from 'react';
-import Portal from 'components/Portal/index';
-import Modal from 'components/Modal/index';
+import Portal from 'components/Portal';
+import Modal from 'components/Modal';
import toast from 'react-hot-toast';
import { useFormik } from 'formik';
import { addEnvironment } from 'providers/ReduxStore/slices/collections/actions';
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/StyledWrapper.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/StyledWrapper.js
index 722a15db17..687cde46c9 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/StyledWrapper.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/StyledWrapper.js
@@ -10,6 +10,7 @@ const StyledWrapper = styled.div`
background-color: ${(props) => props.theme.collection.environment.settings.sidebar.bg};
border-right: solid 1px ${(props) => props.theme.collection.environment.settings.sidebar.borderRight};
min-height: 400px;
+ height: 100%;
}
.environment-item {
@@ -35,7 +36,8 @@ const StyledWrapper = styled.div`
}
}
- .btn-create-environment {
+ .btn-create-environment,
+ .btn-import-environment {
padding: 8px 10px;
cursor: pointer;
border-bottom: none;
@@ -47,6 +49,10 @@ const StyledWrapper = styled.div`
}
}
}
+
+ .btn-import-environment {
+ color: ${(props) => props.theme.colors.text.muted};
+ }
`;
export default StyledWrapper;
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
index e310eb0c1f..44e18455f6 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
@@ -1,15 +1,19 @@
import React, { useEffect, useState, forwardRef, useRef } from 'react';
import { findEnvironmentInCollection } from 'utils/collections';
+import toast from 'react-hot-toast';
+import { toastError } from 'utils/common/error';
import usePrevious from 'hooks/usePrevious';
import EnvironmentDetails from './EnvironmentDetails';
-import CreateEnvironment from '../CreateEnvironment/index';
+import CreateEnvironment from '../CreateEnvironment';
+import { IconUpload } from '@tabler/icons';
+import ImportEnvironment from '../ImportEnvironment';
import StyledWrapper from './StyledWrapper';
-import ImportEnvironment from "components/Environments/EnvironmentSettings/ImportEnvironment";
const EnvironmentList = ({ collection }) => {
const { environments } = collection;
const [selectedEnvironment, setSelectedEnvironment] = useState(null);
const [openCreateModal, setOpenCreateModal] = useState(false);
+ const [openImportModal, setOpenImportModal] = useState(false);
const envUids = environments ? environments.map((env) => env.uid) : [];
const prevEnvUids = usePrevious(envUids);
@@ -49,9 +53,10 @@ const EnvironmentList = ({ collection }) => {
return (
{openCreateModal && setOpenCreateModal(false)} />}
+ {openImportModal && setOpenImportModal(false)} />}
-
+
{environments &&
environments.length &&
environments.map((env) => (
@@ -66,7 +71,11 @@ const EnvironmentList = ({ collection }) => {
setOpenCreateModal(true)}>
+ Create
-
+
+ setOpenImportModal(true)}>
+
+ Import
+
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/ImportEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/ImportEnvironment/index.js
index 1b0fd9dd99..5caba79b21 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/ImportEnvironment/index.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/ImportEnvironment/index.js
@@ -1,33 +1,39 @@
-import toast from "react-hot-toast";
-import {toastError} from "utils/common/error";
-import {useDispatch} from "react-redux";
-import {importEnvironment} from "providers/ReduxStore/slices/collections/actions";
-import importPostmanEnvironment from "utils/importers/postman-environment";
-import React from "react";
+import React from 'react';
+import Portal from 'components/Portal';
+import toast from 'react-hot-toast';
+import { useDispatch } from 'react-redux';
+import importPostmanEnvironment from 'utils/importers/postman-environment';
+import { importEnvironment } from 'providers/ReduxStore/slices/collections/actions';
+import { toastError } from 'utils/common/error';
+import Modal from 'components/Modal';
-const ImportEnvironment = ({title, collectionUid}) => {
- const dispatch = useDispatch();
+const ImportEnvironment = ({ onClose, collection }) => {
+ const dispatch = useDispatch();
- const handleImportPostmanEnvironment = () => {
- importPostmanEnvironment()
- .then((environment) => {
- dispatch(importEnvironment(environment.name, environment.variables, collectionUid))
- .then(() => {
- toast.success('Environment imported successfully');
- })
- .catch(() => toast.error('An error occurred while importing the environment'));
- })
- .catch((err) => toastError(err, 'Postman Import environment failed'));
- };
+ const handleImportPostmanEnvironment = () => {
+ importPostmanEnvironment()
+ .then((environment) => {
+ dispatch(importEnvironment(environment.name, environment.variables, collection.uid))
+ .then(() => {
+ toast.success('Environment imported successfully');
+ onClose();
+ })
+ .catch(() => toast.error('An error occurred while importing the environment'));
+ })
+ .catch((err) => toastError(err, 'Postman Import environment failed'));
+ };
- return(
-
- + {title}
-
- );
+ return (
+
+
+
+
+ Postman Environment
+
+
+
+
+ );
};
-export default ImportEnvironment;
\ No newline at end of file
+export default ImportEnvironment;
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js
index 39c410eed7..6daccc3746 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js
@@ -3,11 +3,12 @@ import React, { useState } from 'react';
import CreateEnvironment from './CreateEnvironment';
import EnvironmentList from './EnvironmentList';
import StyledWrapper from './StyledWrapper';
-import ImportEnvironment from "components/Environments/EnvironmentSettings/ImportEnvironment";
+import ImportEnvironment from './ImportEnvironment';
const EnvironmentSettings = ({ collection, onClose }) => {
const { environments } = collection;
const [openCreateModal, setOpenCreateModal] = useState(false);
+ const [openImportModal, setOpenImportModal] = useState(false);
if (!environments || !environments.length) {
return (
@@ -21,15 +22,24 @@ const EnvironmentSettings = ({ collection, onClose }) => {
hideCancel={true}
>
{openCreateModal &&
setOpenCreateModal(false)} />}
-
+ {openImportModal &&
setOpenImportModal(false)} />}
+
No environments found!
setOpenCreateModal(true)}
>
- + Create Environment
+ Create Environment
+
+
+
Or
+
+
setOpenImportModal(true)}
+ >
+ Import Environment
-
diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/StyledWrapper.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/StyledWrapper.js
index f1c1c33e47..635c545e92 100644
--- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/StyledWrapper.js
+++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/StyledWrapper.js
@@ -9,6 +9,7 @@ const StyledWrapper = styled.div`
background-color: ${(props) => props.theme.collection.environment.settings.sidebar.bg};
border-right: solid 1px ${(props) => props.theme.collection.environment.settings.sidebar.borderRight};
min-height: 400px;
+ height: 100%;
}
.generate-code-item {
diff --git a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
index 1b36ed65ae..38e3c30ed8 100644
--- a/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
+++ b/packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
@@ -731,20 +731,20 @@ export const importEnvironment = (name, variables, collectionUid) => (dispatch,
}
ipcRenderer
- .invoke('renderer:import-environment', collection.pathname, name, variables)
- .then(
- dispatch(
- updateLastAction({
- collectionUid,
- lastAction: {
- type: 'ADD_ENVIRONMENT',
- payload: name
- }
- })
- )
+ .invoke('renderer:create-environment', collection.pathname, name, variables)
+ .then(
+ dispatch(
+ updateLastAction({
+ collectionUid,
+ lastAction: {
+ type: 'ADD_ENVIRONMENT',
+ payload: name
+ }
+ })
)
- .then(resolve)
- .catch(reject);
+ )
+ .then(resolve)
+ .catch(reject);
});
};
@@ -762,7 +762,7 @@ export const copyEnvironment = (name, baseEnvUid, collectionUid) => (dispatch, g
}
ipcRenderer
- .invoke('renderer:copy-environment', collection.pathname, name, baseEnv.variables)
+ .invoke('renderer:create-environment', collection.pathname, name, baseEnv.variables)
.then(
dispatch(
updateLastAction({
diff --git a/packages/bruno-electron/src/ipc/collection.js b/packages/bruno-electron/src/ipc/collection.js
index a78294b119..b4acd5eb0c 100644
--- a/packages/bruno-electron/src/ipc/collection.js
+++ b/packages/bruno-electron/src/ipc/collection.js
@@ -140,7 +140,7 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
});
// create environment
- ipcMain.handle('renderer:create-environment', async (event, collectionPathname, name) => {
+ ipcMain.handle('renderer:create-environment', async (event, collectionPathname, name, variables) => {
try {
const envDirPath = path.join(collectionPathname, 'environments');
if (!fs.existsSync(envDirPath)) {
@@ -152,53 +152,17 @@ const registerRendererEventHandlers = (mainWindow, watcher, lastOpenedCollection
throw new Error(`environment: ${envFilePath} already exists`);
}
- const content = envJsonToBru({
- variables: []
- });
- await writeFile(envFilePath, content);
- } catch (error) {
- return Promise.reject(error);
- }
- });
-
- // copy environment
- ipcMain.handle('renderer:copy-environment', async (event, collectionPathname, name, baseVariables) => {
- try {
- const envDirPath = path.join(collectionPathname, 'environments');
- if (!fs.existsSync(envDirPath)) {
- await createDirectory(envDirPath);
- }
-
- const envFilePath = path.join(envDirPath, `${name}.bru`);
- if (fs.existsSync(envFilePath)) {
- throw new Error(`environment: ${envFilePath} already exists`);
- }
-
- const content = envJsonToBru({
- variables: baseVariables
- });
- await writeFile(envFilePath, content);
- } catch (error) {
- return Promise.reject(error);
- }
- });
+ const environment = {
+ name: name,
+ variables: variables || []
+ };
- // copy environment
- ipcMain.handle('renderer:import-environment', async (event, collectionPathname, name, variables) => {
- try {
- const envDirPath = path.join(collectionPathname, 'environments');
- if (!fs.existsSync(envDirPath)) {
- await createDirectory(envDirPath);
+ if (envHasSecrets(environment)) {
+ environmentSecretsStore.storeEnvSecrets(collectionPathname, environment);
}
- const envFilePath = path.join(envDirPath, `${name}.bru`);
- if (fs.existsSync(envFilePath)) {
- throw new Error(`environment: ${envFilePath} already exists`);
- }
+ const content = envJsonToBru(environment);
- const content = envJsonToBru({
- variables: variables
- });
await writeFile(envFilePath, content);
} catch (error) {
return Promise.reject(error);
From cdfa839cf33edaf0d7d07c72ca162e6b57f1325a Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 03:41:47 +0530
Subject: [PATCH 34/65] chore: polish request timeout
---
.../src/components/Preferences/Font/index.js | 22 +++++++++----------
.../components/Preferences/General/index.js | 20 +++++++++--------
.../bruno-electron/src/ipc/network/index.js | 19 ++++++++--------
3 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/packages/bruno-app/src/components/Preferences/Font/index.js b/packages/bruno-app/src/components/Preferences/Font/index.js
index bae23e7232..2f27fea8b7 100644
--- a/packages/bruno-app/src/components/Preferences/Font/index.js
+++ b/packages/bruno-app/src/components/Preferences/Font/index.js
@@ -30,18 +30,16 @@ const Font = ({ close }) => {
return (
Code Editor Font
-
-
-
+
diff --git a/packages/bruno-app/src/components/Preferences/General/index.js b/packages/bruno-app/src/components/Preferences/General/index.js
index b6719b69c2..2dbcfab762 100644
--- a/packages/bruno-app/src/components/Preferences/General/index.js
+++ b/packages/bruno-app/src/components/Preferences/General/index.js
@@ -32,7 +32,7 @@ const General = ({ close }) => {
return (
-
+
SSL Certificate Verification
{
type="checkbox"
checked={sslVerification}
onChange={() => setSslVerification(!sslVerification)}
- className="mousetrap h-4 w-4 mr-0"
+ className="mousetrap mr-0"
/>
-
-
- Request Timeout (in ms)
-
+
+ Request Timeout (in ms)
handleTimeoutChange(e.target.value)}
type="text"
- className="block textbox w-1/6"
+ className="block textbox mt-2 w-1/4"
+ autoComplete="off"
+ autoCorrect="off"
+ autoCapitalize="off"
+ spellCheck="false"
+ onChange={(e) => handleTimeoutChange(e.target.value)}
+ defaultValue={timeout === 0 ? '' : timeout}
/>
diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js
index f2b81f9fd7..ebd780ece9 100644
--- a/packages/bruno-electron/src/ipc/network/index.js
+++ b/packages/bruno-electron/src/ipc/network/index.js
@@ -155,6 +155,10 @@ const registerNetworkIpc = (mainWindow) => {
}
}
+ const preferences = getPreferences();
+ const timeout = get(preferences, 'request.timeout', 0);
+ request.timeout = timeout;
+
// run pre-request script
const requestScript = compact([get(collectionRoot, 'request.script.req'), get(request, 'script.req')]).join(
os.EOL
@@ -205,9 +209,6 @@ const registerNetworkIpc = (mainWindow) => {
cancelTokenUid
});
- const preferences = getPreferences();
- const timeout = get(preferences, 'request.timeout', 0);
- request.timeout = timeout;
const sslVerification = get(preferences, 'request.sslVerification', true);
const httpsAgentRequestFields = {};
if (!sslVerification) {
@@ -222,7 +223,7 @@ const registerNetworkIpc = (mainWindow) => {
};
// client certificate config
- const clientCertConfig = get(brunoConfig, 'clientCertificates', []);
+ const clientCertConfig = get(brunoConfig, 'clientCertificates.certs', []);
for (clientCert of clientCertConfig) {
const domain = interpolateString(clientCert.domain, interpolationOptions);
@@ -657,6 +658,11 @@ const registerNetworkIpc = (mainWindow) => {
}
}
+ const preferences = getPreferences();
+ const timeout = get(preferences, 'request.timeout', 0);
+ request.timeout = timeout;
+ const sslVerification = get(preferences, 'request.sslVerification', true);
+
// run pre-request script
const requestScript = compact([get(collectionRoot, 'request.script.req'), get(request, 'script.req')]).join(
os.EOL
@@ -698,11 +704,6 @@ const registerNetworkIpc = (mainWindow) => {
...eventData
});
- const preferences = getPreferences();
- const timeout = get(preferences, 'request.timeout', 0);
- request.timeout = timeout;
- const sslVerification = get(preferences, 'request.sslVerification', true);
-
// proxy configuration
const brunoConfig = getBrunoConfig(collectionUid);
const proxyEnabled = get(brunoConfig, 'proxy.enabled', false);
From a9459bc2369fccf69656b3852b98267a13b1066d Mon Sep 17 00:00:00 2001
From: Anoop M D
Date: Mon, 16 Oct 2023 03:43:13 +0530
Subject: [PATCH 35/65] chore: bumped version to v0.25.0
---
packages/bruno-app/src/components/Sidebar/index.js | 2 +-
packages/bruno-electron/package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/bruno-app/src/components/Sidebar/index.js b/packages/bruno-app/src/components/Sidebar/index.js
index b074a23fa1..a27ef6320c 100644
--- a/packages/bruno-app/src/components/Sidebar/index.js
+++ b/packages/bruno-app/src/components/Sidebar/index.js
@@ -105,7 +105,7 @@ const Sidebar = () => {
Star
- v0.24.0
+ v0.25.0
diff --git a/packages/bruno-electron/package.json b/packages/bruno-electron/package.json
index ffe266f3e4..70a74326be 100644
--- a/packages/bruno-electron/package.json
+++ b/packages/bruno-electron/package.json
@@ -1,5 +1,5 @@
{
- "version": "v0.24.0",
+ "version": "v0.25.0",
"name": "bruno",
"description": "Opensource API Client for Exploring and Testing APIs",
"homepage": "https://www.usebruno.com",
From ddd479ed4509ff2fa271a2bb2e0561be822b7fb6 Mon Sep 17 00:00:00 2001
From: Ross Gargett <73141350+Ross-Gargett@users.noreply.github.com>
Date: Sun, 15 Oct 2023 19:38:47 -0700
Subject: [PATCH 36/65] fix: prevent non-numerical or negative timeouts
---
.../bruno-app/src/components/Preferences/General/index.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/packages/bruno-app/src/components/Preferences/General/index.js b/packages/bruno-app/src/components/Preferences/General/index.js
index 2dbcfab762..917b5765d8 100644
--- a/packages/bruno-app/src/components/Preferences/General/index.js
+++ b/packages/bruno-app/src/components/Preferences/General/index.js
@@ -25,8 +25,9 @@ const General = ({ close }) => {
};
const handleTimeoutChange = (value) => {
- const validTimeout = isNaN(Number(value)) ? timeout : Number(value);
- setTimeout(validTimeout);
+ if (/^[0-9]\d*$/.test(value) || value === '') {
+ setTimeout(value);
+ }
};
return (
@@ -47,13 +48,14 @@ const General = ({ close }) => {
Request Timeout (in ms)
handleTimeoutChange(e.target.value)}
defaultValue={timeout === 0 ? '' : timeout}
+ value={timeout}
/>
From 1244716b9b6c511e39d8a12a8ccbe9bd471d6f35 Mon Sep 17 00:00:00 2001
From: Prem Kumar Easwaran
Date: Mon, 16 Oct 2023 11:19:55 +0530
Subject: [PATCH 37/65] Change import icon
---
.../Environments/EnvironmentSettings/EnvironmentList/index.js | 4 ++--
packages/bruno-app/src/components/Welcome/index.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
index 44e18455f6..dd7ac4f798 100644
--- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
+++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
@@ -5,7 +5,7 @@ import { toastError } from 'utils/common/error';
import usePrevious from 'hooks/usePrevious';
import EnvironmentDetails from './EnvironmentDetails';
import CreateEnvironment from '../CreateEnvironment';
-import { IconUpload } from '@tabler/icons';
+import { IconDownload } from '@tabler/icons';
import ImportEnvironment from '../ImportEnvironment';
import StyledWrapper from './StyledWrapper';
@@ -73,7 +73,7 @@ const EnvironmentList = ({ collection }) => {