Skip to content

Commit

Permalink
Merge pull request #90 from Luminger/cleanup-dev
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
blabla1337 committed Jun 29, 2016
2 parents c8ccaee + d39afac commit 0e1e922
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 46 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
@@ -0,0 +1,3 @@
[run]
omit = *.html
source = skf
107 changes: 107 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,110 @@ skf/skf.pyc
skf/test_skf.pyc
skf/server.crt
skf/server.key

# From: https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
# License: CC0 1.0 Universal

# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags


# From: https://github.com/github/gitignore/blob/master/Python.gitignore
# License: CC0 1.0 Universal
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
11 changes: 2 additions & 9 deletions .travis.yml
Expand Up @@ -4,18 +4,11 @@ python:
- "2.6"
- "2.7"
install:
- pip install owasp-skf
- pip install https://github.com/mitsuhiko/flask/tarball/master
- pip install pytest-cov
- pip install coverage
- pip install python-coveralls
- pip install importlib

- python setup.py install
script:
- python setup.py test
- cd skf
- python -m pytest --cov test_skf.py
after_script:
- coverage run test_skf.py test
after_success:
- coverage run setup.py test
- coveralls
2 changes: 2 additions & 0 deletions pytest.ini
@@ -0,0 +1,2 @@
[pytest]
testpaths = skf
10 changes: 4 additions & 6 deletions requirements.txt
@@ -1,11 +1,9 @@
https://github.com/mitsuhiko/flask/tarball/master#egg=flask
lxml==3.4.2
flask==0.11.1, <0.12
markdown==2.6.3
cryptography==0.8.2
pyOpenSSL
python-docx
BeautifulSoup
python-docx
lxml==3.4.2
pyOpenSSL
requests
importlib
bcrypt
flask-bcrypt
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[aliases]
test=pytest
25 changes: 16 additions & 9 deletions setup.py
Expand Up @@ -3,8 +3,12 @@
except ImportError:
from distutils.core import setup

filename = "%s/version.py" % 'skf'
with open(filename) as f:
exec(f.read())

setup(name='owasp-skf',
version='1.3.17',
version=__version__,
description='The OWASP Security Knowledge Framework',
url='https://github.com/blabla1337/skf-flask',
author='Glenn ten Cate, Riccardo ten Cate',
Expand All @@ -17,14 +21,17 @@
The Security Knowledge Framework is an fully open-source Python-Flask web-application.
It is an expert system application that uses OWASP Application Security Verification Standard
""",
<<<<<<< HEAD
install_requires=['markdown','BeautifulSoup', 'python-docx','lxml==3.4.2', 'cryptography==0.8.2', 'pyOpenSSL', 'requests', 'importlib', 'bcrypt', 'flask-bcrypt'],
=======
install_requires=['markdown==2.6.3','BeautifulSoup', 'python-docx','lxml==3.4.2', 'cryptography==0.8.2', 'pyOpenSSL', 'requests', 'importlib','flask-bcrypt'],
>>>>>>> origin/master
dependency_links= [
'https://github.com/mitsuhiko/flask/tarball/master#egg=Flask-owasp'
],
install_requires=['flask>0.11, <0.12',
'markdown==2.6.3',
'BeautifulSoup',
'python-docx',
'lxml==3.4.2',
'pyOpenSSL',
'requests',
'importlib',
'flask-bcrypt'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'jsonschema'],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Flask",
Expand Down
Empty file added skf/__init__.py
Empty file.
20 changes: 4 additions & 16 deletions skf/skf.py
Expand Up @@ -30,8 +30,8 @@
from flask.ext.bcrypt import Bcrypt
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash, Markup, make_response

from . import version

# create the application
app = Flask(__name__)
Expand Down Expand Up @@ -91,11 +91,6 @@ def log(message, value, threat):
# If not exists, create the file
file = open('logs/'+dateLog+'.txt', 'w+')
file.write(dateTime +' '+ message +' ' + ' ' + value + ' ' + threat + ' ' +ip + "\r\n")
<<<<<<< HEAD
file.close()

def valAlphaNum(value, countLevel):
=======
file.close()

def blockUsers():
Expand All @@ -116,8 +111,7 @@ def blockUsers():
if count > 11:
sys.exit('Due to to many FAILED logs in your logging file we have the suspicion your application has been under attack by hackers. Please check your log files to validate and take repercussions. After validation clear your log or simply change the FAIL items to another value.')

def valAlphaNum(value):
>>>>>>> origin/master
def valAlphaNum(value, countLevel):
match = re.findall(r"[^ a-zA-Z0-9_.-]", value)
if match:
log("User supplied not an a-zA-Z0-9 value", "FAIL", "MEDIUM")
Expand Down Expand Up @@ -255,9 +249,7 @@ def check_version():
return False

def get_version():
with open ("version.txt", "r") as myfile:
version_final = myfile.read().replace('\n', '')
return version_final
return version.__version__

def projects_functions_techlist():
"""get list of technology used for creating project functions"""
Expand Down Expand Up @@ -1609,10 +1601,6 @@ def download_file_function(projectID):
return make_response((body, headers))

if __name__ == "__main__":
<<<<<<< HEAD
=======
print("Generated Password for access SKF: test-skf")
>>>>>>> origin/master
#Command line options to enable debug and/or saas (bind to 0.0.0.0)
cmdargs = str(sys.argv)
total = len(sys.argv)
Expand Down
5 changes: 1 addition & 4 deletions skf/static/js/actions.js
Expand Up @@ -151,11 +151,8 @@ $(document).ready(function() {

$("#accordion .panel a:contains('not available item')").parent().parent().parent().remove();

<<<<<<< HEAD
// Select Items

=======
>>>>>>> origin/master

$( "#selectable" ).bind( "mousedown", function ( e ) {
e.metaKey = true;
} ).selectable({
Expand Down
4 changes: 2 additions & 2 deletions skf/test_skf.py → skf/test/test_skf.py
Expand Up @@ -7,9 +7,9 @@

import pytest
import tempfile
import os
import os
import datetime
import skf
from skf import skf


@pytest.fixture
Expand Down
1 change: 1 addition & 0 deletions skf/version.py
@@ -0,0 +1 @@
__version__ = '1.3.37'

0 comments on commit 0e1e922

Please sign in to comment.