mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-22 14:41:04 +01:00
Merge branch 'main' into main
This commit is contained in:
commit
75bbb6d66a
@ -1,4 +1,4 @@
|
||||
**English** | [Українська](docs/contributing/contributing_ua.md) | [Русский](docs/contributing/contributing_ru.md) | [Türkçe](docs/contributing/contributing_tr.md) | [Deutsch](docs/contributing/contributing_de.md) | [Français](docs/contributing/contributing_fr.md)
|
||||
**English** | [Українська](docs/contributing/contributing_ua.md) | [Русский](docs/contributing/contributing_ru.md) | [Türkçe](docs/contributing/contributing_tr.md) | [Deutsch](docs/contributing/contributing_de.md) | [Français](docs/contributing/contributing_fr.md) | [Português (BR)](docs/contributing/contributing_pt_br.md)
|
||||
|
||||
## Let's make bruno better, together !!
|
||||
|
||||
|
85
docs/contributing/contributing_pt_br.md
Normal file
85
docs/contributing/contributing_pt_br.md
Normal file
@ -0,0 +1,85 @@
|
||||
## Vamos tornar o Bruno melhor, juntos!!
|
||||
|
||||
Estamos felizes que você queira ajudar a melhorar o Bruno. Abaixo estão as diretrizes e orientações para começar a executar o Bruno no seu computador.
|
||||
|
||||
### Stack de Tecnologias
|
||||
|
||||
O Bruno é construído usando Next.js e React. Também usamos o Electron para disponibilizar uma versão para desktop (que suporta coleções locais).
|
||||
|
||||
Bibliotecas que utilizamos:
|
||||
|
||||
- CSS - Tailwind
|
||||
- Editor de Código - Codemirror
|
||||
- Gerenciador de Estado - Redux
|
||||
- Ícones - Tabler Icons
|
||||
- Formulários - formik
|
||||
- Validador de Schema - Yup
|
||||
- Cliente de Requisições - axios
|
||||
- Monitor de Arquivos - chokidar
|
||||
|
||||
### Dependências
|
||||
|
||||
Você precisará do [Node v18.x (ou da versão LTS mais recente)](https://nodejs.org/en/) e do npm na versão 8.x. Nós utilizamos npm workspaces no projeto.
|
||||
|
||||
## Desenvolvimento
|
||||
|
||||
Bruno está sendo desenvolvido como um aplicativo de desktop. Você precisa carregar o programa executando o aplicativo Next.js em um terminal e, em seguida, executar o aplicativo Electron em outro terminal.
|
||||
|
||||
### Dependências
|
||||
|
||||
- NodeJS v18
|
||||
|
||||
### Desenvolvimento Local
|
||||
|
||||
```bash
|
||||
# use nodejs 18 version
|
||||
nvm use
|
||||
|
||||
# install deps
|
||||
npm i --legacy-peer-deps
|
||||
|
||||
# build graphql docs
|
||||
npm run build:graphql-docs
|
||||
|
||||
# build bruno query
|
||||
npm run build:bruno-query
|
||||
|
||||
# run next app (terminal 1)
|
||||
npm run dev:web
|
||||
|
||||
# run electron app (terminal 2)
|
||||
npm run dev:electron
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Você pode se deparar com o erro `Unsupported platform` ao executar o comando `npm install`. Para corrigir isso, você precisará excluir a pasta `node_modules` e o arquivo `package-lock.json` e, em seguida, executar o comando `npm install` novamente. Isso deve instalar todos os pacotes necessários para executar o aplicativo.
|
||||
|
||||
```shell
|
||||
# delete node_modules in sub-directories
|
||||
find ./ -type d -name "node_modules" -print0 | while read -d $'\0' dir; do
|
||||
rm -rf "$dir"
|
||||
done
|
||||
|
||||
# delete package-lock in sub-directories
|
||||
find . -type f -name "package-lock.json" -delete
|
||||
```
|
||||
|
||||
### Testando
|
||||
|
||||
```bash
|
||||
# bruno-schema
|
||||
npm test --workspace=packages/bruno-schema
|
||||
|
||||
# bruno-lang
|
||||
npm test --workspace=packages/bruno-lang
|
||||
```
|
||||
|
||||
### Envio de Pull Request
|
||||
|
||||
- Por favor, mantenha os PRs pequenos e focados em uma única coisa.
|
||||
- Siga o formato de criação de branches.
|
||||
- feature/[nome da funcionalidade]: Esta branch deve conter alterações para uma funcionalidade específica.
|
||||
- Exemplo: feature/dark-mode
|
||||
- bugfix/[nome do bug]: Esta branch deve conter apenas correções para um bug específico.
|
||||
- Exemplo: bugfix/bug-1
|
5
docs/publishing/publishing_pt_br.md
Normal file
5
docs/publishing/publishing_pt_br.md
Normal file
@ -0,0 +1,5 @@
|
||||
### Publicando Bruno em um novo gerenciador de pacotes
|
||||
|
||||
Embora nosso código seja de código aberto e esteja disponível para todos usarem, pedimos gentilmente que entre em contato conosco antes de considerar a publicação em novos gerenciadores de pacotes. Como o criador da ferramenta, mantenho a marca registrada `Bruno` para este projeto e gostaria de gerenciar sua distribuição. Se deseja ver o Bruno em um novo gerenciador de pacotes, por favor, solicite através de uma issue no GitHub.
|
||||
|
||||
Embora a maioria de nossas funcionalidades seja gratuita e de código aberto (o que abrange API's REST e GraphQL), buscamos alcançar um equilíbrio harmonioso entre os princípios de código aberto e sustentabilidade. - https://github.com/usebruno/bruno/discussions/269
|
121
docs/readme/readme_pt_br.md
Normal file
121
docs/readme/readme_pt_br.md
Normal file
@ -0,0 +1,121 @@
|
||||
<br />
|
||||
<img src="../../assets/images/logo-transparent.png" width="80"/>
|
||||
|
||||
### Bruno - IDE de código aberto para explorar e testar APIs.
|
||||
|
||||
[![GitHub version](https://badge.fury.io/gh/usebruno%2Fbruno.svg)](https://badge.fury.io/gh/usebruno%bruno)
|
||||
[![CI](https://github.com/usebruno/bruno/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/usebruno/bruno/workflows/unit-tests.yml)
|
||||
[![Commit Activity](https://img.shields.io/github/commit-activity/m/usebruno/bruno)](https://github.com/usebruno/bruno/pulse)
|
||||
[![X](https://img.shields.io/twitter/follow/use_bruno?style=social&logo=x)](https://twitter.com/use_bruno)
|
||||
[![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com)
|
||||
[![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads)
|
||||
|
||||
Bruno é um novo e inovador cliente de API, com o objetivo de revolucionar o status quo representado por ferramentas como o Postman e outras semelhantes.
|
||||
|
||||
Bruno armazena suas coleções diretamente em uma pasta no seu sistema de arquivos. Utilizamos uma linguagem de marcação de texto simples, chamada Bru, para salvar informações sobre requisições de API.
|
||||
|
||||
Você pode usar o Git ou qualquer sistema de controle de versão de sua escolha para colaborar em suas coleções de API.
|
||||
|
||||
Bruno é totalmente offline. Não há planos de adicionar sincronização em nuvem ao Bruno, nunca. Valorizamos a privacidade de seus dados e acreditamos que eles devem permanecer em seu dispositivo. Saiba mais sobre nossa visão a longo prazo [aqui](https://github.com/usebruno/bruno/discussions/269).
|
||||
|
||||
📢 Assista à nossa palestra recente na India FOSS 3.0 Conference [aqui](https://www.youtube.com/watch?v=7bSMFpbcPiY).
|
||||
|
||||
![bruno](../../assets/images/landing-2.png) <br /><br />
|
||||
|
||||
### Instalação
|
||||
|
||||
Bruno está disponível para download como binário [em nosso site](https://www.usebruno.com/downloads) para Mac, Windows e Linux.
|
||||
|
||||
Você também pode instalar o Bruno via gerenciadores de pacotes como Homebrew, Chocolatey, Snap e Apt.
|
||||
|
||||
```sh
|
||||
# Mac via Homebrew
|
||||
brew install bruno
|
||||
|
||||
# Windows via Chocolatey
|
||||
choco install bruno
|
||||
|
||||
# Linux via Snap
|
||||
snap install bruno
|
||||
|
||||
# Linux via Apt
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/bruno.gpg --keyserver keyserver.ubuntu.com --recv-keys 9FA6017ECABE0266
|
||||
|
||||
echo "deb [signed-by=/etc/apt/keyrings/bruno.gpg] http://debian.usebruno.com/ bruno stable" | sudo tee /etc/apt/sources.list.d/bruno.list
|
||||
|
||||
sudo apt update
|
||||
sudo apt install bruno
|
||||
```
|
||||
|
||||
### Execute em várias plataformas 🖥️
|
||||
|
||||
![bruno](../../assets/images/run-anywhere.png) <br /><br />
|
||||
|
||||
### Colaboração via Git 👩💻🧑💻
|
||||
|
||||
Ou qualquer sistema de controle de versão de sua escolha.
|
||||
|
||||
![bruno](../../assets/images/version-control.png) <br /><br />
|
||||
|
||||
### Links Importantes 📌
|
||||
|
||||
- [Nossa Visão de Longo Prazo](https://github.com/usebruno/bruno/discussions/269)
|
||||
- [Roadmap](https://github.com/usebruno/bruno/discussions/384)
|
||||
- [Documentação](https://docs.usebruno.com)
|
||||
- [Website](https://www.usebruno.com)
|
||||
- [Preços](https://www.usebruno.com/pricing)
|
||||
- [Download](https://www.usebruno.com/downloads)
|
||||
|
||||
### Showcase 🎥
|
||||
|
||||
- [Depoimentos](https://github.com/usebruno/bruno/discussions/343)
|
||||
- [Hub de Conhecimento](https://github.com/usebruno/bruno/discussions/386)
|
||||
- [Scriptmania](https://github.com/usebruno/bruno/discussions/385)
|
||||
|
||||
### Apoie ❤️
|
||||
|
||||
Au-au! Se você gosta do projeto, clique no botão ⭐!!
|
||||
|
||||
### Compartilhe sua experiência 📣
|
||||
|
||||
Se o Bruno ajudou no seu trabalho e/ou no trabalho de sua equipe, por favor, não se esqueça de compartilhar seu [depoimento em nossas discussões no GitHub](https://github.com/usebruno/bruno/discussions/343).
|
||||
|
||||
### Publicando em Novos Gerenciadores de Pacotes
|
||||
|
||||
Por favor, verifique [aqui](../publishing/publishing_pt_br.md) mais informações.
|
||||
|
||||
### Colabore 👩💻🧑💻
|
||||
|
||||
Fico feliz que você queira melhorar o Bruno. Por favor, confira o [guia de colaboração](../contributing/contributing_pt_br.md).
|
||||
|
||||
Mesmo que você não possa contribuir codificando, não deixe de relatar problemas e solicitar recursos que precisam ser implementados para atender ao contexto de seu dia a dia.
|
||||
|
||||
### Authors
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/usebruno/bruno/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=usebruno/bruno" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
### Mantenha Contato 🌐
|
||||
|
||||
[𝕏 (Twitter)](https://twitter.com/use_bruno) <br />
|
||||
[Website](https://www.usebruno.com) <br />
|
||||
[Discord](https://discord.com/invite/KgcZUncpjq) <br />
|
||||
[LinkedIn](https://www.linkedin.com/company/usebruno)
|
||||
|
||||
### Trademark
|
||||
|
||||
**Nome**
|
||||
|
||||
`Bruno` é uma marca registrada de [Anoop M D](https://www.helloanoop.com/).
|
||||
|
||||
**Logo**
|
||||
|
||||
A logo é original do [OpenMoji](https://openmoji.org/library/emoji-1F436/). Licença: CC [BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
|
||||
|
||||
### Licença 📄
|
||||
|
||||
[MIT](license.md)
|
1825
package-lock.json
generated
1825
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -20,10 +20,11 @@
|
||||
"@tippyjs/react": "^4.2.6",
|
||||
"@usebruno/graphql-docs": "0.1.0",
|
||||
"@usebruno/schema": "0.6.0",
|
||||
"axios": "^0.26.0",
|
||||
"axios": "^1.5.1",
|
||||
"classnames": "^2.3.1",
|
||||
"codemirror": "^5.65.2",
|
||||
"codemirror-graphql": "^1.2.5",
|
||||
"cookie": "^0.6.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"file-dialog": "^0.0.8",
|
||||
"file-saver": "^2.0.5",
|
||||
@ -36,17 +37,19 @@
|
||||
"httpsnippet": "^3.0.1",
|
||||
"idb": "^7.0.0",
|
||||
"immer": "^9.0.15",
|
||||
"jsesc": "^3.0.2",
|
||||
"know-your-http-well": "^0.5.0",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^13.0.2",
|
||||
"mousetrap": "^1.6.5",
|
||||
"nanoid": "3.3.4",
|
||||
"next": "12.3.3",
|
||||
"parse-curl": "^0.2.6",
|
||||
"path": "^0.12.7",
|
||||
"pdfjs-dist": "^3.11.174",
|
||||
"platform": "^1.3.6",
|
||||
"posthog-node": "^2.1.0",
|
||||
"qs": "^6.11.0",
|
||||
"query-string": "^7.0.1",
|
||||
"react": "18.2.0",
|
||||
"react-dnd": "^16.0.1",
|
||||
"react-dnd-html5-backend": "^16.0.1",
|
||||
@ -54,12 +57,15 @@
|
||||
"react-github-btn": "^1.4.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-inspector": "^6.0.2",
|
||||
"react-pdf": "^7.5.1",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-tooltip": "^5.5.2",
|
||||
"sass": "^1.46.0",
|
||||
"styled-components": "^5.3.3",
|
||||
"tailwindcss": "^2.2.19",
|
||||
"url": "^0.11.3",
|
||||
"xml-formatter": "^3.5.0",
|
||||
"yargs-parser": "^21.1.1",
|
||||
"yup": "^0.32.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -61,6 +61,15 @@ const AuthMode = ({ collection }) => {
|
||||
>
|
||||
Bearer Token
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={() => {
|
||||
dropdownTippyRef.current.hide();
|
||||
onModeChange('digest');
|
||||
}}
|
||||
>
|
||||
Digest Auth
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={() => {
|
||||
|
@ -0,0 +1,16 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
label {
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.single-line-editor-wrapper {
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: 3px;
|
||||
border: solid 1px ${(props) => props.theme.input.border};
|
||||
background-color: ${(props) => props.theme.input.bg};
|
||||
}
|
||||
`;
|
||||
|
||||
export default Wrapper;
|
@ -0,0 +1,71 @@
|
||||
import React from 'react';
|
||||
import get from 'lodash/get';
|
||||
import { useTheme } from 'providers/Theme';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import SingleLineEditor from 'components/SingleLineEditor';
|
||||
import { updateCollectionAuth } from 'providers/ReduxStore/slices/collections';
|
||||
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
|
||||
const DigestAuth = ({ collection }) => {
|
||||
const dispatch = useDispatch();
|
||||
const { storedTheme } = useTheme();
|
||||
|
||||
const digestAuth = get(collection, 'root.request.auth.digest', {});
|
||||
|
||||
const handleSave = () => dispatch(saveCollectionRoot(collection.uid));
|
||||
|
||||
const handleUsernameChange = (username) => {
|
||||
dispatch(
|
||||
updateCollectionAuth({
|
||||
mode: 'digest',
|
||||
collectionUid: collection.uid,
|
||||
content: {
|
||||
username: username,
|
||||
password: digestAuth.password
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const handlePasswordChange = (password) => {
|
||||
dispatch(
|
||||
updateCollectionAuth({
|
||||
mode: 'digest',
|
||||
collectionUid: collection.uid,
|
||||
content: {
|
||||
username: digestAuth.username,
|
||||
password: password
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<StyledWrapper className="mt-2 w-full">
|
||||
<label className="block font-medium mb-2">Username</label>
|
||||
<div className="single-line-editor-wrapper mb-2">
|
||||
<SingleLineEditor
|
||||
value={digestAuth.username || ''}
|
||||
theme={storedTheme}
|
||||
onSave={handleSave}
|
||||
onChange={(val) => handleUsernameChange(val)}
|
||||
collection={collection}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<label className="block font-medium mb-2">Password</label>
|
||||
<div className="single-line-editor-wrapper">
|
||||
<SingleLineEditor
|
||||
value={digestAuth.password || ''}
|
||||
theme={storedTheme}
|
||||
onSave={handleSave}
|
||||
onChange={(val) => handlePasswordChange(val)}
|
||||
collection={collection}
|
||||
/>
|
||||
</div>
|
||||
</StyledWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default DigestAuth;
|
@ -5,6 +5,7 @@ import AuthMode from './AuthMode';
|
||||
import AwsV4Auth from './AwsV4Auth';
|
||||
import BearerAuth from './BearerAuth';
|
||||
import BasicAuth from './BasicAuth';
|
||||
import DigestAuth from './DigestAuth';
|
||||
import { saveCollectionRoot } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
|
||||
@ -25,6 +26,9 @@ const Auth = ({ collection }) => {
|
||||
case 'bearer': {
|
||||
return <BearerAuth collection={collection} />;
|
||||
}
|
||||
case 'digest': {
|
||||
return <DigestAuth collection={collection} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -11,22 +11,20 @@ const ProxySettings = ({ proxyConfig, onUpdate }) => {
|
||||
protocol: Yup.string().oneOf(['http', 'https', 'socks4', 'socks5']),
|
||||
hostname: Yup.string()
|
||||
.when('enabled', {
|
||||
is: true,
|
||||
is: 'true',
|
||||
then: (hostname) => hostname.required('Specify the hostname for your proxy.'),
|
||||
otherwise: (hostname) => hostname.nullable()
|
||||
})
|
||||
.max(1024),
|
||||
port: Yup.number()
|
||||
.when('enabled', {
|
||||
is: true,
|
||||
then: (port) => port.required('Specify port between 1 and 65535').typeError('Specify port between 1 and 65535'),
|
||||
otherwise: (port) => port.nullable().transform((_, val) => (val ? Number(val) : null))
|
||||
})
|
||||
.min(1)
|
||||
.max(65535),
|
||||
.max(65535)
|
||||
.typeError('Specify port between 1 and 65535')
|
||||
.nullable()
|
||||
.transform((_, val) => (val ? Number(val) : null)),
|
||||
auth: Yup.object()
|
||||
.when('enabled', {
|
||||
is: true,
|
||||
is: 'true',
|
||||
then: Yup.object({
|
||||
enabled: Yup.boolean(),
|
||||
username: Yup.string()
|
||||
|
@ -10,6 +10,7 @@ import StyledWrapper from './StyledWrapper';
|
||||
import { useFormik } from 'formik';
|
||||
import * as Yup from 'yup';
|
||||
import { uuid } from 'utils/common';
|
||||
import { envVariableNameRegex } from 'utils/common/regex';
|
||||
|
||||
const EnvironmentVariables = ({ environment, collection }) => {
|
||||
const dispatch = useDispatch();
|
||||
@ -23,7 +24,10 @@ const EnvironmentVariables = ({ environment, collection }) => {
|
||||
enabled: Yup.boolean(),
|
||||
name: Yup.string()
|
||||
.required('Name cannot be empty')
|
||||
.matches(/^(?!\d)\w*$/, 'Name contains invalid characters')
|
||||
.matches(
|
||||
envVariableNameRegex,
|
||||
'Name contains invalid characters. Must only contain alphanumeric characters, "-" and "_"'
|
||||
)
|
||||
.trim(),
|
||||
secret: Yup.boolean(),
|
||||
type: Yup.string(),
|
||||
|
@ -22,13 +22,11 @@ const ProxySettings = ({ close }) => {
|
||||
})
|
||||
.max(1024),
|
||||
port: Yup.number()
|
||||
.when('enabled', {
|
||||
is: true,
|
||||
then: (port) => port.required('Specify port between 1 and 65535').typeError('Specify port between 1 and 65535'),
|
||||
otherwise: (port) => port.nullable().transform((_, val) => (val ? Number(val) : null))
|
||||
})
|
||||
.min(1)
|
||||
.max(65535),
|
||||
.max(65535)
|
||||
.typeError('Specify port between 1 and 65535')
|
||||
.nullable()
|
||||
.transform((_, val) => (val ? Number(val) : null)),
|
||||
auth: Yup.object()
|
||||
.when('enabled', {
|
||||
is: true,
|
||||
|
@ -62,6 +62,15 @@ const AuthMode = ({ item, collection }) => {
|
||||
>
|
||||
Bearer Token
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={() => {
|
||||
dropdownTippyRef.current.hide();
|
||||
onModeChange('digest');
|
||||
}}
|
||||
>
|
||||
Digest Auth
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={() => {
|
||||
|
@ -0,0 +1,16 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
label {
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.single-line-editor-wrapper {
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: 3px;
|
||||
border: solid 1px ${(props) => props.theme.input.border};
|
||||
background-color: ${(props) => props.theme.input.bg};
|
||||
}
|
||||
`;
|
||||
|
||||
export default Wrapper;
|
@ -0,0 +1,76 @@
|
||||
import React from 'react';
|
||||
import get from 'lodash/get';
|
||||
import { useTheme } from 'providers/Theme';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import SingleLineEditor from 'components/SingleLineEditor';
|
||||
import { updateAuth } from 'providers/ReduxStore/slices/collections';
|
||||
import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
|
||||
const DigestAuth = ({ item, collection }) => {
|
||||
const dispatch = useDispatch();
|
||||
const { storedTheme } = useTheme();
|
||||
|
||||
const digestAuth = item.draft ? get(item, 'draft.request.auth.digest', {}) : get(item, 'request.auth.digest', {});
|
||||
|
||||
const handleRun = () => dispatch(sendRequest(item, collection.uid));
|
||||
const handleSave = () => dispatch(saveRequest(item.uid, collection.uid));
|
||||
|
||||
const handleUsernameChange = (username) => {
|
||||
dispatch(
|
||||
updateAuth({
|
||||
mode: 'digest',
|
||||
collectionUid: collection.uid,
|
||||
itemUid: item.uid,
|
||||
content: {
|
||||
username: username,
|
||||
password: digestAuth.password
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const handlePasswordChange = (password) => {
|
||||
dispatch(
|
||||
updateAuth({
|
||||
mode: 'digest',
|
||||
collectionUid: collection.uid,
|
||||
itemUid: item.uid,
|
||||
content: {
|
||||
username: digestAuth.username,
|
||||
password: password
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<StyledWrapper className="mt-2 w-full">
|
||||
<label className="block font-medium mb-2">Username</label>
|
||||
<div className="single-line-editor-wrapper mb-2">
|
||||
<SingleLineEditor
|
||||
value={digestAuth.username || ''}
|
||||
theme={storedTheme}
|
||||
onSave={handleSave}
|
||||
onChange={(val) => handleUsernameChange(val)}
|
||||
onRun={handleRun}
|
||||
collection={collection}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<label className="block font-medium mb-2">Password</label>
|
||||
<div className="single-line-editor-wrapper">
|
||||
<SingleLineEditor
|
||||
value={digestAuth.password || ''}
|
||||
theme={storedTheme}
|
||||
onSave={handleSave}
|
||||
onChange={(val) => handlePasswordChange(val)}
|
||||
onRun={handleRun}
|
||||
collection={collection}
|
||||
/>
|
||||
</div>
|
||||
</StyledWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default DigestAuth;
|
@ -4,6 +4,7 @@ import AuthMode from './AuthMode';
|
||||
import AwsV4Auth from './AwsV4Auth';
|
||||
import BearerAuth from './BearerAuth';
|
||||
import BasicAuth from './BasicAuth';
|
||||
import DigestAuth from './DigestAuth';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
|
||||
const Auth = ({ item, collection }) => {
|
||||
@ -20,6 +21,9 @@ const Auth = ({ item, collection }) => {
|
||||
case 'bearer': {
|
||||
return <BearerAuth collection={collection} item={item} />;
|
||||
}
|
||||
case 'digest': {
|
||||
return <DigestAuth collection={collection} item={item} />;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,7 @@ const QueryUrl = ({ item, collection, handleRun }) => {
|
||||
requestUrlChanged({
|
||||
itemUid: item.uid,
|
||||
collectionUid: collection.uid,
|
||||
url: value
|
||||
url: value.trim()
|
||||
})
|
||||
);
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ import SingleLineEditor from 'components/SingleLineEditor';
|
||||
import Tooltip from 'components/Tooltip';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
import toast from 'react-hot-toast';
|
||||
import { envVariableNameRegex } from 'utils/common/regex';
|
||||
|
||||
const VarsTable = ({ item, collection, vars, varType }) => {
|
||||
const dispatch = useDispatch();
|
||||
@ -37,8 +38,10 @@ const VarsTable = ({ item, collection, vars, varType }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (/^\w*$/.test(value) === false) {
|
||||
toast.error('Variable contains invalid character! Variables must only contain alpha-numeric characters.');
|
||||
if (envVariableNameRegex.test(value) === false) {
|
||||
toast.error(
|
||||
'Variable contains invalid character! Variables must only contain alpha-numeric characters, "-" and "_".'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,11 @@ import CodeEditor from 'components/CodeEditor/index';
|
||||
import { get } from 'lodash';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { sendRequest } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import { Document, Page } from 'react-pdf';
|
||||
import { useState } from 'react';
|
||||
import 'pdfjs-dist/build/pdf.worker';
|
||||
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
|
||||
import 'react-pdf/dist/esm/Page/TextLayer.css';
|
||||
|
||||
const QueryResultPreview = ({
|
||||
previewTab,
|
||||
@ -19,6 +24,10 @@ const QueryResultPreview = ({
|
||||
const preferences = useSelector((state) => state.app.preferences);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const [numPages, setNumPages] = useState(null);
|
||||
function onDocumentLoadSuccess({ numPages }) {
|
||||
setNumPages(numPages);
|
||||
}
|
||||
// Fail safe, so we don't render anything with an invalid tab
|
||||
if (!allowedPreviewModes.includes(previewTab)) {
|
||||
return null;
|
||||
@ -45,6 +54,17 @@ const QueryResultPreview = ({
|
||||
case 'preview-image': {
|
||||
return <img src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />;
|
||||
}
|
||||
case 'preview-pdf': {
|
||||
return (
|
||||
<div className="preview-pdf" style={{ height: '100%', overflow: 'auto', maxHeight: 'calc(100vh - 220px)' }}>
|
||||
<Document file={`data:application/pdf;base64,${dataBuffer}`} onLoadSuccess={onDocumentLoadSuccess}>
|
||||
{Array.from(new Array(numPages), (el, index) => (
|
||||
<Page key={`page_${index + 1}`} pageNumber={index + 1} renderAnnotationLayer={false} />
|
||||
))}
|
||||
</Document>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
default:
|
||||
case 'raw': {
|
||||
return (
|
||||
|
@ -18,6 +18,19 @@ const StyledWrapper = styled.div`
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.react-pdf__Page {
|
||||
margin-top: 10px;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.react-pdf__Page__textContent {
|
||||
border: 1px solid darkgrey;
|
||||
box-shadow: 5px 5px 5px 1px #ccc;
|
||||
border-radius: 0px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.react-pdf__Page__canvas {
|
||||
margin: 0 auto;
|
||||
}
|
||||
div[role='tablist'] {
|
||||
.active {
|
||||
color: ${(props) => props.theme.colors.text.yellow};
|
||||
|
@ -49,6 +49,8 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
|
||||
allowedPreviewModes.unshift('preview-web');
|
||||
} else if (mode.includes('image')) {
|
||||
allowedPreviewModes.unshift('preview-image');
|
||||
} else if (contentType.includes('pdf')) {
|
||||
allowedPreviewModes.unshift('preview-pdf');
|
||||
}
|
||||
|
||||
return allowedPreviewModes;
|
||||
|
@ -9,10 +9,11 @@ const CodeView = ({ language, item }) => {
|
||||
const { storedTheme } = useTheme();
|
||||
const preferences = useSelector((state) => state.app.preferences);
|
||||
const { target, client, language: lang } = language;
|
||||
const headers = item.draft ? get(item, 'draft.request.headers') : get(item, 'request.headers');
|
||||
let snippet = '';
|
||||
|
||||
try {
|
||||
snippet = new HTTPSnippet(buildHarRequest(item.request)).convert(target, client);
|
||||
snippet = new HTTPSnippet(buildHarRequest({ request: item.request, headers })).convert(target, client);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
snippet = 'Error generating code snippet';
|
||||
|
@ -33,7 +33,8 @@ const Wrapper = styled.div`
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&.item-hovered {
|
||||
background: ${(props) => props.theme.sidebar.collection.item.hoverBg};
|
||||
.menu-icon {
|
||||
.dropdown {
|
||||
|
@ -84,7 +84,8 @@ const CollectionItem = ({ item, collection, searchText }) => {
|
||||
});
|
||||
|
||||
const itemRowClassName = classnames('flex collection-item-name items-center', {
|
||||
'item-focused-in-tab': item.uid == activeTabUid
|
||||
'item-focused-in-tab': item.uid == activeTabUid,
|
||||
'item-hovered': isOver
|
||||
});
|
||||
|
||||
const scrollToTheActiveTab = () => {
|
||||
|
@ -35,6 +35,10 @@ const StyledWrapper = styled.div`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
textarea.curl-command {
|
||||
min-height: 150px;
|
||||
}
|
||||
`;
|
||||
|
||||
export default StyledWrapper;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import React, { useRef, useEffect, useCallback } from 'react';
|
||||
import { useFormik } from 'formik';
|
||||
import * as Yup from 'yup';
|
||||
import toast from 'react-hot-toast';
|
||||
@ -115,6 +115,25 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
|
||||
|
||||
const onSubmit = () => formik.handleSubmit();
|
||||
|
||||
const handlePaste = useCallback(
|
||||
(event) => {
|
||||
const clipboardData = event.clipboardData || window.clipboardData;
|
||||
const pastedData = clipboardData.getData('Text');
|
||||
|
||||
// Check if pasted data looks like a cURL command
|
||||
const curlCommandRegex = /^\s*curl\s/i;
|
||||
if (curlCommandRegex.test(pastedData)) {
|
||||
// Switch to the 'from-curl' request type
|
||||
formik.setFieldValue('requestType', 'from-curl');
|
||||
formik.setFieldValue('curlCommand', pastedData);
|
||||
|
||||
// Prevent the default paste behavior to avoid pasting into the textarea
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
[formik]
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledWrapper>
|
||||
<Modal size="md" title="New Request" confirmText="Create" handleConfirm={onSubmit} handleCancel={onClose}>
|
||||
@ -174,7 +193,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
|
||||
Name
|
||||
</label>
|
||||
<input
|
||||
id="collection-name"
|
||||
id="request-name"
|
||||
type="text"
|
||||
name="requestName"
|
||||
ref={inputRef}
|
||||
@ -216,6 +235,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
|
||||
spellCheck="false"
|
||||
onChange={formik.handleChange}
|
||||
value={formik.values.requestUrl || ''}
|
||||
onPaste={handlePaste}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -232,8 +252,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
|
||||
<textarea
|
||||
name="curlCommand"
|
||||
placeholder="Enter cURL request here.."
|
||||
className="block textbox w-full mt-4"
|
||||
style={{ resize: 'none' }}
|
||||
className="block textbox w-full mt-4 curl-command"
|
||||
value={formik.values.curlCommand}
|
||||
onChange={formik.handleChange}
|
||||
></textarea>
|
||||
|
@ -105,7 +105,7 @@ const Sidebar = () => {
|
||||
Star
|
||||
</GitHubButton>
|
||||
</div>
|
||||
<div className="flex flex-grow items-center justify-end text-xs mr-2">v1.0.1</div>
|
||||
<div className="flex flex-grow items-center justify-end text-xs mr-2">v1.1.1</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -388,6 +388,10 @@ export const collectionsSlice = createSlice({
|
||||
item.draft.request.auth.mode = 'basic';
|
||||
item.draft.request.auth.basic = action.payload.content;
|
||||
break;
|
||||
case 'digest':
|
||||
item.draft.request.auth.mode = 'digest';
|
||||
item.draft.request.auth.digest = action.payload.content;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -976,6 +980,9 @@ export const collectionsSlice = createSlice({
|
||||
case 'basic':
|
||||
set(collection, 'root.request.auth.basic', action.payload.content);
|
||||
break;
|
||||
case 'digest':
|
||||
set(collection, 'root.request.auth.digest', action.payload.content);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -9,25 +9,17 @@ const createContentType = (mode) => {
|
||||
case 'multipartForm':
|
||||
return 'multipart/form-data';
|
||||
default:
|
||||
return 'application/json';
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
const createHeaders = (headers, mode) => {
|
||||
const contentType = createContentType(mode);
|
||||
const headersArray = headers
|
||||
const createHeaders = (headers) => {
|
||||
return headers
|
||||
.filter((header) => header.enabled)
|
||||
.map((header) => {
|
||||
return {
|
||||
name: header.name,
|
||||
value: header.value
|
||||
};
|
||||
});
|
||||
const headerNames = headersArray.map((header) => header.name);
|
||||
if (!headerNames.includes('Content-Type')) {
|
||||
return [...headersArray, { name: 'Content-Type', value: contentType }];
|
||||
}
|
||||
return headersArray;
|
||||
.map((header) => ({
|
||||
name: header.name,
|
||||
value: header.value
|
||||
}));
|
||||
};
|
||||
|
||||
const createQuery = (queryParams = []) => {
|
||||
@ -56,13 +48,13 @@ const createPostData = (body) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const buildHarRequest = (request) => {
|
||||
export const buildHarRequest = ({ request, headers }) => {
|
||||
return {
|
||||
method: request.method,
|
||||
url: request.url,
|
||||
httpVersion: 'HTTP/1.1',
|
||||
cookies: [],
|
||||
headers: createHeaders(request.headers, request.body.mode),
|
||||
headers: createHeaders(headers),
|
||||
queryString: createQuery(request.params),
|
||||
postData: createPostData(request.body),
|
||||
headersSize: 0,
|
||||
|
@ -494,6 +494,10 @@ export const humanizeRequestAuthMode = (mode) => {
|
||||
label = 'Bearer Token';
|
||||
break;
|
||||
}
|
||||
case 'digest': {
|
||||
label = 'Digest Auth';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return label;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import get from 'lodash/get';
|
||||
import isString from 'lodash/isString';
|
||||
|
||||
let CodeMirror;
|
||||
const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
||||
|
@ -94,3 +94,15 @@ export const getContentType = (headers) => {
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
export const startsWith = (str, search) => {
|
||||
if (!str || !str.length || typeof str !== 'string') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!search || !search.length || typeof search !== 'string') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return str.substr(0, search.length) === search;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
const { describe, it, expect } = require('@jest/globals');
|
||||
|
||||
import { normalizeFileName } from './index';
|
||||
import { normalizeFileName, startsWith } from './index';
|
||||
|
||||
describe('common utils', () => {
|
||||
describe('normalizeFileName', () => {
|
||||
@ -16,4 +16,37 @@ describe('common utils', () => {
|
||||
expect(normalizeFileName('foo\\bar\\')).toBe('foo-bar-');
|
||||
});
|
||||
});
|
||||
|
||||
describe('startsWith', () => {
|
||||
it('should return false if str is not a string', () => {
|
||||
expect(startsWith(null, 'foo')).toBe(false);
|
||||
expect(startsWith(undefined, 'foo')).toBe(false);
|
||||
expect(startsWith(123, 'foo')).toBe(false);
|
||||
expect(startsWith({}, 'foo')).toBe(false);
|
||||
expect(startsWith([], 'foo')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if search is not a string', () => {
|
||||
expect(startsWith('foo', null)).toBe(false);
|
||||
expect(startsWith('foo', undefined)).toBe(false);
|
||||
expect(startsWith('foo', 123)).toBe(false);
|
||||
expect(startsWith('foo', {})).toBe(false);
|
||||
expect(startsWith('foo', [])).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if str does not start with search', () => {
|
||||
expect(startsWith('foo', 'bar')).toBe(false);
|
||||
expect(startsWith('foo', 'baz')).toBe(false);
|
||||
expect(startsWith('foo', 'bar')).toBe(false);
|
||||
expect(startsWith('foo', 'baz')).toBe(false);
|
||||
expect(startsWith('foo', 'bar')).toBe(false);
|
||||
expect(startsWith('foo', 'baz')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true if str starts with search', () => {
|
||||
expect(startsWith('foo', 'f')).toBe(true);
|
||||
expect(startsWith('foo', 'fo')).toBe(true);
|
||||
expect(startsWith('foo', 'foo')).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
1
packages/bruno-app/src/utils/common/regex.js
Normal file
1
packages/bruno-app/src/utils/common/regex.js
Normal file
@ -0,0 +1 @@
|
||||
export const envVariableNameRegex = /^(?!\d)[\w-]*$/;
|
169
packages/bruno-app/src/utils/curl/curl-to-json.js
Normal file
169
packages/bruno-app/src/utils/curl/curl-to-json.js
Normal file
@ -0,0 +1,169 @@
|
||||
/**
|
||||
* Copyright (c) 2014-2016 Nick Carneiro
|
||||
* https://github.com/curlconverter/curlconverter
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import parseCurlCommand from './parse-curl';
|
||||
import * as querystring from 'query-string';
|
||||
import * as jsesc from 'jsesc';
|
||||
|
||||
function getContentType(headers = {}) {
|
||||
const contentType = Object.keys(headers).find((key) => key.toLowerCase() === 'content-type');
|
||||
|
||||
return contentType ? headers[contentType] : null;
|
||||
}
|
||||
|
||||
function repr(value, isKey) {
|
||||
return isKey ? "'" + jsesc(value, { quotes: 'single' }) + "'" : value;
|
||||
}
|
||||
|
||||
function getQueries(request) {
|
||||
const queries = {};
|
||||
for (const paramName in request.query) {
|
||||
const rawValue = request.query[paramName];
|
||||
let paramValue;
|
||||
if (Array.isArray(rawValue)) {
|
||||
paramValue = rawValue.map(repr);
|
||||
} else {
|
||||
paramValue = repr(rawValue);
|
||||
}
|
||||
queries[repr(paramName)] = paramValue;
|
||||
}
|
||||
|
||||
return queries;
|
||||
}
|
||||
|
||||
function getDataString(request) {
|
||||
if (typeof request.data === 'number') {
|
||||
request.data = request.data.toString();
|
||||
}
|
||||
|
||||
const contentType = getContentType(request.headers);
|
||||
|
||||
if (contentType && contentType.includes('application/json')) {
|
||||
return { data: request.data.toString() };
|
||||
}
|
||||
|
||||
const parsedQueryString = querystring.parse(request.data, { sort: false });
|
||||
const keyCount = Object.keys(parsedQueryString).length;
|
||||
const singleKeyOnly = keyCount === 1 && !parsedQueryString[Object.keys(parsedQueryString)[0]];
|
||||
const singularData = request.isDataBinary || singleKeyOnly;
|
||||
if (singularData) {
|
||||
const data = {};
|
||||
data[repr(request.data)] = '';
|
||||
return { data: data };
|
||||
} else {
|
||||
return getMultipleDataString(request, parsedQueryString);
|
||||
}
|
||||
}
|
||||
|
||||
function getMultipleDataString(request, parsedQueryString) {
|
||||
const data = {};
|
||||
|
||||
for (const key in parsedQueryString) {
|
||||
const value = parsedQueryString[key];
|
||||
if (Array.isArray(value)) {
|
||||
data[repr(key)] = value;
|
||||
} else {
|
||||
data[repr(key)] = repr(value);
|
||||
}
|
||||
}
|
||||
|
||||
return { data: data };
|
||||
}
|
||||
|
||||
function getFilesString(request) {
|
||||
const data = {};
|
||||
|
||||
data.files = {};
|
||||
data.data = {};
|
||||
|
||||
for (const multipartKey in request.multipartUploads) {
|
||||
const multipartValue = request.multipartUploads[multipartKey];
|
||||
if (multipartValue.startsWith('@')) {
|
||||
const fileName = multipartValue.slice(1);
|
||||
data.files[repr(multipartKey)] = repr(fileName);
|
||||
} else {
|
||||
data.data[repr(multipartKey)] = repr(multipartValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(data.files).length === 0) {
|
||||
delete data.files;
|
||||
}
|
||||
|
||||
if (Object.keys(data.data).length === 0) {
|
||||
delete data.data;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
const curlToJson = (curlCommand) => {
|
||||
const request = parseCurlCommand(curlCommand);
|
||||
|
||||
const requestJson = {};
|
||||
|
||||
// curl automatically prepends 'http' if the scheme is missing, but python fails and returns an error
|
||||
// we tack it on here to mimic curl
|
||||
if (!request.url.match(/https?:/)) {
|
||||
request.url = 'http://' + request.url;
|
||||
}
|
||||
if (!request.urlWithoutQuery.match(/https?:/)) {
|
||||
request.urlWithoutQuery = 'http://' + request.urlWithoutQuery;
|
||||
}
|
||||
|
||||
requestJson.url = request.urlWithoutQuery.replace(/\/$/, '');
|
||||
requestJson.raw_url = request.url;
|
||||
requestJson.method = request.method;
|
||||
|
||||
if (request.cookies) {
|
||||
const cookies = {};
|
||||
for (const cookieName in request.cookies) {
|
||||
cookies[repr(cookieName)] = repr(request.cookies[cookieName]);
|
||||
}
|
||||
|
||||
requestJson.cookies = cookies;
|
||||
}
|
||||
|
||||
if (request.headers) {
|
||||
const headers = {};
|
||||
for (const headerName in request.headers) {
|
||||
headers[repr(headerName)] = repr(request.headers[headerName]);
|
||||
}
|
||||
|
||||
requestJson.headers = headers;
|
||||
}
|
||||
|
||||
if (request.query) {
|
||||
requestJson.queries = getQueries(request);
|
||||
}
|
||||
|
||||
if (typeof request.data === 'string' || typeof request.data === 'number') {
|
||||
Object.assign(requestJson, getDataString(request));
|
||||
} else if (request.multipartUploads) {
|
||||
Object.assign(requestJson, getFilesString(request));
|
||||
}
|
||||
|
||||
if (request.insecure) {
|
||||
requestJson.insecure = false;
|
||||
}
|
||||
|
||||
if (request.auth) {
|
||||
const splitAuth = request.auth.split(':');
|
||||
const user = splitAuth[0] || '';
|
||||
const password = splitAuth[1] || '';
|
||||
|
||||
requestJson.auth = {
|
||||
user: repr(user),
|
||||
password: repr(password)
|
||||
};
|
||||
}
|
||||
|
||||
return Object.keys(requestJson).length ? requestJson : {};
|
||||
};
|
||||
|
||||
export default curlToJson;
|
62
packages/bruno-app/src/utils/curl/curl-to-json.spec.js
Normal file
62
packages/bruno-app/src/utils/curl/curl-to-json.spec.js
Normal file
@ -0,0 +1,62 @@
|
||||
const { describe, it, expect } = require('@jest/globals');
|
||||
|
||||
import curlToJson from './curl-to-json';
|
||||
|
||||
describe('curlToJson', () => {
|
||||
it('should return a parse a simple curl command', () => {
|
||||
const curlCommand = 'curl https://www.usebruno.com';
|
||||
const result = curlToJson(curlCommand);
|
||||
|
||||
expect(result).toEqual({
|
||||
url: 'https://www.usebruno.com',
|
||||
raw_url: 'https://www.usebruno.com',
|
||||
method: 'get'
|
||||
});
|
||||
});
|
||||
|
||||
it('should return a parse a curl command with headers', () => {
|
||||
const curlCommand = `curl https://www.usebruno.com
|
||||
-H 'Accept: application/json, text/plain, */*'
|
||||
-H 'Accept-Language: en-US,en;q=0.9,hi;q=0.8'
|
||||
`;
|
||||
|
||||
const result = curlToJson(curlCommand);
|
||||
|
||||
expect(result).toEqual({
|
||||
url: 'https://www.usebruno.com',
|
||||
raw_url: 'https://www.usebruno.com',
|
||||
method: 'get',
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*',
|
||||
'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should return a parse a curl with a post body', () => {
|
||||
const curlCommand = `curl 'https://www.usebruno.com'
|
||||
-H 'Accept: application/json, text/plain, */*'
|
||||
-H 'Accept-Language: en-US,en;q=0.9,hi;q=0.8'
|
||||
-H 'Content-Type: application/json;charset=utf-8'
|
||||
-H 'Origin: https://www.usebruno.com'
|
||||
-H 'Referer: https://www.usebruno.com/'
|
||||
--data-raw '{"email":"test@usebruno.com","password":"test"}'
|
||||
`;
|
||||
|
||||
const result = curlToJson(curlCommand);
|
||||
|
||||
expect(result).toEqual({
|
||||
url: 'https://www.usebruno.com',
|
||||
raw_url: 'https://www.usebruno.com',
|
||||
method: 'post',
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*',
|
||||
'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8',
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
Origin: 'https://www.usebruno.com',
|
||||
Referer: 'https://www.usebruno.com/'
|
||||
},
|
||||
data: '{"email":"test@usebruno.com","password":"test"}'
|
||||
});
|
||||
});
|
||||
});
|
@ -1,18 +1,29 @@
|
||||
import * as parse from 'parse-curl';
|
||||
import { BrunoError } from 'utils/common/error';
|
||||
import { parseQueryParams } from 'utils/url';
|
||||
import { forOwn } from 'lodash';
|
||||
import { safeStringifyJSON } from 'utils/common';
|
||||
import curlToJson from './curl-to-json';
|
||||
|
||||
export const getRequestFromCurlCommand = (command) => {
|
||||
export const getRequestFromCurlCommand = (curlCommand) => {
|
||||
const parseFormData = (parsedBody) => {
|
||||
parseQueryParams(parsedBody);
|
||||
};
|
||||
try {
|
||||
const request = parse(command);
|
||||
const parsedHeader = request?.header;
|
||||
const headers =
|
||||
parsedHeader && Object.keys(parsedHeader).map((key) => ({ name: key, value: parsedHeader[key], enabled: true }));
|
||||
const formData = [];
|
||||
forOwn(parsedBody, (value, key) => {
|
||||
formData.push({ name: key, value, enabled: true });
|
||||
});
|
||||
|
||||
const contentType = headers?.find((h) => h.name.toLowerCase() === 'content-type');
|
||||
return formData;
|
||||
};
|
||||
|
||||
try {
|
||||
if (!curlCommand || typeof curlCommand !== 'string' || curlCommand.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const request = curlToJson(curlCommand);
|
||||
const parsedHeaders = request?.headers;
|
||||
const headers =
|
||||
parsedHeaders &&
|
||||
Object.keys(parsedHeaders).map((key) => ({ name: key, value: parsedHeaders[key], enabled: true }));
|
||||
|
||||
const contentType = headers?.find((h) => h.name.toLowerCase() === 'content-type')?.value;
|
||||
const body = {
|
||||
mode: 'none',
|
||||
json: null,
|
||||
@ -22,30 +33,25 @@ export const getRequestFromCurlCommand = (command) => {
|
||||
multipartForm: null,
|
||||
formUrlEncoded: null
|
||||
};
|
||||
const parsedBody = request?.body;
|
||||
if (parsedBody && contentType) {
|
||||
switch (contentType.value.toLowerCase()) {
|
||||
case 'application/json':
|
||||
body.mode = 'json';
|
||||
body.json = parsedBody;
|
||||
break;
|
||||
case 'text/xml':
|
||||
body.mode = 'xml';
|
||||
body.xml = parsedBody;
|
||||
break;
|
||||
case 'application/x-www-form-urlencoded':
|
||||
body.mode = 'formUrlEncoded';
|
||||
body.formUrlEncoded = parseFormData(parsedBody);
|
||||
break;
|
||||
case 'multipart/form-data':
|
||||
body.mode = 'multipartForm';
|
||||
body.multipartForm = parsedBody;
|
||||
break;
|
||||
case 'text/plain':
|
||||
default:
|
||||
body.mode = 'text';
|
||||
body.text = parsedBody;
|
||||
break;
|
||||
const parsedBody = request.data;
|
||||
if (parsedBody && contentType && typeof contentType === 'string') {
|
||||
if (contentType.includes('application/json')) {
|
||||
body.mode = 'json';
|
||||
body.json = safeStringifyJSON(parsedBody);
|
||||
} else if (contentType.includes('text/xml')) {
|
||||
body.mode = 'xml';
|
||||
body.xml = parsedBody;
|
||||
} else if (contentType.includes('application/x-www-form-urlencoded')) {
|
||||
body.mode = 'formUrlEncoded';
|
||||
console.log(parsedBody);
|
||||
console.log(parseFormData(parsedBody));
|
||||
body.formUrlEncoded = parseFormData(parsedBody);
|
||||
} else if (contentType.includes('multipart/form-data')) {
|
||||
body.mode = 'multipartForm';
|
||||
body.multipartForm = parsedBody;
|
||||
} else if (contentType.includes('text/plain')) {
|
||||
body.mode = 'text';
|
||||
body.text = parsedBody;
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -55,6 +61,7 @@ export const getRequestFromCurlCommand = (command) => {
|
||||
headers: headers
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
238
packages/bruno-app/src/utils/curl/parse-curl.js
Normal file
238
packages/bruno-app/src/utils/curl/parse-curl.js
Normal file
@ -0,0 +1,238 @@
|
||||
/**
|
||||
* Copyright (c) 2014-2016 Nick Carneiro
|
||||
* https://github.com/curlconverter/curlconverter
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import * as cookie from 'cookie';
|
||||
import * as URL from 'url';
|
||||
import * as querystring from 'query-string';
|
||||
import yargs from 'yargs-parser';
|
||||
|
||||
const parseCurlCommand = (curlCommand) => {
|
||||
// Remove newlines (and from continuations)
|
||||
curlCommand = curlCommand.replace(/\\\r|\\\n/g, '');
|
||||
|
||||
// Remove extra whitespace
|
||||
curlCommand = curlCommand.replace(/\s+/g, ' ');
|
||||
|
||||
// yargs parses -XPOST as separate arguments. just prescreen for it.
|
||||
curlCommand = curlCommand.replace(/ -XPOST/, ' -X POST');
|
||||
curlCommand = curlCommand.replace(/ -XGET/, ' -X GET');
|
||||
curlCommand = curlCommand.replace(/ -XPUT/, ' -X PUT');
|
||||
curlCommand = curlCommand.replace(/ -XPATCH/, ' -X PATCH');
|
||||
curlCommand = curlCommand.replace(/ -XDELETE/, ' -X DELETE');
|
||||
curlCommand = curlCommand.replace(/ -XOPTIONS/, ' -X OPTIONS');
|
||||
// Safari adds `-Xnull` if is unable to determine the request type, it can be ignored
|
||||
curlCommand = curlCommand.replace(/ -Xnull/, ' ');
|
||||
curlCommand = curlCommand.trim();
|
||||
|
||||
const parsedArguments = yargs(curlCommand, {
|
||||
boolean: ['I', 'head', 'compressed', 'L', 'k', 'silent', 's'],
|
||||
alias: {
|
||||
H: 'header',
|
||||
A: 'user-agent'
|
||||
}
|
||||
});
|
||||
|
||||
let cookieString;
|
||||
let cookies;
|
||||
let url = parsedArguments._[1] || '';
|
||||
|
||||
// remove surrounding quotes if present
|
||||
if (url && url.length) {
|
||||
url = url.replace(/^['"]|['"]$/g, '');
|
||||
}
|
||||
|
||||
// if url argument wasn't where we expected it, try to find it in the other arguments
|
||||
if (!url) {
|
||||
for (const argName in parsedArguments) {
|
||||
if (typeof parsedArguments[argName] === 'string') {
|
||||
if (parsedArguments[argName].indexOf('http') === 0 || parsedArguments[argName].indexOf('www.') === 0) {
|
||||
url = parsedArguments[argName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let headers;
|
||||
|
||||
if (parsedArguments.header) {
|
||||
if (!headers) {
|
||||
headers = {};
|
||||
}
|
||||
if (!Array.isArray(parsedArguments.header)) {
|
||||
parsedArguments.header = [parsedArguments.header];
|
||||
}
|
||||
parsedArguments.header.forEach((header) => {
|
||||
if (header.indexOf('Cookie') !== -1) {
|
||||
cookieString = header;
|
||||
} else {
|
||||
const components = header.split(/:(.*)/);
|
||||
if (components[1]) {
|
||||
headers[components[0]] = components[1].trim();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (parsedArguments['user-agent']) {
|
||||
if (!headers) {
|
||||
headers = {};
|
||||
}
|
||||
headers['User-Agent'] = parsedArguments['user-agent'];
|
||||
}
|
||||
|
||||
if (parsedArguments.b) {
|
||||
cookieString = parsedArguments.b;
|
||||
}
|
||||
if (parsedArguments.cookie) {
|
||||
cookieString = parsedArguments.cookie;
|
||||
}
|
||||
let multipartUploads;
|
||||
if (parsedArguments.F) {
|
||||
multipartUploads = {};
|
||||
if (!Array.isArray(parsedArguments.F)) {
|
||||
parsedArguments.F = [parsedArguments.F];
|
||||
}
|
||||
parsedArguments.F.forEach((multipartArgument) => {
|
||||
// input looks like key=value. value could be json or a file path prepended with an @
|
||||
const splitArguments = multipartArgument.split('=', 2);
|
||||
const key = splitArguments[0];
|
||||
const value = splitArguments[1];
|
||||
multipartUploads[key] = value;
|
||||
});
|
||||
}
|
||||
if (cookieString) {
|
||||
const cookieParseOptions = {
|
||||
decode: function (s) {
|
||||
return s;
|
||||
}
|
||||
};
|
||||
// separate out cookie headers into separate data structure
|
||||
// note: cookie is case insensitive
|
||||
cookies = cookie.parse(cookieString.replace(/^Cookie: /gi, ''), cookieParseOptions);
|
||||
}
|
||||
let method;
|
||||
if (parsedArguments.X === 'POST') {
|
||||
method = 'post';
|
||||
} else if (parsedArguments.X === 'PUT' || parsedArguments.T) {
|
||||
method = 'put';
|
||||
} else if (parsedArguments.X === 'PATCH') {
|
||||
method = 'patch';
|
||||
} else if (parsedArguments.X === 'DELETE') {
|
||||
method = 'delete';
|
||||
} else if (parsedArguments.X === 'OPTIONS') {
|
||||
method = 'options';
|
||||
} else if (
|
||||
(parsedArguments.d ||
|
||||
parsedArguments.data ||
|
||||
parsedArguments['data-ascii'] ||
|
||||
parsedArguments['data-binary'] ||
|
||||
parsedArguments['data-raw'] ||
|
||||
parsedArguments.F ||
|
||||
parsedArguments.form) &&
|
||||
!(parsedArguments.G || parsedArguments.get)
|
||||
) {
|
||||
method = 'post';
|
||||
} else if (parsedArguments.I || parsedArguments.head) {
|
||||
method = 'head';
|
||||
} else {
|
||||
method = 'get';
|
||||
}
|
||||
|
||||
const compressed = !!parsedArguments.compressed;
|
||||
const urlObject = URL.parse(url || '');
|
||||
|
||||
// if GET request with data, convert data to query string
|
||||
// NB: the -G flag does not change the http verb. It just moves the data into the url.
|
||||
if (parsedArguments.G || parsedArguments.get) {
|
||||
urlObject.query = urlObject.query ? urlObject.query : '';
|
||||
const option = 'd' in parsedArguments ? 'd' : 'data' in parsedArguments ? 'data' : null;
|
||||
if (option) {
|
||||
let urlQueryString = '';
|
||||
|
||||
if (url.indexOf('?') < 0) {
|
||||
url += '?';
|
||||
} else {
|
||||
urlQueryString += '&';
|
||||
}
|
||||
|
||||
if (typeof parsedArguments[option] === 'object') {
|
||||
urlQueryString += parsedArguments[option].join('&');
|
||||
} else {
|
||||
urlQueryString += parsedArguments[option];
|
||||
}
|
||||
urlObject.query += urlQueryString;
|
||||
url += urlQueryString;
|
||||
delete parsedArguments[option];
|
||||
}
|
||||
}
|
||||
if (urlObject.query && urlObject.query.endsWith('&')) {
|
||||
urlObject.query = urlObject.query.slice(0, -1);
|
||||
}
|
||||
const query = querystring.parse(urlObject.query, { sort: false });
|
||||
for (const param in query) {
|
||||
if (query[param] === null) {
|
||||
query[param] = '';
|
||||
}
|
||||
}
|
||||
|
||||
urlObject.search = null; // Clean out the search/query portion.
|
||||
const request = {
|
||||
url: url,
|
||||
urlWithoutQuery: URL.format(urlObject)
|
||||
};
|
||||
if (compressed) {
|
||||
request.compressed = true;
|
||||
}
|
||||
|
||||
if (Object.keys(query).length > 0) {
|
||||
request.query = query;
|
||||
}
|
||||
if (headers) {
|
||||
request.headers = headers;
|
||||
}
|
||||
request.method = method;
|
||||
|
||||
if (cookies) {
|
||||
request.cookies = cookies;
|
||||
request.cookieString = cookieString.replace('Cookie: ', '');
|
||||
}
|
||||
if (multipartUploads) {
|
||||
request.multipartUploads = multipartUploads;
|
||||
}
|
||||
if (parsedArguments.data) {
|
||||
request.data = parsedArguments.data;
|
||||
} else if (parsedArguments['data-binary']) {
|
||||
request.data = parsedArguments['data-binary'];
|
||||
request.isDataBinary = true;
|
||||
} else if (parsedArguments.d) {
|
||||
request.data = parsedArguments.d;
|
||||
} else if (parsedArguments['data-ascii']) {
|
||||
request.data = parsedArguments['data-ascii'];
|
||||
} else if (parsedArguments['data-raw']) {
|
||||
request.data = parsedArguments['data-raw'];
|
||||
request.isDataRaw = true;
|
||||
}
|
||||
|
||||
if (parsedArguments.u) {
|
||||
request.auth = parsedArguments.u;
|
||||
}
|
||||
if (parsedArguments.user) {
|
||||
request.auth = parsedArguments.user;
|
||||
}
|
||||
if (Array.isArray(request.data)) {
|
||||
request.dataArray = request.data;
|
||||
request.data = request.data.join('&');
|
||||
}
|
||||
|
||||
if (parsedArguments.k || parsedArguments.insecure) {
|
||||
request.insecure = true;
|
||||
}
|
||||
return request;
|
||||
};
|
||||
|
||||
export default parseCurlCommand;
|
@ -80,7 +80,8 @@ const transformInsomniaRequestItem = (request, index, allRequests) => {
|
||||
auth: {
|
||||
mode: 'none',
|
||||
basic: null,
|
||||
bearer: null
|
||||
bearer: null,
|
||||
digest: null
|
||||
},
|
||||
headers: [],
|
||||
params: [],
|
||||
|
@ -69,7 +69,8 @@ const transformOpenapiRequestItem = (request) => {
|
||||
auth: {
|
||||
mode: 'none',
|
||||
basic: null,
|
||||
bearer: null
|
||||
bearer: null,
|
||||
digest: null
|
||||
},
|
||||
headers: [],
|
||||
params: [],
|
||||
@ -186,18 +187,24 @@ const transformOpenapiRequestItem = (request) => {
|
||||
return brunoRequestItem;
|
||||
};
|
||||
|
||||
const resolveRefs = (spec, components = spec.components) => {
|
||||
const resolveRefs = (spec, components = spec.components, visitedItems = new Set()) => {
|
||||
if (!spec || typeof spec !== 'object') {
|
||||
return spec;
|
||||
}
|
||||
|
||||
if (Array.isArray(spec)) {
|
||||
return spec.map((item) => resolveRefs(item, components));
|
||||
return spec.map((item) => resolveRefs(item, components, visitedItems));
|
||||
}
|
||||
|
||||
if ('$ref' in spec) {
|
||||
const refPath = spec.$ref;
|
||||
|
||||
if (visitedItems.has(refPath)) {
|
||||
return spec;
|
||||
} else {
|
||||
visitedItems.add(refPath);
|
||||
}
|
||||
|
||||
if (refPath.startsWith('#/components/')) {
|
||||
// Local reference within components
|
||||
const refKeys = refPath.replace('#/components/', '').split('/');
|
||||
@ -212,7 +219,7 @@ const resolveRefs = (spec, components = spec.components) => {
|
||||
}
|
||||
}
|
||||
|
||||
return resolveRefs(ref, components);
|
||||
return resolveRefs(ref, components, visitedItems);
|
||||
} else {
|
||||
// Handle external references (not implemented here)
|
||||
// You would need to fetch the external reference and resolve it.
|
||||
@ -222,7 +229,7 @@ const resolveRefs = (spec, components = spec.components) => {
|
||||
|
||||
// Recursively resolve references in nested objects
|
||||
for (const prop in spec) {
|
||||
spec[prop] = resolveRefs(spec[prop], components);
|
||||
spec[prop] = resolveRefs(spec[prop], components, visitedItems);
|
||||
}
|
||||
|
||||
return spec;
|
||||
@ -266,12 +273,7 @@ const getDefaultUrl = (serverObject) => {
|
||||
};
|
||||
|
||||
const getSecurity = (apiSpec) => {
|
||||
let supportedSchemes = apiSpec.security || [];
|
||||
if (supportedSchemes.length === 0) {
|
||||
return {
|
||||
supported: []
|
||||
};
|
||||
}
|
||||
let defaultSchemes = apiSpec.security || [];
|
||||
|
||||
let securitySchemes = get(apiSpec, 'components.securitySchemes', {});
|
||||
if (Object.keys(securitySchemes) === 0) {
|
||||
@ -281,7 +283,7 @@ const getSecurity = (apiSpec) => {
|
||||
}
|
||||
|
||||
return {
|
||||
supported: supportedSchemes.map((scheme) => {
|
||||
supported: defaultSchemes.map((scheme) => {
|
||||
var schemeName = Object.keys(scheme)[0];
|
||||
return securitySchemes[schemeName];
|
||||
}),
|
||||
|
@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- Upgraded axios to 1.5.1
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Announcing Stable Release
|
||||
|
||||
## 0.13.0
|
||||
|
||||
- feat(#306) Module whitelisting and filesystem access support
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@usebruno/cli",
|
||||
"version": "0.15.1",
|
||||
"version": "1.1.1",
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
@ -24,7 +24,7 @@
|
||||
"package.json"
|
||||
],
|
||||
"dependencies": {
|
||||
"@usebruno/js": "0.9.1",
|
||||
"@usebruno/js": "0.9.2",
|
||||
"@usebruno/lang": "0.9.0",
|
||||
"axios": "^1.5.1",
|
||||
"chai": "^4.3.7",
|
||||
|
@ -3,7 +3,7 @@ const qs = require('qs');
|
||||
const chalk = require('chalk');
|
||||
const decomment = require('decomment');
|
||||
const fs = require('fs');
|
||||
const { forOwn, each, extend, get, compact } = require('lodash');
|
||||
const { forOwn, isUndefined, isNull, each, extend, get, compact } = require('lodash');
|
||||
const FormData = require('form-data');
|
||||
const prepareRequest = require('./prepare-request');
|
||||
const interpolateVars = require('./interpolate-vars');
|
||||
@ -136,14 +136,15 @@ const runSingleRequest = async function (
|
||||
const proxyAuthEnabled = get(brunoConfig, 'proxy.auth.enabled', false);
|
||||
const socksEnabled = proxyProtocol.includes('socks');
|
||||
|
||||
let uriPort = isUndefined(proxyPort) || isNull(proxyPort) ? '' : `:${proxyPort}`;
|
||||
let proxyUri;
|
||||
if (proxyAuthEnabled) {
|
||||
const proxyAuthUsername = interpolateString(get(brunoConfig, 'proxy.auth.username'), interpolationOptions);
|
||||
const proxyAuthPassword = interpolateString(get(brunoConfig, 'proxy.auth.password'), interpolationOptions);
|
||||
|
||||
proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`;
|
||||
proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}${uriPort}`;
|
||||
} else {
|
||||
proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`;
|
||||
proxyUri = `${proxyProtocol}://${proxyHostname}${uriPort}`;
|
||||
}
|
||||
|
||||
if (socksEnabled) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "v1.0.1",
|
||||
"version": "v1.1.1",
|
||||
"name": "bruno",
|
||||
"description": "Opensource API Client for Exploring and Testing APIs",
|
||||
"homepage": "https://www.usebruno.com",
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/credential-providers": "^3.425.0",
|
||||
"@usebruno/js": "0.9.1",
|
||||
"@usebruno/js": "0.9.2",
|
||||
"@usebruno/lang": "0.9.0",
|
||||
"@usebruno/schema": "0.6.0",
|
||||
"about-window": "^1.15.2",
|
||||
|
@ -14,16 +14,18 @@ const { loadWindowState, saveBounds, saveMaximized } = require('./utils/window')
|
||||
|
||||
const lastOpenedCollections = new LastOpenedCollections();
|
||||
|
||||
// Reference: https://content-security-policy.com/
|
||||
const contentSecurityPolicy = [
|
||||
isDev ? "default-src 'self' 'unsafe-inline' 'unsafe-eval'" : "default-src 'self'",
|
||||
"connect-src 'self' https://api.github.com/repos/usebruno/bruno",
|
||||
"font-src 'self' https://fonts.gstatic.com",
|
||||
"default-src 'self'",
|
||||
"script-src * 'unsafe-inline' 'unsafe-eval'",
|
||||
"connect-src 'self' api.github.com",
|
||||
"font-src 'self' https:",
|
||||
"form-action 'none'",
|
||||
"img-src 'self' blob: data:",
|
||||
"style-src 'self' https://fonts.googleapis.com"
|
||||
"img-src 'self' blob: data: https:",
|
||||
"style-src 'self' 'unsafe-inline' https:"
|
||||
];
|
||||
|
||||
setContentSecurityPolicy(contentSecurityPolicy.join(';'));
|
||||
setContentSecurityPolicy(contentSecurityPolicy.join(';') + ';');
|
||||
|
||||
const menu = Menu.buildFromTemplate(menuTemplate);
|
||||
Menu.setApplicationMenu(menu);
|
||||
|
79
packages/bruno-electron/src/ipc/network/digestauth-helper.js
Normal file
79
packages/bruno-electron/src/ipc/network/digestauth-helper.js
Normal file
@ -0,0 +1,79 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
function isStrPresent(str) {
|
||||
return str && str !== '' && str !== 'undefined';
|
||||
}
|
||||
|
||||
function stripQuotes(str) {
|
||||
return str.replace(/"/g, '');
|
||||
}
|
||||
|
||||
function containsDigestHeader(response) {
|
||||
const authHeader = response?.headers?.['www-authenticate'];
|
||||
return authHeader ? authHeader.trim().toLowerCase().startsWith('digest') : false;
|
||||
}
|
||||
|
||||
function containsAuthorizationHeader(originalRequest) {
|
||||
return Boolean(originalRequest.headers['Authorization']);
|
||||
}
|
||||
|
||||
function md5(input) {
|
||||
return crypto.createHash('md5').update(input).digest('hex');
|
||||
}
|
||||
|
||||
function addDigestInterceptor(axiosInstance, request) {
|
||||
const { username, password } = request.digestConfig;
|
||||
|
||||
console.debug(request);
|
||||
|
||||
if (!isStrPresent(username) || !isStrPresent(password)) {
|
||||
console.warn('Required Digest Auth fields are not present');
|
||||
return;
|
||||
}
|
||||
|
||||
axiosInstance.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
const originalRequest = error.config;
|
||||
|
||||
if (
|
||||
error.response?.status === 401 &&
|
||||
containsDigestHeader(error.response) &&
|
||||
!containsAuthorizationHeader(originalRequest)
|
||||
) {
|
||||
console.debug(error.response.headers['www-authenticate']);
|
||||
|
||||
const authDetails = error.response.headers['www-authenticate']
|
||||
.split(', ')
|
||||
.map((v) => v.split('=').map(stripQuotes))
|
||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
|
||||
console.debug(authDetails);
|
||||
|
||||
const nonceCount = '00000001';
|
||||
const cnonce = crypto.randomBytes(24).toString('hex');
|
||||
|
||||
if (authDetails.algorithm.toUpperCase() !== 'MD5') {
|
||||
console.warn(`Unsupported Digest algorithm: ${algo}`);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
const HA1 = md5(`${username}:${authDetails['Digest realm']}:${password}`);
|
||||
const HA2 = md5(`${request.method}:${request.url}`);
|
||||
const response = md5(`${HA1}:${authDetails.nonce}:${nonceCount}:${cnonce}:auth:${HA2}`);
|
||||
|
||||
const authorizationHeader =
|
||||
`Digest username="${username}",realm="${authDetails['Digest realm']}",` +
|
||||
`nonce="${authDetails.nonce}",uri="${request.url}",qop="auth",algorithm="${authDetails.algorithm}",` +
|
||||
`response="${response}",nc="${nonceCount}",cnonce="${cnonce}"`;
|
||||
originalRequest.headers['Authorization'] = authorizationHeader;
|
||||
console.debug(`Authorization: ${originalRequest.headers['Authorization']}`);
|
||||
|
||||
delete originalRequest.digestConfig;
|
||||
return axiosInstance(originalRequest);
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = { addDigestInterceptor };
|
@ -6,11 +6,10 @@ const axios = require('axios');
|
||||
const path = require('path');
|
||||
const decomment = require('decomment');
|
||||
const Mustache = require('mustache');
|
||||
const FormData = require('form-data');
|
||||
const contentDispositionParser = require('content-disposition');
|
||||
const mime = require('mime-types');
|
||||
const { ipcMain } = require('electron');
|
||||
const { forOwn, extend, each, get, compact } = require('lodash');
|
||||
const { isUndefined, isNull, each, get, compact } = require('lodash');
|
||||
const { VarsRuntime, AssertRuntime, ScriptRuntime, TestRuntime } = require('@usebruno/js');
|
||||
const prepareRequest = require('./prepare-request');
|
||||
const prepareGqlIntrospectionRequest = require('./prepare-gql-introspection-request');
|
||||
@ -26,6 +25,7 @@ const { HttpProxyAgent } = require('http-proxy-agent');
|
||||
const { SocksProxyAgent } = require('socks-proxy-agent');
|
||||
const { makeAxiosInstance } = require('./axios-instance');
|
||||
const { addAwsV4Interceptor, resolveAwsV4Credentials } = require('./awsv4auth-helper');
|
||||
const { addDigestInterceptor } = require('./digestauth-helper');
|
||||
const { shouldUseProxy, PatchedHttpsProxyAgent } = require('../../utils/proxy-util');
|
||||
const { chooseFileToSave, writeBinaryFile } = require('../../utils/filesystem');
|
||||
|
||||
@ -71,22 +71,6 @@ const getEnvVars = (environment = {}) => {
|
||||
};
|
||||
};
|
||||
|
||||
const getSize = (data) => {
|
||||
if (!data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (typeof data === 'string') {
|
||||
return Buffer.byteLength(data, 'utf8');
|
||||
}
|
||||
|
||||
if (typeof data === 'object') {
|
||||
return Buffer.byteLength(safeStringifyJSON(data), 'utf8');
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
const configureRequest = async (
|
||||
collectionUid,
|
||||
request,
|
||||
@ -142,7 +126,7 @@ const configureRequest = async (
|
||||
|
||||
// proxy configuration
|
||||
let proxyConfig = get(brunoConfig, 'proxy', {});
|
||||
let proxyEnabled = get(proxyConfig, 'enabled', false);
|
||||
let proxyEnabled = get(proxyConfig, 'enabled', 'global');
|
||||
if (proxyEnabled === 'global') {
|
||||
proxyConfig = preferencesUtil.getGlobalProxyConfig();
|
||||
proxyEnabled = get(proxyConfig, 'enabled', false);
|
||||
@ -155,14 +139,15 @@ const configureRequest = async (
|
||||
const proxyAuthEnabled = get(proxyConfig, 'auth.enabled', false);
|
||||
const socksEnabled = proxyProtocol.includes('socks');
|
||||
|
||||
let uriPort = isUndefined(proxyPort) || isNull(proxyPort) ? '' : `:${proxyPort}`;
|
||||
let proxyUri;
|
||||
if (proxyAuthEnabled) {
|
||||
const proxyAuthUsername = interpolateString(get(proxyConfig, 'auth.username'), interpolationOptions);
|
||||
const proxyAuthPassword = interpolateString(get(proxyConfig, 'auth.password'), interpolationOptions);
|
||||
|
||||
proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}:${proxyPort}`;
|
||||
proxyUri = `${proxyProtocol}://${proxyAuthUsername}:${proxyAuthPassword}@${proxyHostname}${uriPort}`;
|
||||
} else {
|
||||
proxyUri = `${proxyProtocol}://${proxyHostname}:${proxyPort}`;
|
||||
proxyUri = `${proxyProtocol}://${proxyHostname}${uriPort}`;
|
||||
}
|
||||
|
||||
if (socksEnabled) {
|
||||
@ -190,6 +175,10 @@ const configureRequest = async (
|
||||
delete request.awsv4config;
|
||||
}
|
||||
|
||||
if (request.digestConfig) {
|
||||
addDigestInterceptor(axiosInstance, request);
|
||||
}
|
||||
|
||||
request.timeout = preferencesUtil.getRequestTimeout();
|
||||
|
||||
return axiosInstance;
|
||||
@ -198,10 +187,10 @@ const configureRequest = async (
|
||||
const parseDataFromResponse = (response) => {
|
||||
const dataBuffer = Buffer.from(response.data);
|
||||
// Parse the charset from content type: https://stackoverflow.com/a/33192813
|
||||
const charset = /charset=([^()<>@,;:\"/[\]?.=\s]*)/i.exec(response.headers['Content-Type'] || '');
|
||||
const charset = /charset=([^()<>@,;:"/[\]?.=\s]*)/i.exec(response.headers['Content-Type'] || '');
|
||||
// Overwrite the original data for backwards compatability
|
||||
let data = dataBuffer.toString(charset || 'utf-8');
|
||||
// Try to parse response to JSON, this can quitly fail
|
||||
// Try to parse response to JSON, this can quietly fail
|
||||
try {
|
||||
data = JSON.parse(response.data);
|
||||
} catch {}
|
||||
|
@ -131,6 +131,12 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
||||
request.awsv4config.profileName = interpolate(request.awsv4config.profileName) || '';
|
||||
}
|
||||
|
||||
// interpolate vars for digest auth
|
||||
if (request.digestConfig) {
|
||||
request.digestConfig.username = interpolate(request.digestConfig.username) || '';
|
||||
request.digestConfig.password = interpolate(request.digestConfig.password) || '';
|
||||
}
|
||||
|
||||
return request;
|
||||
};
|
||||
|
||||
|
@ -29,6 +29,12 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
case 'bearer':
|
||||
axiosRequest.headers['authorization'] = `Bearer ${get(collectionAuth, 'bearer.token')}`;
|
||||
break;
|
||||
case 'digest':
|
||||
axiosRequest.digestConfig = {
|
||||
username: get(collectionAuth, 'digest.username'),
|
||||
password: get(collectionAuth, 'digest.password')
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,6 +59,11 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
case 'bearer':
|
||||
axiosRequest.headers['authorization'] = `Bearer ${get(request, 'auth.bearer.token')}`;
|
||||
break;
|
||||
case 'digest':
|
||||
axiosRequest.digestConfig = {
|
||||
username: get(request, 'auth.digest.username'),
|
||||
password: get(request, 'auth.digest.password')
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@usebruno/js",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"files": [
|
||||
@ -17,7 +17,7 @@
|
||||
"@usebruno/query": "0.1.0",
|
||||
"ajv": "^8.12.0",
|
||||
"atob": "^2.1.2",
|
||||
"axios": "^0.26.0",
|
||||
"axios": "^1.5.1",
|
||||
"btoa": "^1.2.1",
|
||||
"chai": "^4.3.7",
|
||||
"chai-string": "^1.5.0",
|
||||
@ -28,6 +28,7 @@
|
||||
"moment": "^2.29.4",
|
||||
"nanoid": "3.3.4",
|
||||
"node-fetch": "2.*",
|
||||
"uuid": "^9.0.0"
|
||||
"uuid": "^9.0.0",
|
||||
"node-vault": "^0.10.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
const Handlebars = require('handlebars');
|
||||
const { cloneDeep } = require('lodash');
|
||||
|
||||
const envVariableNameRegex = /^(?!\d)[\w-]*$/;
|
||||
|
||||
class Bru {
|
||||
constructor(envVariables, collectionVariables, processEnvVars, collectionPath) {
|
||||
this.envVariables = envVariables;
|
||||
@ -43,7 +45,7 @@ class Bru {
|
||||
|
||||
setEnvVar(key, value) {
|
||||
if (!key) {
|
||||
throw new Error('Key is required');
|
||||
throw new Error('Creating a env variable without specifying a name is not allowed.');
|
||||
}
|
||||
|
||||
// gracefully ignore if key is not present in environment
|
||||
@ -56,13 +58,13 @@ class Bru {
|
||||
|
||||
setVar(key, value) {
|
||||
if (!key) {
|
||||
throw new Error('Key is required');
|
||||
throw new Error('Creating a variable without specifying a name is not allowed.');
|
||||
}
|
||||
|
||||
if (/^(?!\d)\w*$/.test(key) === false) {
|
||||
if (envVariableNameRegex.test(key) === false) {
|
||||
throw new Error(
|
||||
`Variable name: "${key}" contains invalid characters!` +
|
||||
' Names must only contain alpha-numeric characters and cannot start with a digit.'
|
||||
' Names must only contain alpha-numeric characters, "-", "_" and cannot start with a digit.'
|
||||
);
|
||||
}
|
||||
|
||||
@ -70,7 +72,7 @@ class Bru {
|
||||
}
|
||||
|
||||
getVar(key) {
|
||||
if (/^(?!\d)\w*$/.test(key) === false) {
|
||||
if (envVariableNameRegex.test(key) === false) {
|
||||
throw new Error(
|
||||
`Variable name: "${key}" contains invalid characters!` +
|
||||
' Names must only contain alpha-numeric characters and cannot start with a digit.'
|
||||
|
@ -26,6 +26,7 @@ const axios = require('axios');
|
||||
const fetch = require('node-fetch');
|
||||
const chai = require('chai');
|
||||
const CryptoJS = require('crypto-js');
|
||||
const NodeVault = require('node-vault');
|
||||
|
||||
class ScriptRuntime {
|
||||
constructor() {}
|
||||
@ -112,7 +113,8 @@ class ScriptRuntime {
|
||||
'node-fetch': fetch,
|
||||
'crypto-js': CryptoJS,
|
||||
...whitelistedModules,
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined,
|
||||
'node-vault': NodeVault
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -201,7 +203,8 @@ class ScriptRuntime {
|
||||
'node-fetch': fetch,
|
||||
'crypto-js': CryptoJS,
|
||||
...whitelistedModules,
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined,
|
||||
'node-vault': NodeVault
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -28,6 +28,7 @@ const nanoid = require('nanoid');
|
||||
const axios = require('axios');
|
||||
const fetch = require('node-fetch');
|
||||
const CryptoJS = require('crypto-js');
|
||||
const NodeVault = require('node-vault');
|
||||
|
||||
class TestRuntime {
|
||||
constructor() {}
|
||||
@ -130,7 +131,8 @@ class TestRuntime {
|
||||
'node-fetch': fetch,
|
||||
'crypto-js': CryptoJS,
|
||||
...whitelistedModules,
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined
|
||||
fs: allowScriptFilesystemAccess ? fs : undefined,
|
||||
'node-vault': NodeVault
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ const { outdentString } = require('../../v1/src/utils');
|
||||
*/
|
||||
const grammar = ohm.grammar(`Bru {
|
||||
BruFile = (meta | http | query | headers | auths | bodies | varsandassert | script | tests | docs)*
|
||||
auths = authawsv4 | authbasic | authbearer
|
||||
auths = authawsv4 | authbasic | authbearer | authdigest
|
||||
bodies = bodyjson | bodytext | bodyxml | bodysparql | bodygraphql | bodygraphqlvars | bodyforms | body
|
||||
bodyforms = bodyformurlencoded | bodymultipart
|
||||
|
||||
@ -79,6 +79,7 @@ const grammar = ohm.grammar(`Bru {
|
||||
authawsv4 = "auth:awsv4" dictionary
|
||||
authbasic = "auth:basic" dictionary
|
||||
authbearer = "auth:bearer" dictionary
|
||||
authdigest = "auth:digest" dictionary
|
||||
|
||||
body = "body" st* "{" nl* textblock tagend
|
||||
bodyjson = "body:json" st* "{" nl* textblock tagend
|
||||
@ -350,6 +351,21 @@ const sem = grammar.createSemantics().addAttribute('ast', {
|
||||
}
|
||||
};
|
||||
},
|
||||
authdigest(_1, dictionary) {
|
||||
const auth = mapPairListToKeyValPairs(dictionary.ast, false);
|
||||
const usernameKey = _.find(auth, { name: 'username' });
|
||||
const passwordKey = _.find(auth, { name: 'password' });
|
||||
const username = usernameKey ? usernameKey.value : '';
|
||||
const password = passwordKey ? passwordKey.value : '';
|
||||
return {
|
||||
auth: {
|
||||
digest: {
|
||||
username,
|
||||
password
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
bodyformurlencoded(_1, dictionary) {
|
||||
return {
|
||||
body: {
|
||||
|
@ -4,7 +4,7 @@ const { outdentString } = require('../../v1/src/utils');
|
||||
|
||||
const grammar = ohm.grammar(`Bru {
|
||||
BruFile = (meta | query | headers | auth | auths | vars | script | tests | docs)*
|
||||
auths = authawsv4 | authbasic | authbearer
|
||||
auths = authawsv4 | authbasic | authbearer | authdigest
|
||||
|
||||
nl = "\\r"? "\\n"
|
||||
st = " " | "\\t"
|
||||
@ -41,6 +41,7 @@ const grammar = ohm.grammar(`Bru {
|
||||
authawsv4 = "auth:awsv4" dictionary
|
||||
authbasic = "auth:basic" dictionary
|
||||
authbearer = "auth:bearer" dictionary
|
||||
authdigest = "auth:digest" dictionary
|
||||
|
||||
script = scriptreq | scriptres
|
||||
scriptreq = "script:pre-request" st* "{" nl* textblock tagend
|
||||
@ -226,6 +227,21 @@ const sem = grammar.createSemantics().addAttribute('ast', {
|
||||
}
|
||||
};
|
||||
},
|
||||
authdigest(_1, dictionary) {
|
||||
const auth = mapPairListToKeyValPairs(dictionary.ast, false);
|
||||
const usernameKey = _.find(auth, { name: 'username' });
|
||||
const passwordKey = _.find(auth, { name: 'password' });
|
||||
const username = usernameKey ? usernameKey.value : '';
|
||||
const password = passwordKey ? passwordKey.value : '';
|
||||
return {
|
||||
auth: {
|
||||
digest: {
|
||||
username,
|
||||
password
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
varsreq(_1, dictionary) {
|
||||
const vars = mapPairListToKeyValPairs(dictionary.ast);
|
||||
_.each(vars, (v) => {
|
||||
|
@ -114,6 +114,15 @@ ${indentString(`password: ${auth.basic.password}`)}
|
||||
${indentString(`token: ${auth.bearer.token}`)}
|
||||
}
|
||||
|
||||
`;
|
||||
}
|
||||
|
||||
if (auth && auth.digest) {
|
||||
bru += `auth:digest {
|
||||
${indentString(`username: ${auth.digest.username}`)}
|
||||
${indentString(`password: ${auth.digest.password}`)}
|
||||
}
|
||||
|
||||
`;
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,15 @@ ${indentString(`password: ${auth.basic.password}`)}
|
||||
${indentString(`token: ${auth.bearer.token}`)}
|
||||
}
|
||||
|
||||
`;
|
||||
}
|
||||
|
||||
if (auth && auth.digest) {
|
||||
bru += `auth:digest {
|
||||
${indentString(`username: ${auth.digest.username}`)}
|
||||
${indentString(`password: ${auth.digest.password}`)}
|
||||
}
|
||||
|
||||
`;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,11 @@ auth:bearer {
|
||||
token: 123
|
||||
}
|
||||
|
||||
auth:digest {
|
||||
username: john
|
||||
password: secret
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
departingDate: 2020-01-01
|
||||
~returningDate: 2020-01-02
|
||||
|
@ -27,6 +27,10 @@
|
||||
},
|
||||
"bearer": {
|
||||
"token": "123"
|
||||
},
|
||||
"digest": {
|
||||
"username": "john",
|
||||
"password": "secret"
|
||||
}
|
||||
},
|
||||
"vars": {
|
||||
|
@ -40,6 +40,11 @@ auth:bearer {
|
||||
token: 123
|
||||
}
|
||||
|
||||
auth:digest {
|
||||
username: john
|
||||
password: secret
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"hello": "world"
|
||||
|
@ -59,6 +59,10 @@
|
||||
},
|
||||
"bearer": {
|
||||
"token": "123"
|
||||
},
|
||||
"digest": {
|
||||
"username": "john",
|
||||
"password": "secret"
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
|
@ -94,11 +94,19 @@ const authBearerSchema = Yup.object({
|
||||
.noUnknown(true)
|
||||
.strict();
|
||||
|
||||
const authDigestSchema = Yup.object({
|
||||
username: Yup.string().nullable(),
|
||||
password: Yup.string().nullable()
|
||||
})
|
||||
.noUnknown(true)
|
||||
.strict();
|
||||
|
||||
const authSchema = Yup.object({
|
||||
mode: Yup.string().oneOf(['none', 'awsv4', 'basic', 'bearer']).required('mode is required'),
|
||||
mode: Yup.string().oneOf(['none', 'awsv4', 'basic', 'bearer', 'digest']).required('mode is required'),
|
||||
awsv4: authAwsV4Schema.nullable(),
|
||||
basic: authBasicSchema.nullable(),
|
||||
bearer: authBearerSchema.nullable()
|
||||
bearer: authBearerSchema.nullable(),
|
||||
digest: authDigestSchema.nullable()
|
||||
})
|
||||
.noUnknown(true)
|
||||
.strict();
|
||||
|
@ -1,3 +1,5 @@
|
||||
**English** | [Português (BR)](docs/publishing/publishing_pt_br.md)
|
||||
|
||||
### Publishing Bruno to a new package manager
|
||||
|
||||
While our code is open source and available for everyone to use, we kindly request that you reach out to us before considering publication on new package managers. As the creator of Bruno, I hold the trademark `Bruno` for this project and would like to manage its distribution. If you'd like to see Bruno on a new package manager, please raise a GitHub issue.
|
||||
|
@ -10,7 +10,7 @@
|
||||
[![Website](https://img.shields.io/badge/Website-Visit-blue)](https://www.usebruno.com)
|
||||
[![Download](https://img.shields.io/badge/Download-Latest-brightgreen)](https://www.usebruno.com/downloads)
|
||||
|
||||
**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) | [한국어](docs/readme/readme_kr.md)
|
||||
**English** | [Українська](docs/readme/readme_ua.md) | [Русский](docs/readme/readme_ru.md) | [Türkçe](docs/readme/readme_tr.md) | [Deutsch](docs/readme/readme_de.md) | [Français](docs/readme/readme_fr.md) | [Português (BR)](docs/readme/readme_pt_br.md)) | [한국어](docs/readme/readme_kr.md)
|
||||
|
||||
Bruno is a new and innovative API client, aimed at revolutionizing the status quo represented by Postman and similar tools out there.
|
||||
|
||||
@ -65,6 +65,7 @@ Or any version control system of your choice
|
||||
- [Our Long Term Vision](https://github.com/usebruno/bruno/discussions/269)
|
||||
- [Roadmap](https://github.com/usebruno/bruno/discussions/384)
|
||||
- [Documentation](https://docs.usebruno.com)
|
||||
- [Stack Overflow](https://stackoverflow.com/questions/tagged/bruno)
|
||||
- [Website](https://www.usebruno.com)
|
||||
- [Pricing](https://www.usebruno.com/pricing)
|
||||
- [Download](https://www.usebruno.com/downloads)
|
||||
|
Loading…
Reference in New Issue
Block a user