-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bugfix/filename-validation
- Loading branch information
Showing
90 changed files
with
2,206 additions
and
754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Description | ||
|
||
<!-- Explain here the changes your PR introduces and text to help us understand the context of this change. --> | ||
|
||
### Contribution Checklist: | ||
|
||
- [ ] **The pull request only addresses one issue or adds one feature.** | ||
- [ ] **The pull request does not introduce any breaking changes** | ||
- [ ] **I have added screenshots or gifs to help explain the change if applicable.** | ||
- [ ] **I have read the [contribution guidelines](https://github.com/usebruno/bruno/blob/main/contributing.md).** | ||
- [ ] **Create an issue and link to the pull request.** | ||
|
||
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[English](/contributing.md) | **Українська** | [Русский](/contributing_ru.md) | ||
|
||
## Давайте зробимо Bruno краще, разом !! | ||
|
||
Я дуже радий що Ви бажаєте покращити Bruno. Нижче наведені вказівки як розпочати розробку Bruno на Вашому комп'ютері. | ||
|
||
### Стек технологій | ||
|
||
Bruno побудований на NextJs та React. Також для десктопної версії (яка підтримує локальні колекції) використовується Electron | ||
|
||
Бібліотеки, які ми використовуємо | ||
|
||
- CSS - Tailwind | ||
- Редактори коду - Codemirror | ||
- Керування станом - Redux | ||
- Іконки - Tabler Icons | ||
- Форми - formik | ||
- Валідація по схемі - Yup | ||
- Клієнт запитів - axios | ||
- Спостерігач за файловою системою - chokidar | ||
|
||
### Залежності | ||
|
||
Вам знадобиться [Node v18.x або остання LTS версія](https://nodejs.org/en/) та npm 8.x. Ми використовуєм npm workspaces в цьому проекті | ||
|
||
### Починаєм писати код | ||
|
||
Будь ласка, зверніться до [development_ua.md](docs/development_ua.md) за інструкціями щодо запуску локального середовища розробки. | ||
|
||
### Створення Pull Request-ів | ||
|
||
- Будь ласка, робіть PR-и маленькими і сфокусованими на одній речі | ||
- Будь ласка, слідуйте формату назв гілок | ||
- feature/[назва feature]: Така гілка має містити зміни лише щодо конкретної feature | ||
- Приклад: feature/dark-mode | ||
- bugfix/[назва баґу]: Така гілка має містити лише виправлення конкретного багу | ||
- Приклад: bugfix/bug-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[English](/docs/development.md) | **Українська** | [Русский](/docs/development_ru.md) | ||
|
||
## Розробка | ||
|
||
Bruno розробляється як декстопний застосунок. Вам потрібно запустити nextjs в одній сесії терміналу, та запустити застосунок Electron в іншій сесії терміналу. | ||
|
||
### Залежності | ||
|
||
- NodeJS v18 | ||
|
||
### Локальна розробка | ||
|
||
```bash | ||
# Використовуйте nodejs 18-ї версії | ||
nvm use | ||
|
||
# встановіть залежності | ||
npm i --legacy-peer-deps | ||
|
||
# зберіть документацію graphql | ||
npm run build:graphql-docs | ||
|
||
# зберіть bruno query | ||
npm run build:bruno-query | ||
|
||
# запустіть додаток next (термінал 1) | ||
npm run dev:web | ||
|
||
# запустіть додаток електрон (термінал 2) | ||
npm run dev:electron | ||
``` | ||
|
||
### Усунення несправностей | ||
|
||
Ви можете зтикнутись із помилкою `Unsupported platform` коли запускаєте `npm install`. Щоб усунути цю проблему, вам потрібно видалити `node_modules` та `package-lock.json`, і тоді запустити `npm install`. Це має встановити всі потрібні для запуску додатку пекеджі. | ||
|
||
```shell | ||
# Видаліть node_modules в піддиректоріях | ||
find ./ -type d -name "node_modules" -print0 | while read -d $'\0' dir; do | ||
rm -rf "$dir" | ||
done | ||
|
||
# Видаліть package-lock в піддиректоріях | ||
find . -type f -name "package-lock.json" -delete | ||
``` | ||
|
||
### Тестування | ||
|
||
```bash | ||
# bruno-schema | ||
npm test --workspace=packages/bruno-schema | ||
|
||
# bruno-lang | ||
npm test --workspace=packages/bruno-lang | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/StyledWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledWrapper = styled.div` | ||
.settings-label { | ||
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; | ||
box-shadow: none; | ||
border-radius: 0px; | ||
outline: none; | ||
box-shadow: none; | ||
transition: border-color ease-in-out 0.1s; | ||
border-radius: 3px; | ||
background-color: ${(props) => props.theme.modal.input.bg}; | ||
border: 1px solid ${(props) => props.theme.modal.input.border}; | ||
&:focus { | ||
border: solid 1px ${(props) => props.theme.modal.input.focusBorder} !important; | ||
outline: none !important; | ||
} | ||
} | ||
`; | ||
|
||
export default StyledWrapper; |
130 changes: 130 additions & 0 deletions
130
packages/bruno-app/src/components/CollectionSettings/ClientCertSettings/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
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'; | ||
|
||
const ClientCertSettings = ({ clientCertConfig, onUpdate, onRemove }) => { | ||
const formik = useFormik({ | ||
initialValues: { | ||
domain: '', | ||
certFilePath: '', | ||
keyFilePath: '', | ||
passphrase: '' | ||
}, | ||
validationSchema: Yup.object({ | ||
domain: Yup.string().required(), | ||
certFilePath: Yup.string().required(), | ||
keyFilePath: Yup.string().required(), | ||
passphrase: Yup.string() | ||
}), | ||
onSubmit: (values) => { | ||
onUpdate(values); | ||
} | ||
}); | ||
|
||
const getFile = (e) => { | ||
formik.values[e.name] = e.files[0].path; | ||
}; | ||
|
||
return ( | ||
<StyledWrapper> | ||
<div className="flex items-center font-semibold mt-4 mb-2"> | ||
<IconCertificate className="mr-1 certificate-icon" size={24} strokeWidth={1.5} /> Client Certificates | ||
</div> | ||
<ul className="mt-4"> | ||
{!clientCertConfig.length | ||
? 'None' | ||
: clientCertConfig.map((clientCert) => ( | ||
<li key={uuid()} className="flex items-center available-certificates p-2 rounded-lg mb-2"> | ||
<div className="flex items-center w-full justify-between"> | ||
<div className="flex items-center"> | ||
<IconWorld className="mr-2" size={18} strokeWidth={1.5} /> | ||
{clientCert.domain} | ||
</div> | ||
<button onClick={() => onRemove(clientCert)} className="remove-certificate ml-2"> | ||
<IconTrash size={18} strokeWidth={1.5} /> | ||
</button> | ||
</div> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
<h1 className="font-semibold mt-8 mb-2">Add Client Certicate</h1> | ||
<form className="bruno-form" onSubmit={formik.handleSubmit}> | ||
<div className="mb-3 flex items-center"> | ||
<label className="settings-label" htmlFor="domain"> | ||
Domain | ||
</label> | ||
<input | ||
id="domain" | ||
type="text" | ||
name="domain" | ||
placeholder="*.example.org" | ||
className="block textbox" | ||
onChange={formik.handleChange} | ||
value={formik.values.domain || ''} | ||
/> | ||
{formik.touched.domain && formik.errors.domain ? ( | ||
<div className="ml-1 text-red-500">{formik.errors.domain}</div> | ||
) : null} | ||
</div> | ||
<div className="mb-3 flex items-center"> | ||
<label className="settings-label" htmlFor="certFilePath"> | ||
Cert file | ||
</label> | ||
<input | ||
id="certFilePath" | ||
type="file" | ||
name="certFilePath" | ||
className="block" | ||
onChange={(e) => getFile(e.target)} | ||
/> | ||
{formik.touched.certFilePath && formik.errors.certFilePath ? ( | ||
<div className="ml-1 text-red-500">{formik.errors.certFilePath}</div> | ||
) : null} | ||
</div> | ||
<div className="mb-3 flex items-center"> | ||
<label className="settings-label" htmlFor="keyFilePath"> | ||
Key file | ||
</label> | ||
<input | ||
id="keyFilePath" | ||
type="file" | ||
name="keyFilePath" | ||
className="block" | ||
onChange={(e) => getFile(e.target)} | ||
/> | ||
{formik.touched.keyFilePath && formik.errors.keyFilePath ? ( | ||
<div className="ml-1 text-red-500">{formik.errors.keyFilePath}</div> | ||
) : null} | ||
</div> | ||
<div className="mb-3 flex items-center"> | ||
<label className="settings-label" htmlFor="passphrase"> | ||
Passphrase | ||
</label> | ||
<input | ||
id="passphrase" | ||
type="text" | ||
name="passphrase" | ||
className="block textbox" | ||
onChange={formik.handleChange} | ||
value={formik.values.passphrase || ''} | ||
/> | ||
{formik.touched.passphrase && formik.errors.passphrase ? ( | ||
<div className="ml-1 text-red-500">{formik.errors.passphrase}</div> | ||
) : null} | ||
</div> | ||
<div className="mt-6"> | ||
<button type="submit" className="submit btn btn-sm btn-secondary"> | ||
Add | ||
</button> | ||
</div> | ||
</form> | ||
</StyledWrapper> | ||
); | ||
}; | ||
|
||
export default ClientCertSettings; |
Oops, something went wrong.