write tests and changelog

This commit is contained in:
ziirish 2018-10-10 23:14:42 +02:00
parent 58e811ef4a
commit 182f8d36b3
No known key found for this signature in database
GPG key ID: 72DB229A64B54E46
4 changed files with 99 additions and 0 deletions

View file

@ -8,6 +8,7 @@ Current
- Add: new `audit logging <https://git.ziirish.me/ziirish/burp-ui/issues/260>`_ system
- Add: new ``bui-monitor`` processes pool + ``async`` backend to parallelize some requests `#278 <https://git.ziirish.me/ziirish/burp-ui/issues/278>`_
- Add: new `listen` and `listen_status` options in burp-2.2.10 `#279 <https://git.ziirish.me/ziirish/burp-ui/issues/279>`_
- Add: allow to hide selected clients/servers `#282 <https://git.ziirish.me/ziirish/burp-ui/issues/282>`_
- Fix: issue `#268 <https://git.ziirish.me/ziirish/burp-ui/issues/268>`_
- `Full changelog <https://git.ziirish.me/ziirish/burp-ui/compare/0.6.0...master>`__

View file

@ -0,0 +1,52 @@
# Burp-UI configuration file
# @version@ - 0.3.0
# @release@ - stable
[Global]
# On which port is the application listening
port = 5001
# On which address is the application listening
# '::' is the default for all IPv6
bind = ::
# enable SSL
ssl = false
# ssl cert
sslcert = /etc/burp/ssl_cert-server.pem
# ssl key
sslkey = /etc/burp/ssl_cert-server.key
backend = burp1
# authentication plugin (mandatory)
# list the misc/auth directory to see the available backends
# to disable authentication you can set "auth: none"
auth = basic
[Production]
# database url to store some persistent data
database = sqlite://
[UI]
# refresh interval of the pages in seconds
refresh = 15
# burp backend specific options
[Burp]
# burp status address (can only be '127.0.0.1' or '::1'
bhost = 127.0.0.1
# burp status port
bport = 9999
# burp binary
burpbin = /dev/null
# vss_strip binary
stripbin = /dev/null
# temporary dir for the on the fly restoration
tmpdir = /dev/null
# burp client configuration file used for the restoration (Default: None)
bconfcli = /dev/null
# burp server configuration file used for the setting page
bconfsrv = /dev/null
# Please DO NOT touch the following line
# @salted@
[BASIC]
priority = toto
toto = pbkdf2:sha1:1000$HT0gMoYz$7540515e58f4ba54305664275a14ca5281c5d465
admin = pbkdf2:sha1:1000$Dgq3Nimi$5befb4cf4c3a7da2549679732908df5f0298b016

24
tests/conftest.py Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf8 -*-
import pytest
import sys
import os
sys.path.append('{0}/..'.format(os.path.join(os.path.dirname(os.path.realpath(__file__)))))
from burpui import create_app as BUIinit
@pytest.fixture
def app():
conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'configs/test_api_prefs.cfg')
bui = BUIinit(conf, logfile='/dev/null', gunicorn=False, unittest=True)
bui.config['TESTING'] = True
bui.config['SECRET_KEY'] = 'nyan'
with bui.app_context():
from burpui.ext.sql import db
from burpui.models import lazy_loading
lazy_loading()
db.create_all()
db.session.commit()
yield bui

22
tests/test_prefs_api.py Normal file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf8 -*-
import pytest
from flask import url_for
def login(client, username, password):
url = url_for('view.login')
return client.post(url, data=dict(
username=username,
password=password,
language='en'
), follow_redirects=True)
def test_prefs_hide(client):
rv = login(client, 'admin', 'admin')
URL = url_for('api.prefs_ui_hide')
response = client.get(URL)
assert response.json == []
response = client.put(URL, data=dict(name='test', agent=None))
assert response.json == {'client': 'test', 'server': None}