tox.ini
author Laurent Peuch <cortex@worlddomination.be>
Fri, 12 Apr 2019 12:31:14 +0200
changeset 12584 6eba53763482
parent 12567 26744ad37953
child 12628 7b89cad574f8
permissions -rw-r--r--
Use secure hash algorithm in WebConfiguration.sign_text Fix: PendingDeprecationWarning: HMAC() without an explicit digestmod argument is deprecated. The default hash algorithm used by hmac.new is md5. As of today, md5 is so weak that it's the equivalent of plaintext and can't be considered to be secured at all. Therefor, we switch to a secure hash algorithm. The rational for choosing sha3_512 is: * the recommended algorithm is at least sha_256 * the stronger, the more secured and sha3_512 is the stronger available * thinking about the future this should keep this part of the code safe long enough before people think about checking it again You can read more about choosing a secure hash algorithm in the NIST recommendations https://csrc.nist.gov/Projects/Hash-Functions/NIST-Policy-on-Hash-Functions This code modification should normally be transparent since check_text_sign is exactly this code 'self.sign_text(text) == signature' and that sign_text is only used in combination with it. The only impact is that the hash is going to move from 32 char to 128 which might make html page a bit bigger and that sha3_512 is slow to compute (which is a good thing for security)

[tox]
envlist =
  check-manifest,flake8,
  py3-{server,web,misc}

[testenv]
basepython=python3
deps =
  -r{toxinidir}/requirements/dev.txt
  misc: -r{toxinidir}/requirements/test-misc.txt
  server: -r{toxinidir}/requirements/test-server.txt
  web: -r{toxinidir}/requirements/test-web.txt
commands =
  misc: {envpython} -m pip install --upgrade --no-deps --quiet git+git://github.com/logilab/yapps@master#egg=yapps
  misc: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
  server: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/server/test
  web: {envpython} -m pytest {posargs} {toxinidir}/cubicweb/web/test

[testenv:flake8]
skip_install = true
deps =
  flake8 >= 3.6
whitelist_externals =
  /bin/sh
commands = /bin/sh -c "flake8 `xargs -a {toxinidir}/flake8-ok-files.txt`"

[testenv:doc]
skip_install = true
changedir = doc
deps =
  sphinx
  -r{toxinidir}/requirements/doc.txt
commands =
  {envpython} -m sphinx -b html -d {envtmpdir}/doctrees .  {envtmpdir}/html

[testenv:check-manifest]
skip_install = true
deps =
  check-manifest
commands =
  {envpython} -m check_manifest {toxinidir} \
# ignore symlinks that are not recognized by check-manifest, see
# https://github.com/mgedmin/check-manifest/issues/69
    --ignore cubicweb/devtools/test/data/cubes/i18ntestcube*,cubicweb/server/test/data-migractions/cubicweb_*,cubicweb/server/test/data-migractions/migratedapp/cubicweb_*,cubicweb/sobjects/test/data/cubicweb_*,cubicweb/test/data-rewrite/cubicweb_*

[pytest]
python_files = *test_*.py
log_print = false

[flake8]
format = pylint
ignore = W503
max-line-length = 100
exclude = doc/*,.tox/*


# vim: wrap sts=2 sw=2